Class: CreateRubyGem::CommandBuilder
- Inherits:
-
Object
- Object
- CreateRubyGem::CommandBuilder
- Defined in:
- lib/create_ruby_gem/command_builder.rb
Overview
Converts a gem name and option hash into a bundle gem command array.
Instance Method Summary collapse
-
#build(gem_name:, options: {}) ⇒ Array<String>
Builds the bundle gem command array.
-
#initialize(compatibility_entry:) ⇒ CommandBuilder
constructor
A new instance of CommandBuilder.
Constructor Details
#initialize(compatibility_entry:) ⇒ CommandBuilder
Returns a new instance of CommandBuilder.
13 14 15 |
# File 'lib/create_ruby_gem/command_builder.rb', line 13 def initialize(compatibility_entry:) @compatibility_entry = compatibility_entry end |
Instance Method Details
#build(gem_name:, options: {}) ⇒ Array<String>
Builds the bundle gem command array.
22 23 24 25 26 27 28 29 30 |
# File 'lib/create_ruby_gem/command_builder.rb', line 22 def build(gem_name:, options: {}) command = ['bundle', 'gem', gem_name] Options::Catalog::ORDER.each do |key| next unless .key?(key) append_option!(command, key, [key]) end command end |