Class: Sequelizer::CLI

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

Instance Method Summary collapse

Instance Method Details

#configObject



52
53
54
55
56
# File 'lib/sequelizer/cli.rb', line 52

def config
  opts = Options.new
  pp opts.to_hash
  pp opts.extensions
end

#init_envObject



39
40
41
42
43
44
45
46
47
48
49
# File 'lib/sequelizer/cli.rb', line 39

def init_env
  if File.exist?('.env')
    puts ".env already exists!  I'm too cowardly to overwrite it!"
    puts "Here's what I would have put in there:"
    puts make_env(options)
    exit(1)
  end
  File.open('.env', 'w') do |file|
    file.puts make_env(options)
  end
end

#update_gemfileObject



10
11
12
# File 'lib/sequelizer/cli.rb', line 10

def update_gemfile
  GemfileModifier.new(options).modify
end