haml-rails 0.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ *.gem
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source :gemcutter
2
+
3
+ # Specify your gem's dependencies in haml-rails.gemspec
4
+ gemspec
data/README.md CHANGED
@@ -1,3 +1,11 @@
1
1
  # Haml-rails
2
2
 
3
- Haml-rails provides Haml generators for Rails 3. It also enables Haml as the templating engine for you, so you don't have to screw around in your own application.rb when your Gemfile already clearly indicated what templating engine you have installed. Hurrah.
3
+ Haml-rails provides Haml generators for Rails 3. It also enables Haml as the templating engine for you, so you don't have to screw around in your own application.rb when your Gemfile already clearly indicated what templating engine you have installed. Hurrah.
4
+
5
+ To use it, add this line to your Gemfile:
6
+
7
+ gem "haml-rails"
8
+
9
+ Pretty fancy, eh?
10
+
11
+ Once you've done that, any time you generate a controller or scaffold, you'll get Haml instead of ERB templates. On top of that, when your Rails application loads, Haml will be loaded and initialized completely automatically! The modern world is just so amazing.
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path("../lib/haml-rails/version", __FILE__)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "haml-rails"
6
+ s.version = Haml::Rails::VERSION
7
+ s.platform = Gem::Platform::RUBY
8
+ s.authors = ["André Arko"]
9
+ s.email = ["andre@arko.net"]
10
+ s.homepage = "http://github.com/indirect/haml-rails"
11
+ s.summary = "let your Gemfile do the configuring"
12
+ s.description = "Haml-rails provides Haml generators for Rails 3. It also enables Haml as the templating engine for you, so you don't have to screw around in your own application.rb when your Gemfile already clearly indicated what templating engine you have installed. Hurrah."
13
+
14
+ s.rubyforge_project = "haml-rails"
15
+ s.required_rubygems_version = ">= 1.3.6"
16
+
17
+ s.add_dependency "rails", "~>3.0.0.rc"
18
+ s.add_dependency "haml", "~>3.0"
19
+ s.add_development_dependency "bundler", ">= 1.0.0.rc.6"
20
+
21
+ s.files = `git ls-files`.split("\n")
22
+ s.executables = `git ls-files`.split("\n").select{|f| f =~ /^bin/}
23
+ s.require_path = 'lib'
24
+ end
@@ -2,7 +2,7 @@ module Haml
2
2
  module Generators
3
3
  module TemplatePath
4
4
  def source_root
5
- @_haml_source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'haml', generator_name, 'templates'))
5
+ File.expand_path("../haml/#{generator_name}/templates", __FILE__)
6
6
  end
7
7
  end
8
8
  end
@@ -5,12 +5,10 @@ module Haml
5
5
  module Generators
6
6
  class ControllerGenerator < Erb::Generators::ControllerGenerator
7
7
  extend TemplatePath
8
-
9
- protected
10
-
11
- def handler
12
- :haml
13
- end
8
+ protected
9
+ def handler
10
+ :haml
11
+ end
14
12
  end
15
13
  end
16
14
  end
data/lib/haml-rails.rb CHANGED
@@ -1,7 +1,14 @@
1
+ require 'haml'
2
+
1
3
  module Haml
2
4
  module Rails
3
5
  class Railtie < ::Rails::Railtie
4
6
  config.generators.template_engine :haml
7
+
8
+ config.before_initialize do
9
+ Haml.init_rails(binding)
10
+ Haml::Template.options[:format] = :html5
11
+ end
5
12
  end
6
13
  end
7
14
  end
@@ -0,0 +1,5 @@
1
+ module Haml
2
+ module Rails
3
+ VERSION = "0.2"
4
+ end
5
+ end
metadata CHANGED
@@ -4,8 +4,8 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 1
8
- version: "0.1"
7
+ - 2
8
+ version: "0.2"
9
9
  platform: ruby
10
10
  authors:
11
11
  - "Andr\xC3\xA9 Arko"
@@ -13,10 +13,53 @@ autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
15
 
16
- date: 2010-08-13 00:00:00 -07:00
16
+ date: 2010-08-15 00:00:00 -07:00
17
17
  default_executable:
18
- dependencies: []
19
-
18
+ dependencies:
19
+ - !ruby/object:Gem::Dependency
20
+ name: rails
21
+ prerelease: false
22
+ requirement: &id001 !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ segments:
27
+ - 3
28
+ - 0
29
+ - 0
30
+ - rc
31
+ version: 3.0.0.rc
32
+ type: :runtime
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: haml
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ~>
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 3
43
+ - 0
44
+ version: "3.0"
45
+ type: :runtime
46
+ version_requirements: *id002
47
+ - !ruby/object:Gem::Dependency
48
+ name: bundler
49
+ prerelease: false
50
+ requirement: &id003 !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ segments:
55
+ - 1
56
+ - 0
57
+ - 0
58
+ - rc
59
+ - 6
60
+ version: 1.0.0.rc.6
61
+ type: :development
62
+ version_requirements: *id003
20
63
  description: Haml-rails provides Haml generators for Rails 3. It also enables Haml as the templating engine for you, so you don't have to screw around in your own application.rb when your Gemfile already clearly indicated what templating engine you have installed. Hurrah.
21
64
  email:
22
65
  - andre@arko.net
@@ -27,12 +70,14 @@ extensions: []
27
70
  extra_rdoc_files: []
28
71
 
29
72
  files:
73
+ - .gitignore
74
+ - Gemfile
30
75
  - README.md
76
+ - Rakefile
77
+ - haml-rails.gemspec
31
78
  - lib/generators/haml.rb
32
79
  - lib/generators/haml/controller/controller_generator.rb
33
80
  - lib/generators/haml/controller/templates/view.html.haml
34
- - lib/generators/haml/install/install_generator.rb
35
- - lib/generators/haml/install/templates/config/initializers/haml.rb.tt
36
81
  - lib/generators/haml/scaffold/scaffold_generator.rb
37
82
  - lib/generators/haml/scaffold/templates/_form.html.haml.erb
38
83
  - lib/generators/haml/scaffold/templates/edit.html.haml.erb
@@ -40,6 +85,7 @@ files:
40
85
  - lib/generators/haml/scaffold/templates/new.html.haml.erb
41
86
  - lib/generators/haml/scaffold/templates/show.html.haml.erb
42
87
  - lib/haml-rails.rb
88
+ - lib/haml-rails/version.rb
43
89
  has_rdoc: true
44
90
  homepage: http://github.com/indirect/haml-rails
45
91
  licenses: []
@@ -1,14 +0,0 @@
1
- require 'generators/haml'
2
-
3
- module Haml
4
- module Generators
5
- class InstallGenerator < Rails::Generators::Base
6
- extend TemplatePath
7
-
8
- def copy_initializer_files
9
- template "config/initializers/haml.rb.tt", "config/initializers/haml.rb"
10
- end
11
-
12
- end
13
- end
14
- end
@@ -1,4 +0,0 @@
1
- # Load Haml and Sass.
2
- Haml.init_rails(binding) if defined?(Haml)
3
-
4
- Haml::Template.options[:format] = :html5