Sha256: 42dc95143b4ab9f7ed33b08dfb69d8ac89853a3e7ff6e02a346a14dbd71469bb

Contents?: true

Size: 661 Bytes

Versions: 17

Compression:

Stored size: 661 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/*.*')
      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

17 entries across 17 versions & 1 rubygems

Version Path
shopify_app-6.4.2 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-6.4.1 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-6.4.0 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-6.3.0 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-6.2.1 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-6.2.0 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-6.1.3 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-6.1.2 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-6.1.1 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-6.1.0 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-6.0.6 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-6.0.5 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-6.0.4 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-6.0.3 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-6.0.2 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-6.0.1 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-6.0.0 lib/generators/shopify_app/controllers/controllers_generator.rb