Sha256: c198fa254a3608e0d73198aa81e3cafcb7f73c0b7e6cdc21303c02b4d56aae9b

Contents?: true

Size: 650 Bytes

Versions: 81

Compression:

Stored size: 650 Bytes

Contents

require 'rails/generators/base'

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

      def inject_shopify_app_routes_into_application_routes
        route(session_routes)
      end

      def disable_engine_routes
        gsub_file(
          'config/routes.rb',
          "mount ShopifyApp::Engine, at: '/'",
          ''
        )
      end

      private

      def session_routes
        File.read(routes_file_path)
      end

      def routes_file_path
        File.expand_path(find_in_source_paths('routes.rb'))
      end
    end
  end
end

Version data entries

81 entries across 81 versions & 1 rubygems

Version Path
shopify_app-6.1.0 lib/generators/shopify_app/routes/routes_generator.rb