Sha256: 690c718f0d10d44c411397837a37586247bf6473596049a190318d2ab3c6e28e

Contents?: true

Size: 397 Bytes

Versions: 9

Compression:

Stored size: 397 Bytes

Contents

module Tableficate
  class TableGenerator < Rails::Generators::NamedBase
    desc('Create a Tableficate table model.')

    source_root File.expand_path('../templates', __FILE__)

    TABLES_PATH = 'app/tables'

    argument :scope, required: false

    def create_table
      empty_directory(TABLES_PATH)

      template('table.rb', "#{TABLES_PATH}/#{file_name.underscore}.rb")
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
tableficate-0.3.2 lib/generators/tableficate/table/table_generator.rb
tableficate-0.3.1 lib/generators/tableficate/table/table_generator.rb
tableficate-0.3.0 lib/generators/tableficate/table/table_generator.rb
tableficate-0.2.1 lib/generators/tableficate/table/table_generator.rb
tableficate-0.2.0 lib/generators/tableficate/table/table_generator.rb
tableficate-0.1.3 lib/generators/tableficate/table/table_generator.rb
tableficate-0.1.2 lib/generators/tableficate/table/table_generator.rb
tableficate-0.1.1 lib/generators/tableficate/table/table_generator.rb
tableficate-0.0.1 lib/generators/tableficate/table/table_generator.rb