Sha256: 7d2be13063ab3c6c49897136b812fdeb69270819bfbe86710b3b680d0bdaa108

Contents?: true

Size: 704 Bytes

Versions: 31

Compression:

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

31 entries across 31 versions & 2 rubygems

Version Path
ruby_shopify_app-1.3.3 lib/generators/shopify_app/controllers/controllers_generator.rb
ruby_shopify_app-1.3.2 lib/generators/shopify_app/controllers/controllers_generator.rb
ruby_shopify_app-1.3.1 lib/generators/shopify_app/controllers/controllers_generator.rb
ruby_shopify_app-1.3.0 lib/generators/shopify_app/controllers/controllers_generator.rb
ruby_shopify_app-1.2.0 lib/generators/shopify_app/controllers/controllers_generator.rb
ruby_shopify_app-1.1.0 lib/generators/shopify_app/controllers/controllers_generator.rb
ruby_shopify_app-1.0.0 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-18.1.3 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-18.1.2 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-18.1.1 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-18.1.0 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-18.0.4 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-18.0.3 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-18.0.2 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-18.0.1 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-18.0.0 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-17.2.1 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-17.2.0 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-17.1.1 lib/generators/shopify_app/controllers/controllers_generator.rb
shopify_app-17.1.0 lib/generators/shopify_app/controllers/controllers_generator.rb