which_osx 1.0.3 → 1.0.4
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/README.md +28 -17
- data/lib/version.rb +2 -2
- data/lib/which_osx.rb +3 -3
- data/spec/which_osx_spec.rb +5 -5
- metadata +2 -18
data/README.md
CHANGED
@@ -1,17 +1,20 @@
|
|
1
|
-
|
1
|
+
# which_osx
|
2
2
|
|
3
|
-
|
3
|
+

|
4
4
|
|
5
|
-
|
5
|
+
- http://github.com/imkmf/which_osx
|
6
6
|
|
7
|
-
|
7
|
+
## DESCRIPTION:
|
8
8
|
|
9
|
-
|
9
|
+
A simple ruby program for outputting some information about your Mac.
|
10
10
|
|
11
|
-
|
12
|
-
* TODO : Catch if it's *not* OS X - whether that's Windows, or Linux.
|
11
|
+
## FEATURES/PROBLEMS:
|
13
12
|
|
14
|
-
|
13
|
+
- Uses the terminal command `sw_vers` and parses it into a readable format.
|
14
|
+
|
15
|
+
- **This doesn't work on anything but Mac. Seriously. You won't be able to do much with this gem on anywhere but OS X.**
|
16
|
+
|
17
|
+
## USAGE:
|
15
18
|
|
16
19
|
which_osx can be imported into a project and used to return the current version of OS X (as of writing, my computer returns "10.7.3"):
|
17
20
|
|
@@ -23,20 +26,28 @@ which_osx can be imported into a project and used to return the current version
|
|
23
26
|
end
|
24
27
|
end
|
25
28
|
|
26
|
-
|
29
|
+
which_osx version 1.0.3 adds new methods for different outputs:
|
30
|
+
|
31
|
+
$ WhichOSX.full_name
|
32
|
+
=> Mac OS X 10.7.3
|
33
|
+
|
34
|
+
$ WhichOSX.short_name
|
35
|
+
=> Lion
|
36
|
+
|
37
|
+
Running from the command line returns the OS version by default:
|
27
38
|
|
28
|
-
|
29
|
-
|
39
|
+
$ which_osx
|
40
|
+
=> 10.7.3
|
30
41
|
|
31
|
-
|
42
|
+
## REQUIREMENTS:
|
32
43
|
|
33
|
-
|
44
|
+
- None
|
34
45
|
|
35
|
-
|
46
|
+
## INSTALL:
|
36
47
|
|
37
48
|
sudo gem install which_osx
|
38
49
|
|
39
|
-
|
50
|
+
## DEVELOPERS:
|
40
51
|
|
41
52
|
After checking out the source, run:
|
42
53
|
|
@@ -45,11 +56,11 @@ After checking out the source, run:
|
|
45
56
|
This task will install any missing dependencies, run the tests/specs,
|
46
57
|
and generate the RDoc.
|
47
58
|
|
48
|
-
|
59
|
+
## LICENSE:
|
49
60
|
|
50
61
|
(The MIT License)
|
51
62
|
|
52
|
-
Copyright (c) 2012
|
63
|
+
Copyright (c) 2012 Kristian Freeman
|
53
64
|
|
54
65
|
Permission is hereby granted, free of charge, to any person obtaining
|
55
66
|
a copy of this software and associated documentation files (the
|
data/lib/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module WhichOsx
|
2
|
-
VERSION = "1.0.
|
3
|
-
end
|
2
|
+
VERSION = "1.0.4"
|
3
|
+
end
|
data/lib/which_osx.rb
CHANGED
data/spec/which_osx_spec.rb
CHANGED
@@ -9,7 +9,7 @@ require 'which_osx'
|
|
9
9
|
end
|
10
10
|
|
11
11
|
it "should convert version to a nice string" do
|
12
|
-
WhichOSX.version.should
|
12
|
+
WhichOSX.version.should =~ /[0-9][0-9].[0-9].[0-9]/
|
13
13
|
end
|
14
14
|
|
15
15
|
# it "should tell you when you're not on Mac OS X" do
|
@@ -17,19 +17,19 @@ require 'which_osx'
|
|
17
17
|
# end
|
18
18
|
end
|
19
19
|
|
20
|
-
describe "full
|
20
|
+
describe "full name" do
|
21
21
|
it "should return the full name of the OS" do
|
22
|
-
WhichOSX.
|
22
|
+
WhichOSX.full_name.should =~ /Mac OS X [0-9][0-9].[0-9].[0-9]/
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
26
|
describe "short name" do
|
27
27
|
it "should chomp the version into a major release number" do
|
28
|
-
WhichOSX.version.chop.chop.should
|
28
|
+
WhichOSX.version.chop.chop.should =~ /[0-9][0-9].[0-9]/
|
29
29
|
end
|
30
30
|
|
31
31
|
it "should return a major release name (Lion, Leopard, etc.)" do
|
32
|
-
WhichOSX.short_name.should
|
32
|
+
WhichOSX.short_name.should =~ /Lion|Leopard|Snow Leopard|Tiger|Panther/
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: which_osx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire: ''
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-05-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -27,22 +27,6 @@ dependencies:
|
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: 1.3.2
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: rr
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ~>
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: 1.0.4
|
38
|
-
type: :development
|
39
|
-
prerelease: false
|
40
|
-
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ~>
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
version: 1.0.4
|
46
30
|
- !ruby/object:Gem::Dependency
|
47
31
|
name: rake
|
48
32
|
requirement: !ruby/object:Gem::Requirement
|