Module: Chef::Sugar::Ruby
Instance Method Summary collapse
-
#ruby_19?(node) ⇒ Boolean
Determine if the current Ruby version is 1.9.
-
#ruby_20?(node) ⇒ Boolean
Determine if the current Ruby version is 2.0.
Instance Method Details
#ruby_19?(node) ⇒ Boolean
Determine if the current Ruby version is 1.9.
37 38 39 40 |
# File 'lib/chef/sugar/ruby.rb', line 37 def ruby_19?(node) version = Gem::Version.new(node['languages']['ruby']['version']) Gem::Requirement.new('~> 1.9.0').satisfied_by?(version) end |
#ruby_20?(node) ⇒ Boolean
Determine if the current Ruby version is 2.0.
27 28 29 30 |
# File 'lib/chef/sugar/ruby.rb', line 27 def ruby_20?(node) version = Gem::Version.new(node['languages']['ruby']['version']) Gem::Requirement.new('~> 2.0.0').satisfied_by?(version) end |