File: platform.rb

package info (click to toggle)
ruby-echoe 4.6.3-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 240 kB
  • sloc: ruby: 1,047; makefile: 2
file content (37 lines) | stat: -rw-r--r-- 610 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

### Platform check regexes

module Echoe::Platform
  def self.windows?
    @windows ||= RUBY_PLATFORM =~ /djgpp|(cyg|ms|bcc)win|mingw/
    !@windows.nil?
  end

  def self.gcc?
    @gcc ||= RUBY_PLATFORM =~ /mingw/
    !@gcc.nil?
  end

  def self.msvc?
    @msvc ||= RUBY_PLATFORM =~ /mswin/
    !@msvc.nil?
  end

  def self.java?
    @java ||= RUBY_PLATFORM =~ /java/
    !@java.nil?
  end

  def self.suffix
    Gem.default_exec_format =~ /%s(.*)/
    @suffix ||= $1
  end

  def self.rake
    windows? ? "rake#{suffix}.bat" : "rake#{suffix}"
  end

  def self.make
    msvc? ? 'nmake' : 'make'
  end
end