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
8 9 10 |
# File 'lib/generators/postageapp/postageapp_generator.rb', line 8 def self.source_root @_hoptoad_source_root ||= File.('../../../../generators/postageapp/templates', __FILE__) end |
Instance Method Details
#api_key ⇒ Object
23 24 25 |
# File 'lib/generators/postageapp/postageapp_generator.rb', line 23 def api_key [:api_key] end |
#install ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/generators/postageapp/postageapp_generator.rb', line 12 def install if ![:api_key] puts 'Must pass --api-key with API key of your PostageApp.com project' exit end template 'initializer.rb', 'config/initializers/postageapp.rb' copy_file 'postageapp_tasks.rake', 'lib/tasks/postageapp_tasks.rake' puts run('rake postageapp:test') end |