Sha256: 9ef5cf84bc6d89b4b5ea983f79c7e53ac7c0d1095d98c0486dfdc3be5cf966cf

Contents?: true

Size: 673 Bytes

Versions: 71

Compression:

Stored size: 673 Bytes

Contents

require 'rails/generators/base'

module ShopifyApp
  module Generators
    class ControllersGenerator < Rails::Generators::Base
      source_root File.expand_path("../../../../..", __FILE__)

      def create_controllers
        controllers.each do |controller|
          copy_file controller
        end
      end

      private

      def controllers
        files_within_root('.', 'app/controllers/shopify_app/*.*')
      end

      def files_within_root(prefix, glob)
        root = "#{self.class.source_root}/#{prefix}"

        Dir["#{root}/#{glob}"].sort.map do |full_path|
          full_path.sub(root, '.').gsub('/./', '/')
        end
      end
    end
  end
end

Version data entries

71 entries across 71 versions & 1 rubygems

Version Path
shopify_app-13.0.0 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-12.0.7 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-12.0.6 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-12.0.5 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-12.0.4 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-12.0.3 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-12.0.2 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-12.0.1 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-12.0.0 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-11.7.1 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-11.7.0 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-11.6.0 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-11.5.1 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-11.5.0 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-11.4.0 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-11.3.2 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-11.3.1 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-11.3.0 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-11.2.0 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-11.1.0 lib/generators/shopify_app/controllers/controllers_generator.rb