Permalink
Browse files

Templater 0.2 fixes

  • Loading branch information...
1 parent 6d1284d commit 745386a9b46faaa1e56c5c19b9387b3b9b3fa61f Justin S. Leitgeb committed Sep 8, 2008
@@ -11,15 +11,15 @@ def self.source_root
DESC
# Install a script/merb script for local execution (for frozen apps).
- file :script_merb do
- source(bin_merb_location)
- destination('script/merb')
+ file :script_merb do |f|
+ f.source = bin_merb_location
+ f.destination = 'script/merb'
end
# Install a script/merb-gen script for local execution (for frozen apps).
- file :script_merb_gen do
- source(bin_merb_gen_location)
- destination('script/merb-gen')
+ file :script_merb_gen do |f|
+ f.source = bin_merb_gen_location
+ f.destination = 'script/merb-gen'
end
protected
@@ -48,4 +48,4 @@ def bin_merb_gen_location
puts ScriptsGenerator
-end
+end
@@ -1,4 +1,4 @@
-Merb::Generators::ControllerGenerator.template :index_haml, :template_engine => :haml do
- source(File.dirname(__FILE__), 'templates/controller/app/views/%file_name%/index.html.haml')
- destination("app/views", base_path, "#{file_name}/index.html.haml")
+Merb::Generators::ControllerGenerator.template :index_haml, :template_engine => :haml do |t|
+ t.source = File.join(File.dirname(__FILE__), 'templates/controller/app/views/%file_name%/index.html.haml')
+ t.destination = File.join("app/views", base_path, "#{file_name}/index.html.haml")
end
@@ -1,4 +1,4 @@
-Merb::Generators::LayoutGenerator.template :layout_haml, :template_engine => :haml do
- source(File.dirname(__FILE__), 'templates/layout/app/views/layout/%file_name%.html.haml')
- destination("app/views/layout/#{file_name}.html.haml")
-end
+Merb::Generators::LayoutGenerator.template :layout_haml, :template_engine => :haml do |t|
+ t.source = File.join(File.dirname(__FILE__), 'templates/layout/app/views/layout/%file_name%.html.haml')
+ t.destination = "app/views/layout/#{file_name}.html.haml"
+end
@@ -2,11 +2,11 @@
[:show, :index, :edit, :new].each do |view|
- Merb::Generators::ResourceControllerGenerator.template "view_#{view}_haml", :orm => orm, :template_engine => :haml do
- source(File.dirname(__FILE__), "templates/resource_controller/#{orm}/app/views/%file_name%/#{view}.html.haml")
- destination("app/views", base_path, "#{file_name}/#{view}.html.haml")
+ Merb::Generators::ResourceControllerGenerator.template "view_#{view}_haml", :orm => orm, :template_engine => :haml do |t|
+ t.source = File.join(File.dirname(__FILE__), "templates/resource_controller/#{orm}/app/views/%file_name%/#{view}.html.haml")
+ t.destination = File.join("app/views", base_path, "#{file_name}/#{view}.html.haml")
end
end
-end
+end
@@ -21,14 +21,14 @@ class BaseSliceGenerator < NamedGenerator
def self.common_template(name, template_source)
common_base_dir = File.expand_path(File.dirname(__FILE__))
- template name do
- source common_base_dir, 'templates', 'common', template_source
- destination template_source
+ template name do |t|
+ t.source = File.join(common_base_dir, 'templates', 'common', template_source)
+ t.destination = template_source
end
end
end
add :slice, SliceGenerator
-end
+end

0 comments on commit 745386a

Please sign in to comment.