Class: Gurney::Source::RubyVersion
- Defined in:
- lib/gurney/source/ruby_version.rb
Instance Method Summary collapse
- #dependencies ⇒ Object
-
#initialize(ruby_version:) ⇒ RubyVersion
constructor
A new instance of RubyVersion.
- #present? ⇒ Boolean
Constructor Details
#initialize(ruby_version:) ⇒ RubyVersion
Returns a new instance of RubyVersion.
7 8 9 |
# File 'lib/gurney/source/ruby_version.rb', line 7 def initialize(ruby_version:) @ruby_version = ruby_version&.strip end |
Instance Method Details
#dependencies ⇒ Object
15 16 17 18 19 |
# File 'lib/gurney/source/ruby_version.rb', line 15 def dependencies if present? [Dependency.new(ecosystem: 'ruby', name: 'ruby', version: @ruby_version)] end end |
#present? ⇒ Boolean
11 12 13 |
# File 'lib/gurney/source/ruby_version.rb', line 11 def present? @ruby_version && @ruby_version.size > 0 end |