Sha256: 9d6925dbbdecf55b1bae160de089241af542a3b4bbc65c0fca0d2a0c904f5ad3

Contents?: true

Size: 554 Bytes

Versions: 3

Compression:

Stored size: 554 Bytes

Contents

require 'rails/generators/base'

module Reporta
  module Generators
    class ViewsGenerator < Rails::Generators::Base
      source_root File.expand_path("../../templates", __FILE__)
      public_task :copy_views

      def copy_views
        view_directory :reports
      end
      
      def view_directory(name, _target_path = nil)
        directory name.to_s, _target_path || "#{target_path}/#{name}" do |content|
          content
        end
      end

      def target_path
        @target_path ||= "app/views/reporta"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
reporta-modules-0.0.3 lib/generators/reporta/views_generator.rb
reporta-modules-0.0.2 lib/generators/reporta/views_generator.rb
reporta-modules-0.0.1 lib/generators/reporta/views_generator.rb