running 0.0.2
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/.gitignore +1 -0
- data/README.markdown +32 -0
- data/lib/running.rb +58 -0
- data/running.gemspec +14 -0
- metadata +71 -0
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
*.gem
|
data/README.markdown
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
Running
|
2
|
+
---
|
3
|
+
Helpers for finding out which version of Ruby (MRI 1.8, MRI 1.9, Rubinius, etc) you are using. Use cases include testing with code features only available on certain platforms.
|
4
|
+
|
5
|
+
This code was extracted from Bundler, so that it could be used generally by the Ruby community. If you have a missing interpreter you'd like to add, please send a pull request.
|
6
|
+
|
7
|
+
Currently the following methods are present:
|
8
|
+
|
9
|
+
Running.ruby?
|
10
|
+
Running.ruby_18?
|
11
|
+
Running.ruby_19?
|
12
|
+
|
13
|
+
# MRI
|
14
|
+
Running.mri?
|
15
|
+
Running.mri_18?
|
16
|
+
Running.mri_19?
|
17
|
+
|
18
|
+
# Rubinius
|
19
|
+
Running.rbx?
|
20
|
+
|
21
|
+
# JRuby
|
22
|
+
Running.jruby?
|
23
|
+
|
24
|
+
# Windows
|
25
|
+
Running.mswin?
|
26
|
+
Running.mingw?
|
27
|
+
Running.mingw_18?
|
28
|
+
Running.mingw_19?
|
29
|
+
|
30
|
+
TODO
|
31
|
+
---
|
32
|
+
- A way to ask which is being run would probably be useful.
|
data/lib/running.rb
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'rbconfig'
|
2
|
+
module Running
|
3
|
+
WINDOWS = RbConfig::CONFIG["host_os"] =~ %r!(msdos|mswin|djgpp|mingw)!
|
4
|
+
|
5
|
+
class << self
|
6
|
+
def ruby?
|
7
|
+
!mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby" || RUBY_ENGINE == "rbx")
|
8
|
+
end
|
9
|
+
|
10
|
+
def ruby_18?
|
11
|
+
ruby? && RUBY_VERSION < "1.9"
|
12
|
+
end
|
13
|
+
|
14
|
+
def ruby_19?
|
15
|
+
ruby? && RUBY_VERSION >= "1.9"
|
16
|
+
end
|
17
|
+
|
18
|
+
def mri?
|
19
|
+
!mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby")
|
20
|
+
end
|
21
|
+
|
22
|
+
def mri_18?
|
23
|
+
mri? && RUBY_VERSION < "1.9"
|
24
|
+
end
|
25
|
+
|
26
|
+
def mri_19?
|
27
|
+
mri? && RUBY_VERSION >= "1.9"
|
28
|
+
end
|
29
|
+
|
30
|
+
def rbx?
|
31
|
+
ruby? && !defined?(RUBY_ENGINE).nil? && RUBY_ENGINE == "rbx"
|
32
|
+
end
|
33
|
+
|
34
|
+
def jruby?
|
35
|
+
!defined?(RUBY_ENGINE).nil? && RUBY_ENGINE == "jruby"
|
36
|
+
end
|
37
|
+
|
38
|
+
def mswin?
|
39
|
+
!WINDOWS.nil?
|
40
|
+
end
|
41
|
+
|
42
|
+
def mingw?
|
43
|
+
!WINDOWS.nil? && Gem::Platform.local.os == "mingw32"
|
44
|
+
end
|
45
|
+
|
46
|
+
def mingw_18?
|
47
|
+
mingw? && RUBY_VERSION < "1.9"
|
48
|
+
end
|
49
|
+
|
50
|
+
def mingw_19?
|
51
|
+
mingw? && RUBY_VERSION >= "1.9"
|
52
|
+
end
|
53
|
+
|
54
|
+
def from_the_police?
|
55
|
+
true
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
data/running.gemspec
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = 'running'
|
3
|
+
s.version = '0.0.2'
|
4
|
+
s.authors = ['Kyle Drake']
|
5
|
+
s.email = ['kyledrake@gmail.com']
|
6
|
+
s.homepage = 'http://github.com/kyledrake/running'
|
7
|
+
s.summary = 'Helpers for finding out which version of Ruby (MRI 1.8, MRI 1.9, Rubinius, etc) you are using.'
|
8
|
+
s.description = 'Helpers for finding out which version of Ruby (MRI 1.8, MRI 1.9, Rubinius, etc) you are using. Use cases include testing with code features only available on certain platforms.'
|
9
|
+
|
10
|
+
s.files = `git ls-files`.split("\n")
|
11
|
+
s.require_paths = %w[lib]
|
12
|
+
s.rubyforge_project = s.name
|
13
|
+
s.required_rubygems_version = '>= 1.3.4'
|
14
|
+
end
|
metadata
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: running
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Kyle Drake
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-08-02 00:00:00 Z
|
19
|
+
dependencies: []
|
20
|
+
|
21
|
+
description: Helpers for finding out which version of Ruby (MRI 1.8, MRI 1.9, Rubinius, etc) you are using. Use cases include testing with code features only available on certain platforms.
|
22
|
+
email:
|
23
|
+
- kyledrake@gmail.com
|
24
|
+
executables: []
|
25
|
+
|
26
|
+
extensions: []
|
27
|
+
|
28
|
+
extra_rdoc_files: []
|
29
|
+
|
30
|
+
files:
|
31
|
+
- .gitignore
|
32
|
+
- README.markdown
|
33
|
+
- lib/running.rb
|
34
|
+
- running.gemspec
|
35
|
+
homepage: http://github.com/kyledrake/running
|
36
|
+
licenses: []
|
37
|
+
|
38
|
+
post_install_message:
|
39
|
+
rdoc_options: []
|
40
|
+
|
41
|
+
require_paths:
|
42
|
+
- lib
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
44
|
+
none: false
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
hash: 3
|
49
|
+
segments:
|
50
|
+
- 0
|
51
|
+
version: "0"
|
52
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
hash: 19
|
58
|
+
segments:
|
59
|
+
- 1
|
60
|
+
- 3
|
61
|
+
- 4
|
62
|
+
version: 1.3.4
|
63
|
+
requirements: []
|
64
|
+
|
65
|
+
rubyforge_project: running
|
66
|
+
rubygems_version: 1.8.5
|
67
|
+
signing_key:
|
68
|
+
specification_version: 3
|
69
|
+
summary: Helpers for finding out which version of Ruby (MRI 1.8, MRI 1.9, Rubinius, etc) you are using.
|
70
|
+
test_files: []
|
71
|
+
|