Sha256: 7df628498aa992b3a8b7661e4bcacbf3066ac5c867e0fbf5c030cf64ec0bb34b

Contents?: true

Size: 653 Bytes

Versions: 31

Compression:

Stored size: 653 Bytes

Contents

# frozen_string_literal: true
require 'rails/generators/base'

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

      def create_views
        views.each do |view|
          copy_file(view)
        end
      end

      private

      def views
        files_within_root('.', 'app/views/**/*.*')
      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/views/views_generator.rb
ruby_shopify_app-1.3.2 lib/generators/shopify_app/views/views_generator.rb
ruby_shopify_app-1.3.1 lib/generators/shopify_app/views/views_generator.rb
ruby_shopify_app-1.3.0 lib/generators/shopify_app/views/views_generator.rb
ruby_shopify_app-1.2.0 lib/generators/shopify_app/views/views_generator.rb
ruby_shopify_app-1.1.0 lib/generators/shopify_app/views/views_generator.rb
ruby_shopify_app-1.0.0 lib/generators/shopify_app/views/views_generator.rb
shopify_app-18.1.3 lib/generators/shopify_app/views/views_generator.rb
shopify_app-18.1.2 lib/generators/shopify_app/views/views_generator.rb
shopify_app-18.1.1 lib/generators/shopify_app/views/views_generator.rb
shopify_app-18.1.0 lib/generators/shopify_app/views/views_generator.rb
shopify_app-18.0.4 lib/generators/shopify_app/views/views_generator.rb
shopify_app-18.0.3 lib/generators/shopify_app/views/views_generator.rb
shopify_app-18.0.2 lib/generators/shopify_app/views/views_generator.rb
shopify_app-18.0.1 lib/generators/shopify_app/views/views_generator.rb
shopify_app-18.0.0 lib/generators/shopify_app/views/views_generator.rb
shopify_app-17.2.1 lib/generators/shopify_app/views/views_generator.rb
shopify_app-17.2.0 lib/generators/shopify_app/views/views_generator.rb
shopify_app-17.1.1 lib/generators/shopify_app/views/views_generator.rb
shopify_app-17.1.0 lib/generators/shopify_app/views/views_generator.rb