Sha256: 6261424b14c9cbd2508bd09402c54e17afae941ff40507bf742ea65538247457

Contents?: true

Size: 548 Bytes

Versions: 4

Compression:

Stored size: 548 Bytes

Contents

require 'rails/generators'
require 'rails/generators/base'

class Taro::Rails::Generators::InstallGenerator < ::Rails::Generators::Base
  desc 'Set up Taro base type files in your Rails app'

  class_option :dir, type: :string, default: "app/types"

  source_root File.expand_path("templates", __dir__)

  # :nocov:
  def create_type_files
    Dir["#{self.class.source_root}/**/*.erb"].each do |tmpl|
      dest_dir = options[:dir].chomp('/')
      template tmpl, "#{dest_dir}/#{File.basename(tmpl).sub('erb', 'rb')}"
    end
  end
  # :nocov:
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
taro-2.0.0 lib/taro/rails/generators/install_generator.rb
taro-1.4.0 lib/taro/rails/generators/install_generator.rb
taro-1.3.0 lib/taro/rails/generators/install_generator.rb
taro-1.2.0 lib/taro/rails/generators/install_generator.rb