Skip to content

Commit

Permalink
Templater 0.2 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin S. Leitgeb committed Sep 8, 2008
1 parent 6d1284d commit 745386a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
14 changes: 7 additions & 7 deletions merb-gen/lib/generators/scripts.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ def self.source_root
DESC DESC


# Install a script/merb script for local execution (for frozen apps). # Install a script/merb script for local execution (for frozen apps).
file :script_merb do file :script_merb do |f|
source(bin_merb_location) f.source = bin_merb_location
destination('script/merb') f.destination = 'script/merb'
end end


# Install a script/merb-gen script for local execution (for frozen apps). # Install a script/merb-gen script for local execution (for frozen apps).
file :script_merb_gen do file :script_merb_gen do |f|
source(bin_merb_gen_location) f.source = bin_merb_gen_location
destination('script/merb-gen') f.destination = 'script/merb-gen'
end end


protected protected
Expand Down Expand Up @@ -48,4 +48,4 @@ def bin_merb_gen_location


puts ScriptsGenerator puts ScriptsGenerator


end end
6 changes: 3 additions & 3 deletions merb-haml/lib/generators/controller.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
Merb::Generators::ControllerGenerator.template :index_haml, :template_engine => :haml do Merb::Generators::ControllerGenerator.template :index_haml, :template_engine => :haml do |t|
source(File.dirname(__FILE__), 'templates/controller/app/views/%file_name%/index.html.haml') t.source = File.join(File.dirname(__FILE__), 'templates/controller/app/views/%file_name%/index.html.haml')
destination("app/views", base_path, "#{file_name}/index.html.haml") t.destination = File.join("app/views", base_path, "#{file_name}/index.html.haml")
end end
8 changes: 4 additions & 4 deletions merb-haml/lib/generators/layout.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
Merb::Generators::LayoutGenerator.template :layout_haml, :template_engine => :haml do Merb::Generators::LayoutGenerator.template :layout_haml, :template_engine => :haml do |t|
source(File.dirname(__FILE__), 'templates/layout/app/views/layout/%file_name%.html.haml') t.source = File.join(File.dirname(__FILE__), 'templates/layout/app/views/layout/%file_name%.html.haml')
destination("app/views/layout/#{file_name}.html.haml") t.destination = "app/views/layout/#{file_name}.html.haml"
end end
8 changes: 4 additions & 4 deletions merb-haml/lib/generators/resource_controller.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@


[:show, :index, :edit, :new].each do |view| [:show, :index, :edit, :new].each do |view|


Merb::Generators::ResourceControllerGenerator.template "view_#{view}_haml", :orm => orm, :template_engine => :haml do Merb::Generators::ResourceControllerGenerator.template "view_#{view}_haml", :orm => orm, :template_engine => :haml do |t|
source(File.dirname(__FILE__), "templates/resource_controller/#{orm}/app/views/%file_name%/#{view}.html.haml") t.source = File.join(File.dirname(__FILE__), "templates/resource_controller/#{orm}/app/views/%file_name%/#{view}.html.haml")
destination("app/views", base_path, "#{file_name}/#{view}.html.haml") t.destination = File.join("app/views", base_path, "#{file_name}/#{view}.html.haml")
end end


end end


end end
8 changes: 4 additions & 4 deletions merb-slices/lib/generators/base.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ class BaseSliceGenerator < NamedGenerator


def self.common_template(name, template_source) def self.common_template(name, template_source)
common_base_dir = File.expand_path(File.dirname(__FILE__)) common_base_dir = File.expand_path(File.dirname(__FILE__))
template name do template name do |t|
source common_base_dir, 'templates', 'common', template_source t.source = File.join(common_base_dir, 'templates', 'common', template_source)
destination template_source t.destination = template_source
end end
end end


end end


add :slice, SliceGenerator add :slice, SliceGenerator


end end

0 comments on commit 745386a

Please sign in to comment.