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 CHANGED
@@ -1,17 +1,20 @@
1
- = which_osx
1
+ # which_osx
2
2
 
3
- * http://github.com/imkmf/which_osx
3
+ ![The contemplative Mac](http://i.imgur.com/RNIc8.png)
4
4
 
5
- == DESCRIPTION:
5
+ - http://github.com/imkmf/which_osx
6
6
 
7
- A simple ruby program for returning the version number of the current Mac OS X system.
7
+ ## DESCRIPTION:
8
8
 
9
- == FEATURES/PROBLEMS:
9
+ A simple ruby program for outputting some information about your Mac.
10
10
 
11
- * Uses the terminal command `sw_vers` and parses it into a readable format.
12
- * TODO : Catch if it's *not* OS X - whether that's Windows, or Linux.
11
+ ## FEATURES/PROBLEMS:
13
12
 
14
- == SYNOPSIS:
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
- It also can be used from the command-line:
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
- `$ which_osx`
29
- `10.7.3`
39
+ $ which_osx
40
+ => 10.7.3
30
41
 
31
- == REQUIREMENTS:
42
+ ## REQUIREMENTS:
32
43
 
33
- * None
44
+ - None
34
45
 
35
- == INSTALL:
46
+ ## INSTALL:
36
47
 
37
48
  sudo gem install which_osx
38
49
 
39
- == DEVELOPERS:
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
- == LICENSE:
59
+ ## LICENSE:
49
60
 
50
61
  (The MIT License)
51
62
 
52
- Copyright (c) 2012 FIX
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"
3
- end
2
+ VERSION = "1.0.4"
3
+ end
data/lib/which_osx.rb CHANGED
@@ -17,9 +17,9 @@ module WhichOSX
17
17
 
18
18
  end
19
19
 
20
- def self.full_version
21
- full_version = "Mac OS X " + VERSION
22
- return full_version
20
+ def self.full_name
21
+ full_name = "Mac OS X " + VERSION
22
+ return full_name
23
23
  end
24
24
 
25
25
  def self.short_name
@@ -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 === "10.7.3"
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 version" do
20
+ describe "full name" do
21
21
  it "should return the full name of the OS" do
22
- WhichOSX.full_version.should === "Mac OS X 10.7.3"
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 === "10.7"
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 === "Lion"
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.3
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-04-11 00:00:00.000000000 Z
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