mario 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +7 -0
- data/Gemfile.lock +14 -0
- data/README.md +2 -0
- data/Rakefile +0 -2
- data/VERSION +1 -1
- data/lib/mario/platform.rb +11 -11
- metadata +32 -16
- data/.gitignore +0 -28
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
data/README.md
CHANGED
@@ -89,6 +89,8 @@ Any class defined in Mario::Platform.targets can be used as symbol for `platform
|
|
89
89
|
>> Mario::Platform.targets.map{ |t| Mario::Platform.klass_to_method(t).to_sym }
|
90
90
|
=> [:cygwin, :linux, :bsd, :solaris, :tiger, :leopard, :snowleopard, :darwin, :windows7, :windowsnt]
|
91
91
|
|
92
|
+
along with `:windows` and `:nix` (just as you can query for those via Mario::Platform.windows? and Mario::Platform.nix?).
|
93
|
+
|
92
94
|
testing
|
93
95
|
-------
|
94
96
|
When testing your app you'll want to force the platform that mario reports to test your platform specific methods. In order to accomplish this make sure to defer the method definition done by the `platform` class method in the following manner.
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/lib/mario/platform.rb
CHANGED
@@ -5,14 +5,14 @@ module Mario
|
|
5
5
|
@@current = nil
|
6
6
|
|
7
7
|
class << self
|
8
|
-
|
8
|
+
|
9
9
|
# A list of unix like operating system classes
|
10
10
|
#
|
11
11
|
# @return [Array[Class]]
|
12
12
|
def nix_group
|
13
13
|
[Cygwin, Linux, BSD, Solaris] + darwin_group
|
14
14
|
end
|
15
|
-
|
15
|
+
|
16
16
|
# A list of windows operating system classes
|
17
17
|
#
|
18
18
|
# @return [Array[Class]]
|
@@ -31,7 +31,7 @@ module Mario
|
|
31
31
|
|
32
32
|
# The union of the {nix_group} and {windows_group} operating system class sets, each operating system
|
33
33
|
# test method ( ie linux? ) is built from this set of class constants
|
34
|
-
#
|
34
|
+
#
|
35
35
|
# @return [Array[Class]]
|
36
36
|
def targets
|
37
37
|
nix_group | windows_group
|
@@ -52,7 +52,7 @@ module Mario
|
|
52
52
|
end
|
53
53
|
|
54
54
|
# Checks if the current platform is part of the {darwin_group} and returns that class
|
55
|
-
#
|
55
|
+
#
|
56
56
|
# @return [Class]
|
57
57
|
def darwin?
|
58
58
|
check_group(darwin_group)
|
@@ -72,7 +72,7 @@ module Mario
|
|
72
72
|
#
|
73
73
|
# @return [String]
|
74
74
|
def target_os
|
75
|
-
@@forced ? @@forced.target :
|
75
|
+
@@forced ? @@forced.target : RbConfig::CONFIG['target_os']
|
76
76
|
end
|
77
77
|
|
78
78
|
# Checks an os class against {target_os}
|
@@ -91,7 +91,7 @@ module Mario
|
|
91
91
|
Mario::Platform.target_os will now report as '#{target_os}' and #{klass} will be used for all functionality including operating system checks, platform blocks, and hat based functionality
|
92
92
|
msg
|
93
93
|
end
|
94
|
-
|
94
|
+
|
95
95
|
# Returns the value of the currently forced operating system class if any
|
96
96
|
#
|
97
97
|
# @return [Class]
|
@@ -128,7 +128,7 @@ msg
|
|
128
128
|
def klass_to_method(klass)
|
129
129
|
klass.to_s.downcase.split('::').last
|
130
130
|
end
|
131
|
-
|
131
|
+
|
132
132
|
def check_symbol(name)
|
133
133
|
send(name.to_s + '?')
|
134
134
|
end
|
@@ -137,16 +137,16 @@ msg
|
|
137
137
|
# NOTE Any additional functionality and they should be moved to a lib/platforms/<OS>.rb
|
138
138
|
class Cygwin
|
139
139
|
include Hats::Nix
|
140
|
-
|
140
|
+
|
141
141
|
def self.target
|
142
142
|
'cygwin'
|
143
143
|
end
|
144
144
|
end
|
145
145
|
|
146
|
-
class Darwin
|
146
|
+
class Darwin
|
147
147
|
include Hats::Nix
|
148
148
|
|
149
|
-
def self.target
|
149
|
+
def self.target
|
150
150
|
'darwin'
|
151
151
|
end
|
152
152
|
end
|
@@ -179,7 +179,7 @@ msg
|
|
179
179
|
|
180
180
|
class BSD
|
181
181
|
include Hats::Nix
|
182
|
-
|
182
|
+
|
183
183
|
def self.target
|
184
184
|
'bsd'
|
185
185
|
end
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mario
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 1
|
8
|
+
- 2
|
9
|
+
version: 0.1.2
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- John Bender
|
@@ -9,29 +14,35 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-
|
17
|
+
date: 2010-12-23 00:00:00 -08:00
|
13
18
|
default_executable:
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: shoulda
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
23
|
+
none: false
|
20
24
|
requirements:
|
21
25
|
- - ">="
|
22
26
|
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
23
29
|
version: "0"
|
24
|
-
|
30
|
+
type: :development
|
31
|
+
prerelease: false
|
32
|
+
version_requirements: *id001
|
25
33
|
- !ruby/object:Gem::Dependency
|
26
34
|
name: mocha
|
27
|
-
|
28
|
-
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
35
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
36
|
+
none: false
|
30
37
|
requirements:
|
31
38
|
- - ">="
|
32
39
|
- !ruby/object:Gem::Version
|
40
|
+
segments:
|
41
|
+
- 0
|
33
42
|
version: "0"
|
34
|
-
|
43
|
+
type: :development
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: *id002
|
35
46
|
description: Mario is a collection of utilities for dealing with platform specific issues
|
36
47
|
email: john.m.bender@gmail.com
|
37
48
|
executables: []
|
@@ -43,7 +54,8 @@ extra_rdoc_files:
|
|
43
54
|
- README.md
|
44
55
|
files:
|
45
56
|
- .document
|
46
|
-
-
|
57
|
+
- Gemfile
|
58
|
+
- Gemfile.lock
|
47
59
|
- LICENSE
|
48
60
|
- README.md
|
49
61
|
- Rakefile
|
@@ -65,26 +77,30 @@ homepage: http://github.com/johnbender/mario
|
|
65
77
|
licenses: []
|
66
78
|
|
67
79
|
post_install_message:
|
68
|
-
rdoc_options:
|
69
|
-
|
80
|
+
rdoc_options: []
|
81
|
+
|
70
82
|
require_paths:
|
71
83
|
- lib
|
72
84
|
required_ruby_version: !ruby/object:Gem::Requirement
|
85
|
+
none: false
|
73
86
|
requirements:
|
74
87
|
- - ">="
|
75
88
|
- !ruby/object:Gem::Version
|
89
|
+
segments:
|
90
|
+
- 0
|
76
91
|
version: "0"
|
77
|
-
version:
|
78
92
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
|
+
none: false
|
79
94
|
requirements:
|
80
95
|
- - ">="
|
81
96
|
- !ruby/object:Gem::Version
|
97
|
+
segments:
|
98
|
+
- 0
|
82
99
|
version: "0"
|
83
|
-
version:
|
84
100
|
requirements: []
|
85
101
|
|
86
102
|
rubyforge_project:
|
87
|
-
rubygems_version: 1.3.
|
103
|
+
rubygems_version: 1.3.7
|
88
104
|
signing_key:
|
89
105
|
specification_version: 3
|
90
106
|
summary: Mario is a collection of utilities for dealing with platform specific issues
|
data/.gitignore
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
## MAC OS
|
2
|
-
.DS_Store
|
3
|
-
|
4
|
-
## TEXTMATE
|
5
|
-
*.tmproj
|
6
|
-
tmtags
|
7
|
-
|
8
|
-
## EMACS
|
9
|
-
*~
|
10
|
-
\#*
|
11
|
-
.\#*
|
12
|
-
|
13
|
-
## VIM
|
14
|
-
*.swp
|
15
|
-
|
16
|
-
## PROJECT::GENERAL
|
17
|
-
coverage
|
18
|
-
rdoc
|
19
|
-
pkg
|
20
|
-
|
21
|
-
## PROJECT::SPECIFIC
|
22
|
-
vendor
|
23
|
-
Gemfile
|
24
|
-
Gemfile.lock
|
25
|
-
.bundle
|
26
|
-
*.gem
|
27
|
-
doc
|
28
|
-
.yardoc
|