Class: Gurney::Source::RubyVersion

Inherits:
Base
  • Object
show all
Defined in:
lib/gurney/source/ruby_version.rb

Instance Method Summary collapse

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

#dependenciesObject



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

Returns:

  • (Boolean)


11
12
13
# File 'lib/gurney/source/ruby_version.rb', line 11

def present?
  @ruby_version && @ruby_version.size > 0
end