Sha256: 2b732a040a96a482eb1f2a3d7cbf6643cf13da8d0652af17182eaf6ecaa259ca

Contents?: true

Size: 705 Bytes

Versions: 33

Compression:

Stored size: 705 Bytes

Contents

# frozen_string_literal: true

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

33 entries across 33 versions & 1 rubygems

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