Sha256: ed65d450b8932361fd40f0c83405f559e70d03f8e6996a2d707fae733624b7bb

Contents?: true

Size: 881 Bytes

Versions: 18

Compression:

Stored size: 881 Bytes

Contents

# encoding: utf-8

# This hook will be executed in context of current generator object before templater start to generate new files.
# You can update context hash and register hooks. Don't forget to use merge! instead of merge, because you are
# manipulating with one object, rather than returning new one.

# rango create app blog --models=post,tag --controllers=posts,tags --router=usher|rack-router|rack-mount --template-engine=erubis
hook do |generator, context|
  models = [context[:models]].compact.flatten # the flatten thing: if you have --models=post, it would be just a string
  controllers = [context[:controllers]].compact.flatten
  context.merge!(models: models, controllers: controllers)
  context[:orm] = "datamapper" unless context[:orm]
  context[:router] = "usher" unless context[:router]
  context[:template_engine] = "haml" unless context[:template_engine]
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
rango-0.2 stubs/stack/setup.rb
rango-0.1.1.3 stubs/stack/setup.rb
rango-0.1.1.2.11 stubs/stack/setup.rb
rango-0.1.1.2.10 stubs/project/setup.rb
rango-0.1.1.2.9 stubs/project/setup.rb
rango-0.1.1.2.8 stubs/project/setup.rb
rango-0.1.1.2.7 stubs/project/setup.rb
rango-0.1.1.2.6 stubs/project/setup.rb
rango-0.1.1.2.5 stubs/project/setup.rb
rango-0.1.1.2.4 stubs/project/setup.rb
rango-0.1.1.2.3 stubs/project/setup.rb
rango-0.1.1.2.2 stubs/project/setup.rb
rango-0.1.1.2.1 stubs/project/setup.rb
rango-0.2.pre stubs/stack/setup.rb
rango-0.1.1.2 stubs/project/setup.rb
rango-0.1.1.1 stubs/project/setup.rb
rango-0.1.1 stubs/project/setup.rb
rango-0.1.0 stubs/project/setup.rb