os 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/os.rb +49 -44
  3. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.2
data/lib/os.rb CHANGED
@@ -1,53 +1,58 @@
1
1
  class OS
2
2
 
3
- require 'rbconfig'
4
- host_os = RbConfig::CONFIG['host_os']
5
- if host_os =~ /mswin|mingw/
6
- WINDOZE = true
7
- else
8
- WINDOZE = false
9
- end
10
-
11
- # OS.windows?
12
- # true if on windows [and/or jruby]
13
- # false if on linux or cygwin
14
- def self.windows?
15
- WINDOZE
16
- end
17
-
18
- def self.linux?
19
- !WINDOZE
20
- end
21
-
22
- class << self
23
- alias :windoze? :windows? #the joke one
24
- end
25
-
26
- if host_os =~ /32/
27
- BITS = 32
28
- else
29
- if host_os =~ /64/
3
+ # treat cygwin as linux
4
+ # also treat IronRuby on mono as...linux
5
+
6
+ if RUBY_PLATFORM =~ /cygwin/ # i386-cygwin
7
+ WINDOZE = false
8
+ elsif ENV['OS'] == 'Windows_NT'
9
+ WINDOZE = true
10
+ else
11
+ WINDOZE = false
12
+ end
13
+
14
+ # OS.windows?
15
+ # true if on windows [and/or jruby]
16
+ # false if on linux or cygwin
17
+ def self.windows?
18
+ WINDOZE
19
+ end
20
+
21
+ def self.linux?
22
+ !WINDOZE
23
+ end
24
+
25
+ class << self
26
+ alias :windoze? :windows? #the joke one
27
+ end
28
+
29
+ require 'rbconfig'
30
+ host_os = RbConfig::CONFIG['host_os']
31
+ if host_os =~ /32/
32
+ BITS = 32
33
+ else
34
+ if host_os =~ /64/
35
+ BITS = 64
36
+ else # cygwin
37
+ if (1<<32).class == Fixnum
30
38
  BITS = 64
31
- else # cygwin
32
- if (1<<32).class == Fixnum
33
- BITS = 64
34
- else
35
- BITS = 32
36
- end
39
+ else
40
+ BITS = 32
37
41
  end
38
42
  end
43
+ end
39
44
 
40
45
 
41
- def self.bits
42
- BITS
43
- end
46
+ def self.bits
47
+ BITS
48
+ end
44
49
 
45
- def self.java?
46
- if RUBY_PLATFORM =~ /java/
47
- true
48
- else
49
- false
50
- end
51
- end
50
+ def self.java?
51
+ if RUBY_PLATFORM =~ /java/
52
+ true
53
+ else
54
+ false
55
+ end
56
+ end
52
57
 
53
- end
58
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: os
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - rdp
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-21 00:00:00 -07:00
12
+ date: 2009-12-29 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency