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 CHANGED
@@ -1 +1 @@
1
- 0.8.1
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).send(cmp, Gem::Version.create(v))
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?(Ger::Version.create(RUBY_VERSION))
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?(Ger::Version.create(RUBY_VERSION))
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 :>=, '1.9.0', &blk
46
+ if_ruby_version :'~>', '1.9.0', &blk
40
47
  end
41
48
 
42
49
  def ruby_18(&blk)
43
- # if_ruby_version :<, '1.9.0', &blk
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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{modalsupport}
8
- s.version = "0.8.1"
8
+ s.version = "0.8.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Javier Goizueta"]
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: 61
4
+ hash: 59
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 1
10
- version: 0.8.1
9
+ - 2
10
+ version: 0.8.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Javier Goizueta