Sha256: 260dee4e5b20ccd7bfc33f6632aef049668a78542a8617bd537675e26faaa5f6

Contents?: true

Size: 682 Bytes

Versions: 22

Compression:

Stored size: 682 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

22 entries across 22 versions & 1 rubygems

Version Path
shopify_app-22.4.0 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-22.3.1 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-22.3.0 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-22.2.1 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-22.2.0 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-22.1.0 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-22.0.1 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-22.00.0 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-21.10.0 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-21.9.0 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-21.8.1 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-21.8.0 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-21.7.0 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-21.6.0 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-21.5.0 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-21.4.1 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-21.4.0 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-21.3.1 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-21.3.0 lib/generators/shopify_app/routes/routes_generator.rb
shopify_app-21.2.0 lib/generators/shopify_app/routes/routes_generator.rb