merb-haml-1.1.3/ 0000755 0001750 0001750 00000000000 11765176217 012701 5 ustar tfheen tfheen merb-haml-1.1.3/spec/ 0000755 0001750 0001750 00000000000 11765176217 013633 5 ustar tfheen tfheen merb-haml-1.1.3/spec/spec.opts 0000644 0001750 0001750 00000000032 11765176217 015467 0 ustar tfheen tfheen --format specdoc --colour merb-haml-1.1.3/spec/haml_spec.rb 0000644 0001750 0001750 00000002037 11765176217 016115 0 ustar tfheen tfheen require 'spec_helper' describe "HAML" do it "should be able to render HAML templates" do c = dispatch_to(HamlController, :index) c.body.should == ::Haml::Engine.new("#foo\n %p Hello").render end it "should be able to render HAML templates with locals" do c = dispatch_to(PartialHaml, :index) c.body.should == ::Haml::Engine.new("#foo\n %p Partial").render end it "should use the haml configuration in Merb::Plugins.config" do c = dispatch_to(HamlConfig, :index) c.body.should == ::Haml::Engine.new("#foo\n %foo", :autoclose => ["foo"]).render end it "should be able to have ivars defined in both the controller and the parent template" do c = dispatch_to(PartialIvars, :index) c.body.should == ::Haml::Engine.new("#foo\n %p Partial HAML").render end it "should support capture" do c = dispatch_to(CaptureHaml, :index) c.body.should == "
Hello
\n" end it "should support concat" do c = dispatch_to(ConcatHaml, :index) c.body.should == "Concat
" end end merb-haml-1.1.3/spec/controllers/ 0000755 0001750 0001750 00000000000 11765176217 016201 5 ustar tfheen tfheen merb-haml-1.1.3/spec/controllers/haml.rb 0000644 0001750 0001750 00000000743 11765176217 017453 0 ustar tfheen tfheen class HamlController < Merb::Controller self._template_root = File.dirname(__FILE__) / "views" def index render end end class PartialHaml < HamlController end class HamlConfig < HamlController end class PartialIvars < HamlController def index @var1 = "Partial" render end end class CaptureHaml < HamlController end module Merb::ConcatHamlHelper def concatter(&blk) concat("Concat
", blk.binding) end end class ConcatHaml < HamlController end merb-haml-1.1.3/spec/controllers/views/ 0000755 0001750 0001750 00000000000 11765176217 017336 5 ustar tfheen tfheen merb-haml-1.1.3/spec/controllers/views/partial_ivars/ 0000755 0001750 0001750 00000000000 11765176217 022176 5 ustar tfheen tfheen merb-haml-1.1.3/spec/controllers/views/partial_ivars/index.html.haml 0000644 0001750 0001750 00000000061 11765176217 025110 0 ustar tfheen tfheen #foo - @var2 = "HAML" = partial :partial_haml merb-haml-1.1.3/spec/controllers/views/partial_ivars/_partial_haml.html.haml 0000644 0001750 0001750 00000000026 11765176217 026576 0 ustar tfheen tfheen %p== #{@var1} #{@var2} merb-haml-1.1.3/spec/controllers/views/haml_config/ 0000755 0001750 0001750 00000000000 11765176217 021604 5 ustar tfheen tfheen merb-haml-1.1.3/spec/controllers/views/haml_config/index.html.haml 0000644 0001750 0001750 00000000014 11765176217 024514 0 ustar tfheen tfheen #foo %foo merb-haml-1.1.3/spec/controllers/views/partial_haml/ 0000755 0001750 0001750 00000000000 11765176217 021773 5 ustar tfheen tfheen merb-haml-1.1.3/spec/controllers/views/partial_haml/index.html.haml 0000644 0001750 0001750 00000000062 11765176217 024706 0 ustar tfheen tfheen #foo = partial :partial_haml, :text => "Partial" merb-haml-1.1.3/spec/controllers/views/partial_haml/_partial_haml.html.haml 0000644 0001750 0001750 00000000010 11765176217 026364 0 ustar tfheen tfheen %p= text merb-haml-1.1.3/spec/controllers/views/concat_haml/ 0000755 0001750 0001750 00000000000 11765176217 021606 5 ustar tfheen tfheen merb-haml-1.1.3/spec/controllers/views/concat_haml/index.html.haml 0000644 0001750 0001750 00000000026 11765176217 024521 0 ustar tfheen tfheen - concatter do Hello merb-haml-1.1.3/spec/controllers/views/capture_haml/ 0000755 0001750 0001750 00000000000 11765176217 022002 5 ustar tfheen tfheen merb-haml-1.1.3/spec/controllers/views/capture_haml/index.html.haml 0000644 0001750 0001750 00000000037 11765176217 024717 0 ustar tfheen tfheen - x = capture do %p Hello = x merb-haml-1.1.3/spec/controllers/views/haml_controller/ 0000755 0001750 0001750 00000000000 11765176217 022522 5 ustar tfheen tfheen merb-haml-1.1.3/spec/controllers/views/haml_controller/index.html.haml 0000644 0001750 0001750 00000000020 11765176217 025427 0 ustar tfheen tfheen #foo %p Hello merb-haml-1.1.3/spec/spec_helper.rb 0000644 0001750 0001750 00000001065 11765176217 016453 0 ustar tfheen tfheen require "rubygems" # Use current merb-core sources if running from a typical dev checkout. lib = File.expand_path('../../../merb-core/lib', __FILE__) $LOAD_PATH.unshift(lib) if File.directory?(lib) require 'merb-core' # The lib under test require "merb-haml" # Satisfies Autotest and anyone else not using the Rake tasks require 'spec' # Shared spec files require "controllers/haml" Merb::Plugins.config[:haml] = { "autoclose" => ["foo"] } Merb.start :environment => 'test' Spec::Runner.configure do |config| config.include Merb::Test::RequestHelper end merb-haml-1.1.3/README 0000644 0001750 0001750 00000000106 11765176217 013556 0 ustar tfheen tfheen merb-haml ========= A plugin for the Merb framework that provides ... merb-haml-1.1.3/metadata.yml 0000644 0001750 0001750 00000011040 11765176217 015200 0 ustar tfheen tfheen --- !ruby/object:Gem::Specification name: merb-haml version: !ruby/object:Gem::Version hash: 21 prerelease: false segments: - 1 - 1 - 3 version: 1.1.3 platform: ruby authors: - Yehuda Katz autorequire: bindir: bin cert_chain: [] date: 2010-07-11 00:00:00 +01:00 default_executable: dependencies: - !ruby/object:Gem::Dependency name: merb-core prerelease: false requirement: &id001 !ruby/object:Gem::Requirement none: false requirements: - - ~> - !ruby/object:Gem::Version hash: 21 segments: - 1 - 1 - 3 version: 1.1.3 type: :runtime version_requirements: *id001 - !ruby/object:Gem::Dependency name: haml prerelease: false requirement: &id002 !ruby/object:Gem::Requirement none: false requirements: - - ">=" - !ruby/object:Gem::Version hash: 9 segments: - 2 - 0 - 3 version: 2.0.3 type: :runtime version_requirements: *id002 - !ruby/object:Gem::Dependency name: rspec prerelease: false requirement: &id003 !ruby/object:Gem::Requirement none: false requirements: - - ">=" - !ruby/object:Gem::Version hash: 13 segments: - 1 - 2 - 9 version: 1.2.9 type: :development version_requirements: *id003 description: Merb plugin for HAML support email: ykatz@engineyard.com executables: [] extensions: [] extra_rdoc_files: - README - LICENSE - TODO files: - Generators - Rakefile - lib/merb-haml/merbtasks.rb - lib/merb-haml/version.rb - lib/merb-haml/template.rb - lib/generators/controller.rb - lib/generators/templates/controller/app/views/%file_name%/index.html.haml - lib/generators/templates/resource_controller/datamapper/app/views/%file_name%/index.html.haml - lib/generators/templates/resource_controller/datamapper/app/views/%file_name%/edit.html.haml - lib/generators/templates/resource_controller/datamapper/app/views/%file_name%/new.html.haml - lib/generators/templates/resource_controller/datamapper/app/views/%file_name%/show.html.haml - lib/generators/templates/resource_controller/none/app/views/%file_name%/index.html.haml - lib/generators/templates/resource_controller/none/app/views/%file_name%/edit.html.haml - lib/generators/templates/resource_controller/none/app/views/%file_name%/new.html.haml - lib/generators/templates/resource_controller/none/app/views/%file_name%/show.html.haml - lib/generators/templates/resource_controller/sequel/app/views/%file_name%/index.html.haml - lib/generators/templates/resource_controller/sequel/app/views/%file_name%/edit.html.haml - lib/generators/templates/resource_controller/sequel/app/views/%file_name%/new.html.haml - lib/generators/templates/resource_controller/sequel/app/views/%file_name%/show.html.haml - lib/generators/templates/resource_controller/activerecord/app/views/%file_name%/index.html.haml - lib/generators/templates/resource_controller/activerecord/app/views/%file_name%/edit.html.haml - lib/generators/templates/resource_controller/activerecord/app/views/%file_name%/new.html.haml - lib/generators/templates/resource_controller/activerecord/app/views/%file_name%/show.html.haml - lib/generators/templates/layout/app/views/layout/%file_name%.html.haml - lib/generators/resource_controller.rb - lib/generators/layout.rb - lib/merb-haml.rb - spec/spec.opts - spec/spec_helper.rb - spec/controllers/haml.rb - spec/controllers/views/capture_haml/index.html.haml - spec/controllers/views/concat_haml/index.html.haml - spec/controllers/views/haml_controller/index.html.haml - spec/controllers/views/partial_ivars/index.html.haml - spec/controllers/views/partial_ivars/_partial_haml.html.haml - spec/controllers/views/haml_config/index.html.haml - spec/controllers/views/partial_haml/index.html.haml - spec/controllers/views/partial_haml/_partial_haml.html.haml - spec/haml_spec.rb - README - LICENSE - TODO has_rdoc: true homepage: http://merbivore.com/ licenses: [] post_install_message: rdoc_options: [] require_paths: - lib required_ruby_version: !ruby/object:Gem::Requirement none: false requirements: - - ">=" - !ruby/object:Gem::Version hash: 3 segments: - 0 version: "0" required_rubygems_version: !ruby/object:Gem::Requirement none: false requirements: - - ">=" - !ruby/object:Gem::Version hash: 3 segments: - 0 version: "0" requirements: [] rubyforge_project: rubygems_version: 1.3.7 signing_key: specification_version: 3 summary: Merb plugin that provides support for writing view template with HAML test_files: [] merb-haml-1.1.3/LICENSE 0000644 0001750 0001750 00000002036 11765176217 013707 0 ustar tfheen tfheen Copyright (c) 2008 Yehuda Katz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. merb-haml-1.1.3/Rakefile 0000644 0001750 0001750 00000001357 11765176217 014354 0 ustar tfheen tfheen require 'rubygems' require 'rake' # Load this library's version information require File.expand_path('../lib/merb-haml/version', __FILE__) require 'spec/rake/spectask' Spec::Rake::SpecTask.new(:spec) do |spec| spec.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts') spec.libs << 'lib' << 'spec' spec.spec_files = FileList['spec/**/*_spec.rb'] end Spec::Rake::SpecTask.new(:rcov) do |spec| spec.libs << 'lib' << 'spec' spec.pattern = 'spec/**/*_spec.rb' spec.rcov = true end task :default => :spec require 'rake/rdoctask' Rake::RDocTask.new do |rdoc| rdoc.rdoc_dir = 'rdoc' rdoc.title = "test_gem #{Merb::Haml::VERSION}" rdoc.rdoc_files.include('README*') rdoc.rdoc_files.include('lib/**/*.rb') end merb-haml-1.1.3/TODO 0000644 0001750 0001750 00000000246 11765176217 013373 0 ustar tfheen tfheen TODO: Fix LICENSE with your name Fix Rakefile with your name and contact info Add your code to lib/merb-haml.rb Add your Merb rake tasks to lib/merb-haml/merbtasks.rb merb-haml-1.1.3/Generators 0000644 0001750 0001750 00000000255 11765176217 014737 0 ustar tfheen tfheen scope 'merb-gen' do dir = File.join(File.dirname(__FILE__), 'lib', 'generators/') Merb.add_generators dir + 'controller', dir + 'layout', dir + 'resource_controller' end merb-haml-1.1.3/lib/ 0000755 0001750 0001750 00000000000 11765176217 013447 5 ustar tfheen tfheen merb-haml-1.1.3/lib/generators/ 0000755 0001750 0001750 00000000000 11765176217 015620 5 ustar tfheen tfheen merb-haml-1.1.3/lib/generators/layout.rb 0000644 0001750 0001750 00000000404 11765176217 017460 0 ustar tfheen tfheen 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 merb-haml-1.1.3/lib/generators/controller.rb 0000644 0001750 0001750 00000000441 11765176217 020327 0 ustar tfheen tfheen 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 merb-haml-1.1.3/lib/generators/resource_controller.rb 0000644 0001750 0001750 00000000736 11765176217 022245 0 ustar tfheen tfheen [:activerecord, :datamapper, :sequel, :none].each do |orm| [:show, :index, :edit, :new].each do |view| 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 merb-haml-1.1.3/lib/generators/templates/ 0000755 0001750 0001750 00000000000 11765176217 017616 5 ustar tfheen tfheen merb-haml-1.1.3/lib/generators/templates/layout/ 0000755 0001750 0001750 00000000000 11765176217 021133 5 ustar tfheen tfheen merb-haml-1.1.3/lib/generators/templates/layout/app/ 0000755 0001750 0001750 00000000000 11765176217 021713 5 ustar tfheen tfheen merb-haml-1.1.3/lib/generators/templates/layout/app/views/ 0000755 0001750 0001750 00000000000 11765176217 023050 5 ustar tfheen tfheen merb-haml-1.1.3/lib/generators/templates/layout/app/views/layout/ 0000755 0001750 0001750 00000000000 11765176217 024365 5 ustar tfheen tfheen merb-haml-1.1.3/lib/generators/templates/layout/app/views/layout/%file_name%.html.haml 0000644 0001750 0001750 00000000521 11765176217 030222 0 ustar tfheen tfheen !!! Strict %html{ html_attrs("en_us") } %head %title Fresh Merb App %meta{ :content => "text/html; charset=utf-8", "http-equiv" => "content-type" }/ %link{ :href => "/stylesheets/master.css", :rel => "stylesheet", :media => "screen", :type => "text/css", :charset => "utf-8" }/ %body = catch_content :for_layout merb-haml-1.1.3/lib/generators/templates/controller/ 0000755 0001750 0001750 00000000000 11765176217 022001 5 ustar tfheen tfheen merb-haml-1.1.3/lib/generators/templates/controller/app/ 0000755 0001750 0001750 00000000000 11765176217 022561 5 ustar tfheen tfheen merb-haml-1.1.3/lib/generators/templates/controller/app/views/ 0000755 0001750 0001750 00000000000 11765176217 023716 5 ustar tfheen tfheen merb-haml-1.1.3/lib/generators/templates/controller/app/views/%file_name%/ 0000755 0001750 0001750 00000000000 11765176217 025747 5 ustar tfheen tfheen merb-haml-1.1.3/lib/generators/templates/controller/app/views/%file_name%/index.html.haml 0000644 0001750 0001750 00000000064 11765176217 030664 0 ustar tfheen tfheen You're in index of the <%= class_name %> controller. merb-haml-1.1.3/lib/generators/templates/resource_controller/ 0000755 0001750 0001750 00000000000 11765176217 023710 5 ustar tfheen tfheen merb-haml-1.1.3/lib/generators/templates/resource_controller/sequel/ 0000755 0001750 0001750 00000000000 11765176217 025206 5 ustar tfheen tfheen merb-haml-1.1.3/lib/generators/templates/resource_controller/sequel/app/ 0000755 0001750 0001750 00000000000 11765176217 025766 5 ustar tfheen tfheen merb-haml-1.1.3/lib/generators/templates/resource_controller/sequel/app/views/ 0000755 0001750 0001750 00000000000 11765176217 027123 5 ustar tfheen tfheen merb-haml-1.1.3/lib/generators/templates/resource_controller/sequel/app/views/%file_name%/ 0000755 0001750 0001750 00000000000 11765176217 031154 5 ustar tfheen tfheen ././@LongLink 0000000 0000000 0000000 00000000152 00000000000 011563 L ustar root root merb-haml-1.1.3/lib/generators/templates/resource_controller/sequel/app/views/%file_name%/index.html.haml merb-haml-1.1.3/lib/generators/templates/resource_controller/sequel/app/views/%file_name%/index.html0000644 0001750 0001750 00000000167 11765176217 033155 0 ustar tfheen tfheen %h1 <%= class_name %> controller, index action %p Edit this file in %tt app/views/<%= file_name %>/index.html.haml ././@LongLink 0000000 0000000 0000000 00000000151 00000000000 011562 L ustar root root merb-haml-1.1.3/lib/generators/templates/resource_controller/sequel/app/views/%file_name%/edit.html.haml merb-haml-1.1.3/lib/generators/templates/resource_controller/sequel/app/views/%file_name%/edit.html.0000644 0001750 0001750 00000000165 11765176217 033047 0 ustar tfheen tfheen %h1 <%= class_name %> controller, edit action %p Edit this file in %tt app/views/<%= file_name %>/edit.html.haml ././@LongLink 0000000 0000000 0000000 00000000151 00000000000 011562 L ustar root root merb-haml-1.1.3/lib/generators/templates/resource_controller/sequel/app/views/%file_name%/show.html.haml merb-haml-1.1.3/lib/generators/templates/resource_controller/sequel/app/views/%file_name%/show.html.0000644 0001750 0001750 00000000165 11765176217 033102 0 ustar tfheen tfheen %h1 <%= class_name %> controller, show action %p Edit this file in %tt app/views/<%= file_name %>/show.html.haml ././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root merb-haml-1.1.3/lib/generators/templates/resource_controller/sequel/app/views/%file_name%/new.html.haml merb-haml-1.1.3/lib/generators/templates/resource_controller/sequel/app/views/%file_name%/new.html.h0000644 0001750 0001750 00000000163 11765176217 033061 0 ustar tfheen tfheen %h1 <%= class_name %> controller, new action %p Edit this file in %tt app/views/<%= file_name %>/new.html.haml merb-haml-1.1.3/lib/generators/templates/resource_controller/none/ 0000755 0001750 0001750 00000000000 11765176217 024647 5 ustar tfheen tfheen merb-haml-1.1.3/lib/generators/templates/resource_controller/none/app/ 0000755 0001750 0001750 00000000000 11765176217 025427 5 ustar tfheen tfheen merb-haml-1.1.3/lib/generators/templates/resource_controller/none/app/views/ 0000755 0001750 0001750 00000000000 11765176217 026564 5 ustar tfheen tfheen merb-haml-1.1.3/lib/generators/templates/resource_controller/none/app/views/%file_name%/ 0000755 0001750 0001750 00000000000 11765176217 030615 5 ustar tfheen tfheen ././@LongLink 0000000 0000000 0000000 00000000150 00000000000 011561 L ustar root root merb-haml-1.1.3/lib/generators/templates/resource_controller/none/app/views/%file_name%/index.html.haml merb-haml-1.1.3/lib/generators/templates/resource_controller/none/app/views/%file_name%/index.html.h0000644 0001750 0001750 00000000167 11765176217 033044 0 ustar tfheen tfheen %h1 <%= class_name %> controller, index action %p Edit this file in %tt app/views/<%= file_name %>/index.html.haml ././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root merb-haml-1.1.3/lib/generators/templates/resource_controller/none/app/views/%file_name%/edit.html.haml merb-haml-1.1.3/lib/generators/templates/resource_controller/none/app/views/%file_name%/edit.html.ha0000644 0001750 0001750 00000000165 11765176217 033021 0 ustar tfheen tfheen %h1 <%= class_name %> controller, edit action %p Edit this file in %tt app/views/<%= file_name %>/edit.html.haml ././@LongLink 0000000 0000000 0000000 00000000147 00000000000 011567 L ustar root root merb-haml-1.1.3/lib/generators/templates/resource_controller/none/app/views/%file_name%/show.html.haml merb-haml-1.1.3/lib/generators/templates/resource_controller/none/app/views/%file_name%/show.html.ha0000644 0001750 0001750 00000000165 11765176217 033054 0 ustar tfheen tfheen %h1 <%= class_name %> controller, show action %p Edit this file in %tt app/views/<%= file_name %>/show.html.haml ././@LongLink 0000000 0000000 0000000 00000000146 00000000000 011566 L ustar root root merb-haml-1.1.3/lib/generators/templates/resource_controller/none/app/views/%file_name%/new.html.haml merb-haml-1.1.3/lib/generators/templates/resource_controller/none/app/views/%file_name%/new.html.ham0000644 0001750 0001750 00000000163 11765176217 033040 0 ustar tfheen tfheen %h1 <%= class_name %> controller, new action %p Edit this file in %tt app/views/<%= file_name %>/new.html.haml merb-haml-1.1.3/lib/generators/templates/resource_controller/datamapper/ 0000755 0001750 0001750 00000000000 11765176217 026026 5 ustar tfheen tfheen merb-haml-1.1.3/lib/generators/templates/resource_controller/datamapper/app/ 0000755 0001750 0001750 00000000000 11765176217 026606 5 ustar tfheen tfheen merb-haml-1.1.3/lib/generators/templates/resource_controller/datamapper/app/views/ 0000755 0001750 0001750 00000000000 11765176217 027743 5 ustar tfheen tfheen merb-haml-1.1.3/lib/generators/templates/resource_controller/datamapper/app/views/%file_name%/ 0000755 0001750 0001750 00000000000 11765176217 031774 5 ustar tfheen tfheen ././@LongLink 0000000 0000000 0000000 00000000156 00000000000 011567 L ustar root root merb-haml-1.1.3/lib/generators/templates/resource_controller/datamapper/app/views/%file_name%/index.html.haml merb-haml-1.1.3/lib/generators/templates/resource_controller/datamapper/app/views/%file_name%/index.0000644 0001750 0001750 00000001226 11765176217 033105 0 ustar tfheen tfheen %h1 <%= class_name %> controller, index action %p Edit this file in %tt app/views/<%= file_name %>/index.html.haml %table %tr <% for property in properties.reject{|p| p.lazy?} -%> %th <%= DataMapper::Inflection.humanize(property.field) %> <% end -%> - for <%= singular_model %> in @<%= plural_model %> %tr <% for property in properties.reject{|p| p.lazy?} -%> %td =h <%= singular_model %>.<%= property.getter %> <% end -%> %td = link_to 'Show', resource(<%= singular_model %>) %td = link_to 'Edit', resource(<%= singular_model %>, :edit) = link_to 'New', resource(:<%= plural_model %>, :new) ././@LongLink 0000000 0000000 0000000 00000000155 00000000000 011566 L ustar root root merb-haml-1.1.3/lib/generators/templates/resource_controller/datamapper/app/views/%file_name%/edit.html.haml merb-haml-1.1.3/lib/generators/templates/resource_controller/datamapper/app/views/%file_name%/edit.h0000644 0001750 0001750 00000001123 11765176217 033067 0 ustar tfheen tfheen %h1 <%= class_name %> controller, edit action %p Edit this file in %tt app/views/<%= file_name %>/edit.html.haml = error_messages_for @<%= singular_model %> = form_for(@<%= singular_model %>, :action => resource(@<%= singular_model %>)) do <% for property in properties.select{|p| !p.key?} -%> %p %b <%= DataMapper::Inflection.humanize(property.field) %> %br/ = <%= field_from_type(property.type) %> :<%= property.getter %> <% end -%> %p = submit "Update" = link_to 'Show', resource(@<%= singular_model %>) | = link_to 'Back', resource(:<%= plural_model %>) ././@LongLink 0000000 0000000 0000000 00000000155 00000000000 011566 L ustar root root merb-haml-1.1.3/lib/generators/templates/resource_controller/datamapper/app/views/%file_name%/show.html.haml merb-haml-1.1.3/lib/generators/templates/resource_controller/datamapper/app/views/%file_name%/show.h0000644 0001750 0001750 00000000615 11765176217 033127 0 ustar tfheen tfheen %h1 <%= class_name %> controller, show action %p Edit this file in %tt app/views/<%= file_name %>/show.html.haml <% for property in properties -%> %p %b <%= DataMapper::Inflection.humanize(property.field) %>: =h @<%= singular_model %>.<%= property.getter %> <% end -%> = link_to 'Edit', resource(@<%= singular_model %>, :edit) | = link_to 'Back', resource(:<%= plural_model %>) ././@LongLink 0000000 0000000 0000000 00000000154 00000000000 011565 L ustar root root merb-haml-1.1.3/lib/generators/templates/resource_controller/datamapper/app/views/%file_name%/new.html.haml merb-haml-1.1.3/lib/generators/templates/resource_controller/datamapper/app/views/%file_name%/new.ht0000644 0001750 0001750 00000001025 11765176217 033120 0 ustar tfheen tfheen %h1 <%= class_name %> controller, new action %p Edit this file in %tt app/views/<%= file_name %>/new.html.haml = error_messages_for @<%= singular_model %> = form_for(@<%= singular_model %>, :action => resource(:<%= plural_model %>) ) do <% for property in properties.select{|p| !p.key?} -%> %p %b <%= DataMapper::Inflection.humanize(property.field) %> = <%= field_from_type(property.type) %> :<%= property.getter %> <% end -%> %p = submit "Create" = link_to 'Back', resource(:<%= plural_model %>) merb-haml-1.1.3/lib/generators/templates/resource_controller/activerecord/ 0000755 0001750 0001750 00000000000 11765176217 026362 5 ustar tfheen tfheen merb-haml-1.1.3/lib/generators/templates/resource_controller/activerecord/app/ 0000755 0001750 0001750 00000000000 11765176217 027142 5 ustar tfheen tfheen merb-haml-1.1.3/lib/generators/templates/resource_controller/activerecord/app/views/ 0000755 0001750 0001750 00000000000 11765176217 030277 5 ustar tfheen tfheen merb-haml-1.1.3/lib/generators/templates/resource_controller/activerecord/app/views/%file_name%/ 0000755 0001750 0001750 00000000000 11765176217 032330 5 ustar tfheen tfheen ././@LongLink 0000000 0000000 0000000 00000000160 00000000000 011562 L ustar root root merb-haml-1.1.3/lib/generators/templates/resource_controller/activerecord/app/views/%file_name%/index.html.haml merb-haml-1.1.3/lib/generators/templates/resource_controller/activerecord/app/views/%file_name%/inde0000644 0001750 0001750 00000000167 11765176217 033176 0 ustar tfheen tfheen %h1 <%= class_name %> controller, index action %p Edit this file in %tt app/views/<%= file_name %>/index.html.haml ././@LongLink 0000000 0000000 0000000 00000000157 00000000000 011570 L ustar root root merb-haml-1.1.3/lib/generators/templates/resource_controller/activerecord/app/views/%file_name%/edit.html.haml merb-haml-1.1.3/lib/generators/templates/resource_controller/activerecord/app/views/%file_name%/edit0000644 0001750 0001750 00000000165 11765176217 033202 0 ustar tfheen tfheen %h1 <%= class_name %> controller, edit action %p Edit this file in %tt app/views/<%= file_name %>/edit.html.haml ././@LongLink 0000000 0000000 0000000 00000000157 00000000000 011570 L ustar root root merb-haml-1.1.3/lib/generators/templates/resource_controller/activerecord/app/views/%file_name%/show.html.haml merb-haml-1.1.3/lib/generators/templates/resource_controller/activerecord/app/views/%file_name%/show0000644 0001750 0001750 00000000165 11765176217 033235 0 ustar tfheen tfheen %h1 <%= class_name %> controller, show action %p Edit this file in %tt app/views/<%= file_name %>/show.html.haml ././@LongLink 0000000 0000000 0000000 00000000156 00000000000 011567 L ustar root root merb-haml-1.1.3/lib/generators/templates/resource_controller/activerecord/app/views/%file_name%/new.html.haml merb-haml-1.1.3/lib/generators/templates/resource_controller/activerecord/app/views/%file_name%/new.0000644 0001750 0001750 00000000163 11765176217 033122 0 ustar tfheen tfheen %h1 <%= class_name %> controller, new action %p Edit this file in %tt app/views/<%= file_name %>/new.html.haml merb-haml-1.1.3/lib/merb-haml.rb 0000644 0001750 0001750 00000002255 11765176217 015644 0 ustar tfheen tfheen require "merb-core" require "haml" require "merb-haml/template" Merb::Plugins.add_rakefiles(File.join(File.dirname(__FILE__) / "merb-haml" / "merbtasks")) Merb::Plugins.config[:sass] ||= {} Merb::BootLoader.after_app_loads do template_locations = [] template_locations << Merb.dir_for(:stylesheet) / "sass" # extract template locations list from sass config config_location = Merb::Plugins.config[:sass][:template_location] if config_location.is_a? Hash template_locations += config_location.keys elsif config_location template_locations << config_location.to_s end # setup sass if any template paths match if template_locations.any?{|location| File.directory?(location) } require "sass" if Merb::Config[:sass] Merb.logger.info("Please define your sass settings in Merb::Plugins.config[:sass] not Merb::Config") Sass::Plugin.options = Merb::Config[:sass] else Sass::Plugin.options = Merb::Plugins.config[:sass] end end end generators = File.join(File.dirname(__FILE__), 'generators') Merb.add_generators generators / "resource_controller" Merb.add_generators generators / "controller" Merb.add_generators generators / "layout" merb-haml-1.1.3/lib/merb-haml/ 0000755 0001750 0001750 00000000000 11765176217 015313 5 ustar tfheen tfheen merb-haml-1.1.3/lib/merb-haml/merbtasks.rb 0000644 0001750 0001750 00000000431 11765176217 017631 0 ustar tfheen tfheen namespace :haml do desc "Compiles all sass files into CSS" task :compile_sass do require 'sass' puts "*** Updating stylesheets" Sass::Plugin.options = Merb::Config[:sass] if Merb::Config[:sass] Sass::Plugin.update_stylesheets puts "*** Done" end end merb-haml-1.1.3/lib/merb-haml/version.rb 0000644 0001750 0001750 00000000101 11765176217 017315 0 ustar tfheen tfheen module Merb module Haml VERSION = '1.1.3'.freeze end end merb-haml-1.1.3/lib/merb-haml/template.rb 0000644 0001750 0001750 00000003354 11765176217 017460 0 ustar tfheen tfheen module Merb::Template class Haml # Defines a method for calling a specific HAML template. # # ==== Parameters # path