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.


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

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

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.


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

def options
  @options
end

Instance Method Details

#modifyObject


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

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