Sha256: bca15724bee9c3dfe1e3a0445419cc49d251646cd14fd9d5989f8b518ecc9e89

Contents?: true

Size: 726 Bytes

Versions: 6

Compression:

Stored size: 726 Bytes

Contents

require 'rails/generators/base'

module SpiffyStoresApp
  module Generators
    class AppProxyControllerGenerator < Rails::Generators::Base
      source_root File.expand_path('../templates', __FILE__)

      def create_app_proxy_controller
        template 'app_proxy_controller.rb', 'app/controllers/app_proxy_controller.rb'
      end

      def create_app_proxy_index_view
        copy_file 'index.html.erb', 'app/views/app_proxy/index.html.erb'
      end

      def add_app_proxy_route
        inject_into_file(
          'config/routes.rb',
          File.read(File.expand_path(find_in_source_paths('app_proxy_route.rb'))),
          after: "mount SpiffyStoresApp::Engine, at: '/'\n"
        )
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
spiffy_stores_app-8.2.11 lib/generators/spiffy_stores_app/app_proxy_controller/app_proxy_controller_generator.rb
spiffy_stores_app-8.2.10 lib/generators/spiffy_stores_app/app_proxy_controller/app_proxy_controller_generator.rb
spiffy_stores_app-8.2.9 lib/generators/spiffy_stores_app/app_proxy_controller/app_proxy_controller_generator.rb
spiffy_stores_app-8.2.8 lib/generators/spiffy_stores_app/app_proxy_controller/app_proxy_controller_generator.rb
spiffy_stores_app-8.2.7 lib/generators/spiffy_stores_app/app_proxy_controller/app_proxy_controller_generator.rb
spiffy_stores_app-8.2.6 lib/generators/spiffy_stores_app/app_proxy_controller/app_proxy_controller_generator.rb