Class: KauiCmd::Installer

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/kaui/installer/installer.rb

Instance Method Summary collapse

Instance Method Details

#add_gemsObject



56
57
58
59
60
61
# File 'lib/kaui/installer/installer.rb', line 56

def add_gems
  inside @app_path do
    gem :kaui, @kaui_gem_options
    run 'bundle install', capture: true unless options[:skip_bundle]
  end
end

#initialize_kauiObject



63
64
65
66
67
# File 'lib/kaui/installer/installer.rb', line 63

def initialize_kaui
  inside @app_path do
    run 'rails generate kaui:install', verbose: false
  end
end

#prepare_optionsObject



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/kaui/installer/installer.rb', line 36

def prepare_options
  @kaui_gem_options = {}

  if options[:edge]
    @kaui_gem_options[:git] = 'git://github.com/killbill/killbill-admin-ui.git'
  elsif options[:path]
    @kaui_gem_options[:path] = options[:path]
  elsif options[:git]
    @kaui_gem_options[:git] = options[:git]
    @kaui_gem_options[:ref] = options[:ref] if options[:ref]
    @kaui_gem_options[:branch] = options[:branch] if options[:branch]
    @kaui_gem_options[:tag] = options[:tag] if options[:tag]
  elsif options[:version]
    @kaui_gem_options[:version] = options[:version]
  else
    version = Kaui::VERSION
    @kaui_gem_options[:version] = version.to_s
  end
end

#verify_railsObject



29
30
31
32
33
34
# File 'lib/kaui/installer/installer.rb', line 29

def verify_rails
  return if rails_project?

  say "#{@app_path} is not a rails project."
  exit 1
end