Class: Paysto::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Paysto::InstallGenerator
- Defined in:
- lib/generators/paysto/install_generator.rb
Instance Method Summary collapse
-
#add_paysto_routes ⇒ Object
Extend routes.rb with required routes.
-
#copy_config ⇒ Object
Copy general Paysto config.
-
#copy_controller ⇒ Object
Copy default Paysto controller.
-
#copy_locale ⇒ Object
Copy RU and EN locale files.
Instance Method Details
#add_paysto_routes ⇒ Object
Extend routes.rb with required routes.
8 9 10 11 12 13 14 15 16 |
# File 'lib/generators/paysto/install_generator.rb', line 8 def add_paysto_routes paysto_route = "namespace :paysto do\npost :success, :fail, :check, :callback\nget :fail\n end\n" route paysto_route end |
#copy_config ⇒ Object
Copy general Paysto config.
19 20 21 |
# File 'lib/generators/paysto/install_generator.rb', line 19 def copy_config template 'config/paysto.rb', 'config/initializers/paysto.rb' end |
#copy_controller ⇒ Object
Copy default Paysto controller.
30 31 32 |
# File 'lib/generators/paysto/install_generator.rb', line 30 def copy_controller template 'controllers/paysto_controller.rb', 'app/controllers/paysto_controller.rb' end |
#copy_locale ⇒ Object
Copy RU and EN locale files.
24 25 26 27 |
# File 'lib/generators/paysto/install_generator.rb', line 24 def copy_locale template 'config/paysto.en.yml', 'config/locales/paysto.en.yml' template 'config/paysto.ru.yml', 'config/locales/paysto.ru.yml' end |