class Boring::Payments::Stripe::InstallGenerator

Public Instance Methods

add_checkouts_resources() click to toggle source
# 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() click to toggle source
# 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() click to toggle source
# 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() click to toggle source
# 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() click to toggle source
# File lib/generators/boring/payments/stripe/install/install_generator.rb, line 37
def show_readme
  readme "README"
end