Sha256: 402810a17e019b0e590688302ada5243762e103e29062552c4b524d83f59c2ca

Contents?: true

Size: 651 Bytes

Versions: 47

Compression:

Stored size: 651 Bytes

Contents

class PapermillTableGenerator < Rails::Generator::NamedBase
  attr_accessor :class_name, :migration_name
  
  def initialize(args, options = {})
    super
    @class_name = args[0]
  end
  
  def manifest
    @migration_name = file_name.camelize
    
    FileUtils.rm_rf("#{File.join(RAILS_ROOT)}/public/papermill/")
    FileUtils.cp_r(
      Dir[File.join(File.dirname(__FILE__), '../../public')],
      File.join(RAILS_ROOT),
      :verbose => true
    )

    record do |m|
      # Migration creation
      m.migration_template "migrate/papermill_migration.rb.erb", "db/migrate", :migration_file_name => migration_name.underscore
    end
  end 
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
papermill-2.1.1 generators/papermill_table/papermill_table_generator.rb
papermill-2.1.0 generators/papermill_table/papermill_table_generator.rb
papermill-2.0.2 generators/papermill_table/papermill_table_generator.rb
papermill-2.0.1 generators/papermill_table/papermill_table_generator.rb
papermill-2.0.0 generators/papermill_table/papermill_table_generator.rb
papermill-2.0.0.pre generators/papermill_table/papermill_table_generator.rb
papermill-1.4.3 generators/papermill_table/papermill_table_generator.rb
papermill-1.4.2 generators/papermill_table/papermill_table_generator.rb
papermill-1.4.1 generators/papermill_table/papermill_table_generator.rb
papermill-1.4.0 generators/papermill_table/papermill_table_generator.rb
papermill-1.3.6 generators/papermill_table/papermill_table_generator.rb
papermill-1.3.5 generators/papermill_table/papermill_table_generator.rb
papermill-1.3.4 generators/papermill_table/papermill_table_generator.rb
papermill-1.3.3 generators/papermill_table/papermill_table_generator.rb
papermill-1.3.2 generators/papermill_table/papermill_table_generator.rb
papermill-1.3.1 generators/papermill_table/papermill_table_generator.rb
papermill-1.3.0 generators/papermill_table/papermill_table_generator.rb
papermill-1.2.0 generators/papermill_table/papermill_table_generator.rb
papermill-1.1.6 generators/papermill_table/papermill_table_generator.rb
papermill-1.1.5 generators/papermill_table/papermill_table_generator.rb