Class: PostageappGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- PostageappGenerator
- Defined in:
- lib/generators/postageapp/postageapp_generator.rb
Overview
Rails 3 Generator
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
10 11 12 13 14 15 |
# File 'lib/generators/postageapp/postageapp_generator.rb', line 10 def self.source_root @__source_root ||= File.( '../../../generators/postageapp/templates', File.dirname(__FILE__) ) end |
Instance Method Details
#api_key ⇒ Object
30 31 32 |
# File 'lib/generators/postageapp/postageapp_generator.rb', line 30 def api_key [:api_key] end |
#install ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/generators/postageapp/postageapp_generator.rb', line 17 def install unless ([:api_key]) puts 'Must pass --api-key with API key of your PostageApp.com project' exit(-1) end template('initializer.rb', 'config/initializers/postageapp.rb') copy_file('postageapp_tasks.rake', 'lib/tasks/postageapp_tasks.rake') puts run('rake postageapp:test') end |