Class: Campout::CLI

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject

these are not the tasks that you seek



14
15
16
# File 'lib/cli.rb', line 14

def self.source_root
  File.expand_path(File.dirname(__FILE__) + "/..")
end

Instance Method Details

#aboutObject



74
75
76
# File 'lib/cli.rb', line 74

def about
  puts "Campout Version #{Capistrano::Campout::VERSION}: Post messages and paste logs from a capistrano deployment to a campfire room."
end

#generate_configObject



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/cli.rb', line 79

def generate_config
  open_repository = yes?("Is this an open/public repository?")
  if(open_repository)
    say "Your campout settings will be added to ./config/campout.local.yml"
  else
    say "Your campout settings will be added to ./config/campout.yml"
  end  
  campfire_settings = {'campfire' => {'domain' => 'domain', 'room' => 'room', 'token' => 'token'}}
  campfire_settings['campfire']['domain'] = ask("Your campfire domain:")
  campfire_settings['campfire']['room'] = ask("Your campfire room ID:").to_i
  campfire_settings['campfire']['token'] = ask("Your campfire api token:")
    
  copy_configs
  add_campfire_settings(open_repository,campfire_settings)
  add_local_to_gitignore
  add_campout_to_deploy
end