Class: Kamino::CLI

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_pathsObject



8
9
10
# File 'lib/kamino/cli.rb', line 8

def self.source_paths
  [ File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'templates')) ]
end

Instance Method Details

#railsObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/kamino/cli.rb', line 13

def rails
  say "Setting VM to hostname #{Kamino.config.default_app_name} #{Kamino.config.default_host_ip}", :yellow
  target = Dir.pwd
  template File.join('rails', 'Berksfile.erb'), File.join(target, 'Berksfile')
  template File.join('rails', 'Vagrantfile.erb'), File.join(target, 'Vagrantfile'), Kamino.config.options
  append_file(File.join(target, 'Gemfile')) { <<END }

# Berkshelf manages your cookbooks like bundler
# Define your OS dependencies in Berksfile
group :kamino do
  gem 'berkshelf'
end
END

  append_file(File.join(target, '.gitignore')) { <<END }
.vagrant
.vagrant.*
END

  empty_directory File.join(target, 'vendor', 'cookbooks')
  create_file     File.join(target, 'vendor', 'cookbooks', '.keep'), ''

end