running 0.0.5 → 0.0.6

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.
Files changed (3) hide show
  1. data/lib/running.rb +15 -9
  2. data/running.gemspec +1 -1
  3. metadata +1 -1
@@ -8,15 +8,15 @@ module Running
8
8
  end
9
9
 
10
10
  def ruby_18?
11
- ruby? && RUBY_VERSION =~ /^1.8/
11
+ ruby? && ruby_version_matches(1.8)
12
12
  end
13
13
 
14
14
  def ruby_19?
15
- ruby? && RUBY_VERSION =~ /^1.9/
15
+ ruby? && ruby_version_matches(1.9)
16
16
  end
17
17
 
18
18
  def ruby_20?
19
- ruby? && RUBY_VERSION =~ /^2.0/
19
+ ruby? && ruby_version_matches(2.0)
20
20
  end
21
21
 
22
22
  def mri?
@@ -24,11 +24,11 @@ module Running
24
24
  end
25
25
 
26
26
  def mri_18?
27
- mri? && RUBY_VERSION =~ /^1.8/
27
+ mri? && ruby_version_matches(1.8)
28
28
  end
29
29
 
30
30
  def mri_19?
31
- mri? && RUBY_VERSION =~ /^1.9/
31
+ mri? && ruby_version_matches(1.9)
32
32
  end
33
33
 
34
34
  def rbx?
@@ -52,19 +52,25 @@ module Running
52
52
  end
53
53
 
54
54
  def mingw_18?
55
- mingw? && RUBY_VERSION =~ /^1.8/
55
+ mingw? && ruby_version_matches(1.8)
56
56
  end
57
57
 
58
58
  def mingw_19?
59
- mingw? && RUBY_VERSION =~ /^1.9/
59
+ mingw? && ruby_version_matches(1.9)
60
60
  end
61
61
 
62
62
  def mingw_20?
63
- mingw? && RUBY_VERSION =~ /^2.0/
63
+ mingw? && ruby_version_matches(2.0)
64
64
  end
65
65
 
66
66
  def from_the_police?
67
67
  true
68
68
  end
69
+
70
+ private
71
+
72
+ def ruby_version_matches(version)
73
+ !(RUBY_VERSION =~ /^#{version}/).nil?
74
+ end
69
75
  end
70
- end
76
+ end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'running'
3
- s.version = '0.0.5'
3
+ s.version = '0.0.6'
4
4
  s.authors = ['Kyle Drake']
5
5
  s.email = ['kyledrake@gmail.com']
6
6
  s.homepage = 'http://github.com/kyledrake/running'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: running
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: