Class: Kettle::Family::NomonoBootstrap
- Inherits:
-
Object
- Object
- Kettle::Family::NomonoBootstrap
- Defined in:
- lib/kettle/family/nomono_bootstrap.rb
Constant Summary collapse
- GEM_NAME =
"nomono"
Instance Attribute Summary collapse
-
#latest_version ⇒ Object
readonly
Returns the value of attribute latest_version.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
Instance Method Summary collapse
- #bootstrap_member(member) ⇒ Object
-
#initialize(latest_version:, mode: :dry_run) ⇒ NomonoBootstrap
constructor
A new instance of NomonoBootstrap.
- #member_needs_bootstrap?(member) ⇒ Boolean
Constructor Details
#initialize(latest_version:, mode: :dry_run) ⇒ NomonoBootstrap
Returns a new instance of NomonoBootstrap.
11 12 13 14 |
# File 'lib/kettle/family/nomono_bootstrap.rb', line 11 def initialize(latest_version:, mode: :dry_run) @latest_version = Gem::Version.new(latest_version.to_s) @mode = mode end |
Instance Attribute Details
#latest_version ⇒ Object (readonly)
Returns the value of attribute latest_version.
16 17 18 |
# File 'lib/kettle/family/nomono_bootstrap.rb', line 16 def latest_version @latest_version end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
16 17 18 |
# File 'lib/kettle/family/nomono_bootstrap.rb', line 16 def mode @mode end |
Instance Method Details
#bootstrap_member(member) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/kettle/family/nomono_bootstrap.rb', line 22 def bootstrap_member(member) edits = gemfile_edits(member) write_edits(edits) CommandResult.new( member.name, "template_bootstrap_dependencies", ["internal", "nomono-bootstrap", latest_version.to_s], member.root, 0, true, bootstrap_stdout(member, edits), "", 0.0, mode != :execute, (mode == :execute) ? nil : "dry run" ) end |
#member_needs_bootstrap?(member) ⇒ Boolean
18 19 20 |
# File 'lib/kettle/family/nomono_bootstrap.rb', line 18 def member_needs_bootstrap?(member) !!(gemfile_floor_outdated?(member) || lockfile_version_outdated?(member)) end |