Class: ExceptiontrapGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/exceptiontrap/exceptiontrap_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



8
9
10
# File 'lib/generators/exceptiontrap/exceptiontrap_generator.rb', line 8

def self.source_root
  @source_root ||= File.join(File.dirname(__FILE__), 'templates')
end

Instance Method Details

#api_keyObject



20
21
22
# File 'lib/generators/exceptiontrap/exceptiontrap_generator.rb', line 20

def api_key
  s = "#{options[:api_key]}"
end

#copy_configObject



24
25
26
27
# File 'lib/generators/exceptiontrap/exceptiontrap_generator.rb', line 24

def copy_config
  puts 'Copying config file to your app'
  template 'exceptiontrap.yml', 'config/exceptiontrap.yml'
end

#installObject



12
13
14
15
16
17
18
# File 'lib/generators/exceptiontrap/exceptiontrap_generator.rb', line 12

def install
  if !options[:api_key]
    puts 'You have to pass --api-key or create config/exceptiontrap.yml manually'
    exit
  end
  #copy_config
end