Sha256: f64676b2beb4234ac08f161cf038117f96c51afc367005a0ee830147ea54756d

Contents?: true

Size: 652 Bytes

Versions: 16

Compression:

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

16 entries across 16 versions & 1 rubygems

Version Path
shopify_app-14.4.3 lib/generators/shopify_app/views/views_generator.rb
shopify_app-14.4.2 lib/generators/shopify_app/views/views_generator.rb
shopify_app-14.4.1 lib/generators/shopify_app/views/views_generator.rb
shopify_app-14.4.0 lib/generators/shopify_app/views/views_generator.rb
shopify_app-14.3.0 lib/generators/shopify_app/views/views_generator.rb
shopify_app-14.2.0 lib/generators/shopify_app/views/views_generator.rb
shopify_app-14.1.0 lib/generators/shopify_app/views/views_generator.rb
shopify_app-14.0.0 lib/generators/shopify_app/views/views_generator.rb
shopify_app-13.5.0 lib/generators/shopify_app/views/views_generator.rb
shopify_app-13.4.1 lib/generators/shopify_app/views/views_generator.rb
shopify_app-13.4.0 lib/generators/shopify_app/views/views_generator.rb
shopify_app-13.3.0 lib/generators/shopify_app/views/views_generator.rb
shopify_app-13.2.0 lib/generators/shopify_app/views/views_generator.rb
shopify_app-13.1.1 lib/generators/shopify_app/views/views_generator.rb
shopify_app-13.1.0 lib/generators/shopify_app/views/views_generator.rb
shopify_app-13.0.1 lib/generators/shopify_app/views/views_generator.rb