os 0.0.0 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Rakefile CHANGED
@@ -5,13 +5,14 @@ begin
5
5
  require 'jeweler'
6
6
  Jeweler::Tasks.new do |gem|
7
7
  gem.name = "os"
8
- gem.summary = %Q{simple and easy examination of the characteristics of the given box you're running on}
9
- gem.description = %Q{The OS gem allows for some useful and easy functions, like OS.windows? OS.bits ( => 32 or 64) etc"}
8
+ gem.summary = %Q{Simple and easy way to know if you're on windows or not (reliably), as well as how many bits the OS is, etc.}
9
+ gem.description = %Q{The OS gem allows for some useful and easy functions, like OS.windows? (=> true or false) OS.bits ( => 32 or 64) etc"}
10
10
  gem.email = "rogerpack2005@gmail.com"
11
11
  gem.homepage = "http://github.com/rdp/os"
12
12
  gem.authors = ["rdp"]
13
13
  gem.add_development_dependency "rspec", ">= 1.2.9"
14
14
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
15
+ gem.add_development_dependency "sane"
15
16
  end
16
17
  Jeweler::GemcutterTasks.new
17
18
  rescue LoadError
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.0
1
+ 0.1.0
data/lib/os.rb CHANGED
@@ -0,0 +1,25 @@
1
+ class OS
2
+
3
+ require 'rbconfig'
4
+ host_os = RbConfig::CONFIG['host_os']
5
+ WINDOZE = true if host_os =~ /mswin|mingw/
6
+
7
+ # OS.windows?
8
+ # true if on windows [and/or jruby]
9
+ # false if on linux or cygwin
10
+ def self.windows?
11
+ WINDOZE
12
+ end
13
+
14
+ if host_os =~ /32/
15
+ BITS = 32
16
+ else
17
+ raise unless host_os =~ /64/
18
+ BITS = 64
19
+ end
20
+
21
+ def self.bits
22
+ BITS
23
+ end
24
+
25
+ end
@@ -1,7 +1,20 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
1
+ require 'sane'
2
+ require_rel '../lib/os'
3
+ require 'spec/autorun'
2
4
 
3
- describe "Os" do
4
- it "fails" do
5
- fail "hey buddy, you should probably rename this file and start specing for real"
5
+ describe "OS" do
6
+
7
+ it "has a windows? method" do
8
+ if RUBY_PLATFORM =~ /mingw|mswin/
9
+ assert OS.windows? == true
10
+ else
11
+ assert OS.windows? == false
12
+ end
13
+ end
14
+
15
+ it "has a bits method" do
16
+ if RUBY_PLATFORM =~ /mingw32/
17
+ assert OS.bits == 32
18
+ end
6
19
  end
7
20
  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.0.0
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - rdp
@@ -22,7 +22,17 @@ dependencies:
22
22
  - !ruby/object:Gem::Version
23
23
  version: 1.2.9
24
24
  version:
25
- description: The OS gem allows for some useful and easy functions, like OS.windows? OS.bits ( => 32 or 64) etc"
25
+ - !ruby/object:Gem::Dependency
26
+ name: sane
27
+ type: :development
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: "0"
34
+ version:
35
+ description: The OS gem allows for some useful and easy functions, like OS.windows? (=> true or false) OS.bits ( => 32 or 64) etc"
26
36
  email: rogerpack2005@gmail.com
27
37
  executables: []
28
38
 
@@ -38,8 +48,6 @@ files:
38
48
  - VERSION
39
49
  - lib/os.rb
40
50
  - spec/os_spec.rb
41
- - spec/spec.opts
42
- - spec/spec_helper.rb
43
51
  has_rdoc: true
44
52
  homepage: http://github.com/rdp/os
45
53
  licenses: []
@@ -67,7 +75,6 @@ rubyforge_project:
67
75
  rubygems_version: 1.3.5
68
76
  signing_key:
69
77
  specification_version: 3
70
- summary: simple and easy examination of the characteristics of the given box you're running on
78
+ summary: Simple and easy way to know if you're on windows or not (reliably), as well as how many bits the OS is, etc.
71
79
  test_files:
72
80
  - spec/os_spec.rb
73
- - spec/spec_helper.rb
@@ -1 +0,0 @@
1
- --color
@@ -1,9 +0,0 @@
1
- $LOAD_PATH.unshift(File.dirname(__FILE__))
2
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
- require 'os'
4
- require 'spec'
5
- require 'spec/autorun'
6
-
7
- Spec::Runner.configure do |config|
8
-
9
- end