Sha256: 2ab71f0395b5c9f0cd1284b6fe2cfdf4e5064002d997cef18f267357f62a6dbd

Contents?: true

Size: 695 Bytes

Versions: 5

Compression:

Stored size: 695 Bytes

Contents

require 'rails/generators/base'

module BulutfonDashboard
  module Generators
    class HelpersGenerator < Rails::Generators::Base
      HELPERS = %w(application).freeze

      desc ''

      source_root File.expand_path('../../templates/helpers', __FILE__)
      class_option :controllers, aliases: "-c", type: :array,
                   desc: "Select specific helpers to generate (#{HELPERS.join(', ')})"

      def create_helpers
        scope = 'bulutfon_dashboard'
        controllers = options[:helpers] || HELPERS
        controllers.each do |name|
          template "#{name}_helper.rb",
                   "app/helpers/#{scope}/#{name}_helper.rb"
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bulutfon_dashboard-0.7.4 lib/generators/bulutfon_dashboard/helpers_generator.rb
bulutfon_dashboard-0.7.3 lib/generators/bulutfon_dashboard/helpers_generator.rb
bulutfon_dashboard-0.7.2 lib/generators/bulutfon_dashboard/helpers_generator.rb
bulutfon_dashboard-0.7.1 lib/generators/bulutfon_dashboard/helpers_generator.rb
bulutfon_dashboard-0.7.0 lib/generators/bulutfon_dashboard/helpers_generator.rb