Sha256: b9662457931eb07cd5850271beb9d5899d5ee3e53d7e3a4a643714704a26fdc6

Contents?: true

Size: 591 Bytes

Versions: 2

Compression:

Stored size: 591 Bytes

Contents

require 'rails/generators'

module MockGraphqlAi
  module Generators
    class InstallGenerator < Rails::Generators::Base
      source_root(File.expand_path('../templates', __dir__))

      def copy_module_file
        copy_file('mockable.rb', 'app/controllers/concerns/mockable.rb')
      end

      def copy_controller_file
        copy_file('graphql_mocks_controller.rb', 'app/controllers/graphql_mocks_controller.rb')
      end

      def register_controller_main_route
        route "get '/imitate_graphql', to: 'graphql_mocks#imitate', as: :imitate_graphql"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mock_graphql_ai-1.0.4 lib/generators/mock_graphql_ai/install_generator.rb
mock_graphql_ai-1.0.3 lib/generators/mock_graphql_ai/install_generator.rb