Sha256: 83c368499320173a9d779407958d349f37c6d56ab67ca3f3558b21a45cb1eff6
Contents?: true
Size: 973 Bytes
Versions: 2
Compression:
Stored size: 973 Bytes
Contents
module Picky module Generators # Selects the right generator. # class Selector attr_reader :types def initialize @types = { :sinatra_client => [Client::Sinatra, :sinatra_project_name], :unicorn_server => [Server::Unicorn, :unicorn_project_name] } end # Run the generators with this command. # # This will "route" the commands to the right specific generator. # def generate *args generator = generator_for *args generator.generate end # # def generator_for identifier = nil, *args generator_info = types[identifier.to_sym] generator_class = generator_info.first generator_for_class generator_class, identifier, *args rescue raise NotFoundException.new(self) end # # def generator_for_class klass, *args klass.new *args end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
picky-generators-1.1.1 | lib/picky-generators/generators/selector.rb |
picky-generators-1.1.0 | lib/picky-generators/generators/selector.rb |