Sha256: 108a5c5e42fcc309945f8c46fdc84556f6a140b0030743214d69f97aa568e27c

Contents?: true

Size: 665 Bytes

Versions: 26

Compression:

Stored size: 665 Bytes

Contents

module Bowline::Generators
  class BinderGenerator < NamedGenerator
    desc <<-DESC
      Generates a new binder, either a collection one, or a singleton one.
    DESC
    
    def class_name
      super + " < Bowline::Binders::#{type.to_s.camel_case}"
    end
    
    def modules
      ['Binders']
    end
    
    first_argument :name, :required => true, :desc => "binder name"
    option :type, :desc => "Binder type (collection/singleton)", :default => "collection"
    
    template :binder do |template|
      template.source       = "binder.rb"
      template.destination  = "app/binders/#{file_name}.rb"
    end
  end
  
  add :binder, BinderGenerator
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
maccman-bowline-0.1.1 lib/bowline/generators/binder.rb
maccman-bowline-0.1.10 lib/bowline/generators/binder.rb
maccman-bowline-0.1.2 lib/bowline/generators/binder.rb
maccman-bowline-0.1.3 lib/bowline/generators/binder.rb
maccman-bowline-0.1.4 lib/bowline/generators/binder.rb
maccman-bowline-0.1.6 lib/bowline/generators/binder.rb
maccman-bowline-0.1.7 lib/bowline/generators/binder.rb
maccman-bowline-0.1.8 lib/bowline/generators/binder.rb
maccman-bowline-0.3.0 lib/bowline/generators/binder.rb
maccman-bowline-0.3.1 lib/bowline/generators/binder.rb
maccman-bowline-0.3.3 lib/bowline/generators/binder.rb
maccman-bowline-0.3.5 lib/bowline/generators/binder.rb
maccman-bowline-0.3.6 lib/bowline/generators/binder.rb
maccman-bowline-0.3.7 lib/bowline/generators/binder.rb
maccman-bowline-0.3.9 lib/bowline/generators/binder.rb
maccman-bowline-0.4.0 lib/bowline/generators/binder.rb
maccman-bowline-0.4.1 lib/bowline/generators/binder.rb
maccman-bowline-0.4.3 lib/bowline/generators/binder.rb
maccman-bowline-0.4.4 lib/bowline/generators/binder.rb
maccman-bowline-0.4.5 lib/bowline/generators/binder.rb