Class: Envyable::CLI

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/envyable/cli.rb

Instance Method Summary collapse

Instance Method Details

#installObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/envyable/cli.rb', line 10

def install
  create_file("config/env.yml")
  create_file("config/env.yml.example")
  if File.exist?("#{destination_root}/.gitignore")
    append_to_file(".gitignore") do
      "\n# Don't check in credentials \nconfig/env.yml"
    end
  end
  if File.exist?("#{destination_root}/bin/spring")
    create_file("config/spring.rb") unless File.exist?("#{destination_root}/config/spring.rb")
    append_to_file("config/spring.rb") do
      "\nSpring.watch 'config/env.yml'"
    end
  end
end