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



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

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



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

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

#prepare_optionsObject



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

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



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

def verify_rails
  unless rails_project?
    say "#{@app_path} is not a rails project."
    exit 1
  end
end