os-name 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +10 -1
  2. data/lib/os-name.rb +19 -1
  3. data/lib/os-name/version.rb +1 -1
  4. metadata +1 -1
data/README.md CHANGED
@@ -7,8 +7,17 @@ A miniscule Ruby gem for checking host OS.
7
7
  ```ruby
8
8
  require 'os-name'
9
9
 
10
- OS.name
10
+ OS.to_s
11
11
  #=> "OS X"
12
+
13
+ OS.to_sym
14
+ #=> :osx
15
+
16
+ OS.linux?
17
+ #=> false
18
+
19
+ OS.osx?
20
+ #=> true
12
21
  ```
13
22
 
14
23
  ## Installation
@@ -22,7 +22,17 @@ module OS
22
22
  end
23
23
 
24
24
  alias to_s name
25
-
25
+
26
+ def to_sym
27
+ name.downcase.delete(' ').to_sym
28
+ end
29
+
30
+ alias intern to_sym
31
+
32
+ def linux?
33
+ name == 'Linux'
34
+ end
35
+
26
36
  def osx?
27
37
  name == 'OS X'
28
38
  end
@@ -30,5 +40,13 @@ module OS
30
40
  def windows?
31
41
  name == 'Windows'
32
42
  end
43
+
44
+ def solaris?
45
+ name == 'Solaris'
46
+ end
47
+
48
+ def bsd?
49
+ name == 'BSD'
50
+ end
33
51
  end
34
52
  end
@@ -1,3 +1,3 @@
1
1
  module OS
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: os-name
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: