Class: Boring::Payments::Stripe::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Boring::Payments::Stripe::InstallGenerator
- Defined in:
- lib/generators/boring/payments/stripe/install/install_generator.rb
Instance Method Summary collapse
- #add_checkouts_resources ⇒ Object
- #add_stripe_gem ⇒ Object
- #add_stripe_initializer ⇒ Object
- #add_stripe_routes ⇒ Object
- #show_readme ⇒ Object
Instance Method Details
#add_checkouts_resources ⇒ Object
17 18 19 20 21 22 |
# File 'lib/generators/boring/payments/stripe/install/install_generator.rb', line 17 def add_checkouts_resources say "Adding stripe checkout resources" copy_file("controllers/stripe/checkouts_controller.rb", "app/controllers/stripe/checkouts_controller.rb") copy_file("views/stripe/checkouts/create.js.erb", "app/views/stripe/checkouts/create.js.erb") copy_file("views/stripe/checkouts/show.html.erb", "app/views/stripe/checkouts/show.html.erb") end |
#add_stripe_gem ⇒ Object
10 11 12 13 14 15 |
# File 'lib/generators/boring/payments/stripe/install/install_generator.rb', line 10 def add_stripe_gem say "Adding stripe gem", :green Bundler.with_unbundled_env do run "bundle add stripe" end end |
#add_stripe_initializer ⇒ Object
32 33 34 35 |
# File 'lib/generators/boring/payments/stripe/install/install_generator.rb', line 32 def add_stripe_initializer say "Adding stripe initalizers" copy_file("stripe.rb", "config/initializers/stripe.rb") end |
#add_stripe_routes ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/generators/boring/payments/stripe/install/install_generator.rb', line 24 def add_stripe_routes route <<~ROUTE namespace :stripe do resource :checkout, only: [:create, :show] end ROUTE end |
#show_readme ⇒ Object
37 38 39 |
# File 'lib/generators/boring/payments/stripe/install/install_generator.rb', line 37 def show_readme readme "README" end |