Class: Sequelizer::GemfileModifier

Inherits:
Object
  • Object
show all
Defined in:
lib/sequelizer/gemfile_modifier.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ GemfileModifier

Returns a new instance of GemfileModifier.



8
9
10
# File 'lib/sequelizer/gemfile_modifier.rb', line 8

def initialize(options = {})
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/sequelizer/gemfile_modifier.rb', line 6

def options
  @options
end

Instance Method Details

#modifyObject



12
13
14
15
16
17
18
19
20
# File 'lib/sequelizer/gemfile_modifier.rb', line 12

def modify
  check_for_gemfile
  if gemfile_needs_modification?
    modify_gemfile
    run_bundle unless options['skip-bundle']
  else
    puts 'Gemfile needs no modification'
  end
end