modalsupport 0.8.1 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/modalsupport/ruby_version.rb +13 -7
- data/modalsupport.gemspec +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.2
|
@@ -5,18 +5,25 @@ unless defined? Gem
|
|
5
5
|
end
|
6
6
|
|
7
7
|
# Compare the Ruby version with a version string
|
8
|
-
def ruby_version?(cmp, v)
|
9
|
-
Gem::Version.create(RUBY_VERSION.dup)
|
8
|
+
def ruby_version?(cmp, v)
|
9
|
+
rv = Gem::Version.create(RUBY_VERSION.dup)
|
10
|
+
v = Gem::Version.create(v)
|
11
|
+
if cmp.to_sym==:'~>'
|
12
|
+
rv = rv.release
|
13
|
+
rv >= v && rv < v.bump
|
14
|
+
else
|
15
|
+
rv.send(cmp,v)
|
16
|
+
end
|
10
17
|
end
|
11
18
|
|
12
19
|
# ruby_version_between?(v1,v2) == ruby_version?(:>=,v1) && ruby_version?(:<=,v2)
|
13
20
|
def ruby_version_between?(v1, v2)
|
14
|
-
(Gem::Version.create(v1)..Gem::Version.create(v2)).include?(
|
21
|
+
(Gem::Version.create(v1)..Gem::Version.create(v2)).include?(Gem::Version.create(RUBY_VERSION))
|
15
22
|
end
|
16
23
|
|
17
24
|
# ruby_version_between?(v1,v2) == ruby_version?(:>=,v1) && ruby_version?(:<,v2)
|
18
25
|
def ruby_version_between_ex?(v1, v2)
|
19
|
-
(Gem::Version.create(v1).-.Gem::Version.create(v2)).include?(
|
26
|
+
(Gem::Version.create(v1).-.Gem::Version.create(v2)).include?(Gem::Version.create(RUBY_VERSION))
|
20
27
|
end
|
21
28
|
|
22
29
|
# Execute code conditinally on Ruby version:
|
@@ -36,10 +43,9 @@ def if_ruby_version_between_ex(v1, v2)
|
|
36
43
|
end
|
37
44
|
|
38
45
|
def ruby_19(&blk)
|
39
|
-
if_ruby_version
|
46
|
+
if_ruby_version :'~>', '1.9.0', &blk
|
40
47
|
end
|
41
48
|
|
42
49
|
def ruby_18(&blk)
|
43
|
-
|
44
|
-
if_ruby_version_between_ex '1.8.0', '1.9.0'
|
50
|
+
if_ruby_version :'~>', '1.8.0', &blk
|
45
51
|
end
|
data/modalsupport.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: modalsupport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 59
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 8
|
9
|
-
-
|
10
|
-
version: 0.8.
|
9
|
+
- 2
|
10
|
+
version: 0.8.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Javier Goizueta
|