class Onesky::Generators::InitGenerator

Constants

CONFIG_PATH

Public Instance Methods

create_config_file() click to toggle source
# File lib/generators/onesky/init_generator.rb, line 28
def create_config_file
  # create_file(CONFIG_PATH, YAML_COMMENT + config_hash.to_yaml)
  template "onesky.yml.tt", "config/onesky.yml"
end
remove_config_file() click to toggle source
# File lib/generators/onesky/init_generator.rb, line 15
def remove_config_file
  if File.exists? CONFIG_PATH
    if options.force?
      say_status("warning", "Overwrite existing config file.", :yellow)
      remove_file CONFIG_PATH
    else
      say_status("error", "Please use --force to overwrite existing config file.", :red)
    end
  end
end

Private Instance Methods

config_hash() click to toggle source
# File lib/generators/onesky/init_generator.rb, line 35
def config_hash
  {api_key: api_key, api_secret: api_secret, project_id: project_id.to_i}
end