Skip to content
This repository has been archived by the owner on Feb 7, 2020. It is now read-only.

Commit

Permalink
preprocess.rb changed to setup.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Šťastný aka Botanicus committed Nov 19, 2009
1 parent 4e0e4cc commit 9c6a85f
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 40 deletions.
13 changes: 0 additions & 13 deletions stubs/app/preprocess.rb

This file was deleted.

13 changes: 13 additions & 0 deletions stubs/app/setup.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# encoding: utf-8

# This hook will run before simple-templater creates new files from templates
# You can update context hash. Don't forget to use merge! instead of merge,
# because you are manipulating with one object, rather than returning new one
# Dir.pwd => empty directory where the project will be located

# rango create app blog --models=post,tag --controllers=posts,tags
setup do |generator, context|
models = context[:models] || Array.new
controllers = context[:controllers] || Array.new
context.merge!(models: models, controllers: controllers)
end
6 changes: 0 additions & 6 deletions stubs/bigapp/preprocess.rb

This file was deleted.

13 changes: 13 additions & 0 deletions stubs/bigapp/setup.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# encoding: utf-8

# This hook will run before simple-templater creates new files from templates
# You can update context hash. Don't forget to use merge! instead of merge,
# because you are manipulating with one object, rather than returning new one
# Dir.pwd => empty directory where the project will be located

# rango create app blog --models=post,tag --controllers=posts,tags
setup do |generator, context|
models = context[:models] || Array.new
controllers = context[:controllers] || Array.new
context.merge!(models: models, controllers: controllers)
end
5 changes: 0 additions & 5 deletions stubs/flat/preprocess.rb

This file was deleted.

10 changes: 10 additions & 0 deletions stubs/flat/setup.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# encoding: utf-8

# This hook will run before simple-templater creates new files from templates
# You can update context hash. Don't forget to use merge! instead of merge,
# because you are manipulating with one object, rather than returning new one
# Dir.pwd => empty directory where the project will be located

setup do |generator, context|
#
end
2 changes: 1 addition & 1 deletion stubs/project/content/init.rb.rbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= shebang @options %>
<%= shebang %>
# encoding: utf-8

require "rango"
Expand Down
14 changes: 0 additions & 14 deletions stubs/project/preprocess.rb

This file was deleted.

13 changes: 13 additions & 0 deletions stubs/project/setup.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# encoding: utf-8

# This hook will run before simple-templater creates new files from templates
# You can update context hash. Don't forget to use merge! instead of merge,
# because you are manipulating with one object, rather than returning new one
# Dir.pwd => empty directory where the project will be located

# rango create app blog --models=post,tag --controllers=posts,tags
setup do |generator, context|
models = context[:models] || Array.new
controllers = context[:controllers] || Array.new
context.merge!(models: models, controllers: controllers)
end

0 comments on commit 9c6a85f

Please sign in to comment.