Sha256: 730386e930cda684b0b4fa29e988e96b1ee6de975be27e3833a81ca6b81cf482

Contents?: true

Size: 466 Bytes

Versions: 26

Compression:

Stored size: 466 Bytes

Contents

class ClassyEnumGenerator < Rails::Generators::NamedBase
  desc "Generate a ClassyEnum definition in app/enums/"

  argument :name, :type => :string, :required => true, :banner => 'EnumName'
  argument :values, :type => :array, :default => [], :banner => 'value1 value2 value3 etc...'

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

  def copy_files # :nodoc:
    empty_directory 'app/enums'
    template "enum.rb", "app/enums/#{file_name}.rb"
  end

end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
classy_enum-3.2.1 lib/generators/classy_enum/classy_enum_generator.rb
classy_enum-3.2.0 lib/generators/classy_enum/classy_enum_generator.rb
classy_enum-3.1.3 lib/generators/classy_enum/classy_enum_generator.rb
classy_enum-3.1.2 lib/generators/classy_enum/classy_enum_generator.rb
classy_enum-3.1.1 lib/generators/classy_enum/classy_enum_generator.rb
classy_enum-3.1.0 lib/generators/classy_enum/classy_enum_generator.rb
classy_enum-3.0.1 lib/generators/classy_enum/classy_enum_generator.rb
classy_enum-3.0.0 lib/generators/classy_enum/classy_enum_generator.rb
classy_enum-2.3.0 lib/generators/classy_enum/classy_enum_generator.rb
classy_enum-2.2.0 lib/generators/classy_enum/classy_enum_generator.rb
classy_enum-2.1.0 lib/generators/classy_enum/classy_enum_generator.rb
classy_enum-2.0.3 lib/generators/classy_enum/classy_enum_generator.rb
classy_enum-2.0.2 lib/generators/classy_enum/classy_enum_generator.rb
classy_enum-2.0.1 lib/generators/classy_enum/classy_enum_generator.rb
classy_enum-1.4.0 lib/generators/classy_enum/classy_enum_generator.rb
classy_enum-1.3.2 lib/generators/classy_enum/classy_enum_generator.rb
classy_enum-1.3.1 lib/generators/classy_enum/classy_enum_generator.rb
classy_enum-1.3.0 lib/generators/classy_enum/classy_enum_generator.rb
classy_enum-1.2.0 lib/generators/classy_enum/classy_enum_generator.rb
classy_enum-1.1.0 lib/generators/classy_enum/classy_enum_generator.rb