Sha256: e85fb99608193060843b4b0c8d1fdd2567c12e1dd8de8c0fcf885c6f9c9d0b7a

Contents?: true

Size: 681 Bytes

Versions: 11

Compression:

Stored size: 681 Bytes

Contents

# frozen_string_literal: true

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

11 entries across 11 versions & 1 rubygems

Version Path
shopify_app-21.0.0 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-20.2.0 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-20.1.1 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-20.1.0 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-20.0.2 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-20.0.1 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-20.0.0 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-19.1.0 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-19.0.2 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-19.0.1 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-19.0.0 lib/generators/shopify_app/routes/routes_generator.rb