haml-rails 0.5.3 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0de34ddf946841da774bd57f3302958800218790
4
- data.tar.gz: fed180c073e106ba9209f484eaf60797187f7641
3
+ metadata.gz: 1194c05de58e60e4b2efa587f17020b45665d8c0
4
+ data.tar.gz: ddaa9a2548583370eb6ea516efbd91c82c915ab6
5
5
  SHA512:
6
- metadata.gz: 4f8fa062c4f4bc44d6fe472d40f7b983bb9ee121c73d5417ab84b9a7270e470566e485fc364bf9dc9dcbbe78ab2af46bbc92d435aa74ea33d548b8bcccac95a3
7
- data.tar.gz: 2ad094c5345cffac1f576fa9edf93133145dab2ee15b2fc21caa3d1de04fda918670031e6e2b93aaa1740296b6e7304ed8bab5df331fbbf6e40821a93f161210
6
+ metadata.gz: 5600d4136bfd90a004d840eb21dd96c350746c01dacd707caccfc31af0cbbda8ba8921c1fa5730386e8891eee4036e570ca19d8f808ce5588e4b92da2e3d0805
7
+ data.tar.gz: 66e1ee8280f73770f5d70a41e780645d90fe65f22f6ad02abd141084791eaf5f711b9800c3cf2e34a6e32a50dcf54bd3f485e3e98686f4d4f621c317175ba9b6
@@ -1,16 +1,14 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.8.7
4
- - 1.9.2
5
3
  - 1.9.3
6
4
  - 2.0.0
5
+ - 2.1.0
6
+ - jruby-19mode
7
+ - rbx
7
8
  gemfile:
8
- - gemfiles/rails_3_1.gemfile
9
- - gemfiles/rails_3_2.gemfile
10
9
  - gemfiles/rails_4_0.gemfile
10
+ - gemfiles/rails_4_1.gemfile
11
11
  matrix:
12
12
  exclude:
13
- - rvm: 1.8.7
14
- gemfile: gemfiles/rails_4_0.gemfile
15
- - rvm: 1.9.2
16
- gemfile: gemfiles/rails_4_0.gemfile
13
+ - rvm: 1.9.3
14
+ gemfile: gemfiles/rails_4_1.gemfile
data/Appraisals CHANGED
@@ -1,11 +1,13 @@
1
- appraise "rails_3_1" do
2
- gem "rails", "~> 3.1.0"
3
- end
1
+ appraise "rails_4_0" do
2
+ gem "rails", "~> 4.0.1"
4
3
 
5
- appraise "rails_3_2" do
6
- gem "rails", "~> 3.2.0"
4
+ gem 'rubysl', '~> 2.0', platforms: :rbx
5
+ gem 'minitest', platforms: :rbx
7
6
  end
8
7
 
9
- appraise "rails_4_0" do
10
- gem "rails", "~> 4.0.1"
8
+ appraise "rails_4_1" do
9
+ gem "rails", "4.1.0.beta1"
10
+
11
+ gem 'rubysl', '~> 2.0', platforms: :rbx
12
+ gem 'minitest', platforms: :rbx
11
13
  end
data/Gemfile CHANGED
@@ -2,3 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in haml-rails.gemspec
4
4
  gemspec
5
+
6
+ gem 'rubysl', '~> 2.0', platforms: :rbx
7
+ gem 'minitest', platforms: :rbx
8
+ gem 'html2haml'
data/README.md CHANGED
@@ -1,6 +1,6 @@
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 4. 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
4
 
5
5
  To use it, add this line to your Gemfile:
6
6
 
@@ -13,6 +13,26 @@ This ensures that:
13
13
 
14
14
  Pretty fancy, eh? The modern world is just so amazing.
15
15
 
16
+ ### Converting Rails application layout file to haml format
17
+
18
+ Once Haml-rails is installed on the Rails application,
19
+ you can convert the erb layout file, `app/views/layouts/application.html.erb`
20
+ to `app/views/layouts/application.html.haml` using this command:
21
+
22
+ $ rails generate haml:application_layout convert
23
+
24
+ After the application layout file is converted successfully,
25
+ make sure to delete `app/views/layouts/application.html.erb`, so Rails can
26
+ start using `app/views/layouts/application.html.haml` instead.
27
+
28
+ ### Older versions of Rails
29
+
30
+ The current version of Haml-rails requires 4.0.1 or later.
31
+
32
+ Haml-rails version 0.4 is the last version to support Rails 3. To use it, add this line to your Gemfile:
33
+
34
+ gem "haml-rails", "~> 0.4.0"
35
+
16
36
  ### Contributors
17
37
 
18
38
  Haml generators originally from [rails3-generators](http://github.com/indirect/rails3-generators), and written by José Valim, André Arko, Paul Barry, Anuj Dutta, Louis T, and Chris Rhoden. Tests originally written by Louis T.
@@ -4,4 +4,7 @@ source "https://rubygems.org"
4
4
 
5
5
  gem "rails", "~> 4.0.1"
6
6
 
7
- gemspec :path=>"../"
7
+ gem 'rubysl', '~> 2.0', platforms: :rbx
8
+ gem 'minitest', platforms: :rbx
9
+
10
+ gemspec :path=>"../"
@@ -0,0 +1,10 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "4.1.0.beta1"
6
+
7
+ gem 'rubysl', '~> 2.0', platforms: :rbx
8
+ gem 'minitest', platforms: :rbx
9
+
10
+ gemspec :path=>"../"
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
9
9
  s.email = ["andre@arko.net"]
10
10
  s.homepage = "http://github.com/indirect/haml-rails"
11
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."
12
+ s.description = "Haml-rails provides Haml generators for Rails 4. 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
13
  s.licenses = ["MIT"]
14
14
 
15
15
  s.rubyforge_project = "haml-rails"
@@ -19,6 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.add_dependency "activesupport", [">= 4.0.1"]
20
20
  s.add_dependency "actionpack", [">= 4.0.1"]
21
21
  s.add_dependency "railties", [">= 4.0.1"]
22
+ s.add_dependency "html2haml", [">= 1.0.1"]
22
23
 
23
24
  s.add_development_dependency "rails", [">= 4.0.1"]
24
25
  s.add_development_dependency "bundler", "~> 1.2"
@@ -1,22 +1,24 @@
1
1
  %h1 Listing <%= plural_table_name %>
2
2
 
3
3
  %table
4
- %tr
4
+ %thead
5
+ %tr
5
6
  <% for attribute in attributes -%>
6
- %th <%= attribute.human_name %>
7
+ %th <%= attribute.human_name %>
7
8
  <% end -%>
8
- %th
9
- %th
10
- %th
11
-
12
- - @<%= plural_table_name %>.each do |<%= singular_table_name %>|
13
- %tr
9
+ %th
10
+ %th
11
+ %th
12
+
13
+ %tbody
14
+ - @<%= plural_table_name %>.each do |<%= singular_table_name %>|
15
+ %tr
14
16
  <% for attribute in attributes -%>
15
- %td= <%= singular_table_name %>.<%= attribute.name %>
17
+ %td= <%= singular_table_name %>.<%= attribute.name %>
16
18
  <% end -%>
17
- %td= link_to 'Show', <%= singular_table_name %>
18
- %td= link_to 'Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>)
19
- %td= link_to 'Destroy', <%= singular_table_name %>, :method => :delete, :data => { :confirm => 'Are you sure?' }
19
+ %td= link_to 'Show', <%= singular_table_name %>
20
+ %td= link_to 'Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>)
21
+ %td= link_to 'Destroy', <%= singular_table_name %>, :method => :delete, :data => { :confirm => 'Are you sure?' }
20
22
 
21
23
  %br
22
24
 
@@ -1,5 +1,6 @@
1
1
  require 'haml'
2
2
  require 'rails'
3
+ require 'haml/railtie'
3
4
 
4
5
  module Haml
5
6
  module Rails
@@ -1,5 +1,5 @@
1
1
  module Haml
2
2
  module Rails
3
- VERSION = "0.5.3"
3
+ VERSION = "0.6.0"
4
4
  end
5
5
  end
@@ -0,0 +1,31 @@
1
+ require 'rails'
2
+
3
+ module Haml
4
+ module Generators
5
+ class ApplicationLayoutGenerator < ::Rails::Generators::Base
6
+
7
+ # Converts existing application.html.erb to haml format,
8
+ # and creates app/views/layouts/application.html.haml
9
+ # with some error checking.
10
+ def convert
11
+ app_layout_from = ::Rails.root.join('app/views/layouts/application.html.erb')
12
+ app_layout_to = ::Rails.root.join('app/views/layouts/application.html.haml')
13
+
14
+ if File.exist?(app_layout_from)
15
+
16
+ if !File.exist?(app_layout_to)
17
+ `html2haml #{app_layout_from} #{app_layout_to}`
18
+ puts "Success! app/views/layouts/application.html.haml is created.\n" \
19
+ "Please remove the erb file: app/views/layouts/application.html.erb"
20
+ else
21
+ puts "Error! There is a file named app/views/layouts/application.html.haml already."
22
+ end
23
+ else
24
+ puts "Error! There is no file named app/views/layouts/application.html.erb."
25
+ end
26
+
27
+ end
28
+
29
+ end
30
+ end
31
+ end
@@ -1,5 +1,5 @@
1
1
  require 'rubygems'
2
- require 'test/unit'
2
+ require 'minitest/autorun'
3
3
  require 'rails/all'
4
4
  require 'rails/generators'
5
5
  require 'rails/generators/test_case'
metadata CHANGED
@@ -1,134 +1,148 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haml-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - André Arko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-20 00:00:00.000000000 Z
11
+ date: 2014-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: haml
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '3.1'
20
- - - <
20
+ - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '5.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - '>='
27
+ - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: '3.1'
30
- - - <
30
+ - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '5.0'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: activesupport
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - '>='
37
+ - - ">="
38
38
  - !ruby/object:Gem::Version
39
39
  version: 4.0.1
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - '>='
44
+ - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: 4.0.1
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: actionpack
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - '>='
51
+ - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: 4.0.1
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - '>='
58
+ - - ">="
59
59
  - !ruby/object:Gem::Version
60
60
  version: 4.0.1
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: railties
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - '>='
65
+ - - ">="
66
66
  - !ruby/object:Gem::Version
67
67
  version: 4.0.1
68
68
  type: :runtime
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - '>='
72
+ - - ">="
73
73
  - !ruby/object:Gem::Version
74
74
  version: 4.0.1
75
+ - !ruby/object:Gem::Dependency
76
+ name: html2haml
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: 1.0.1
82
+ type: :runtime
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: 1.0.1
75
89
  - !ruby/object:Gem::Dependency
76
90
  name: rails
77
91
  requirement: !ruby/object:Gem::Requirement
78
92
  requirements:
79
- - - '>='
93
+ - - ">="
80
94
  - !ruby/object:Gem::Version
81
95
  version: 4.0.1
82
96
  type: :development
83
97
  prerelease: false
84
98
  version_requirements: !ruby/object:Gem::Requirement
85
99
  requirements:
86
- - - '>='
100
+ - - ">="
87
101
  - !ruby/object:Gem::Version
88
102
  version: 4.0.1
89
103
  - !ruby/object:Gem::Dependency
90
104
  name: bundler
91
105
  requirement: !ruby/object:Gem::Requirement
92
106
  requirements:
93
- - - ~>
107
+ - - "~>"
94
108
  - !ruby/object:Gem::Version
95
109
  version: '1.2'
96
110
  type: :development
97
111
  prerelease: false
98
112
  version_requirements: !ruby/object:Gem::Requirement
99
113
  requirements:
100
- - - ~>
114
+ - - "~>"
101
115
  - !ruby/object:Gem::Version
102
116
  version: '1.2'
103
117
  - !ruby/object:Gem::Dependency
104
118
  name: rake
105
119
  requirement: !ruby/object:Gem::Requirement
106
120
  requirements:
107
- - - '>='
121
+ - - ">="
108
122
  - !ruby/object:Gem::Version
109
123
  version: '0'
110
124
  type: :development
111
125
  prerelease: false
112
126
  version_requirements: !ruby/object:Gem::Requirement
113
127
  requirements:
114
- - - '>='
128
+ - - ">="
115
129
  - !ruby/object:Gem::Version
116
130
  version: '0'
117
131
  - !ruby/object:Gem::Dependency
118
132
  name: appraisal
119
133
  requirement: !ruby/object:Gem::Requirement
120
134
  requirements:
121
- - - '>='
135
+ - - ">="
122
136
  - !ruby/object:Gem::Version
123
137
  version: 0.3.8
124
138
  type: :development
125
139
  prerelease: false
126
140
  version_requirements: !ruby/object:Gem::Requirement
127
141
  requirements:
128
- - - '>='
142
+ - - ">="
129
143
  - !ruby/object:Gem::Version
130
144
  version: 0.3.8
131
- description: Haml-rails provides Haml generators for Rails 3. It also enables Haml
145
+ description: Haml-rails provides Haml generators for Rails 4. It also enables Haml
132
146
  as the templating engine for you, so you don't have to screw around in your own
133
147
  application.rb when your Gemfile already clearly indicated what templating engine
134
148
  you have installed. Hurrah.
@@ -138,16 +152,15 @@ executables: []
138
152
  extensions: []
139
153
  extra_rdoc_files: []
140
154
  files:
141
- - .gitignore
142
- - .travis.yml
155
+ - ".gitignore"
156
+ - ".travis.yml"
143
157
  - Appraisals
144
158
  - Gemfile
145
159
  - LICENSE
146
160
  - README.md
147
161
  - Rakefile
148
- - gemfiles/rails_3_1.gemfile
149
- - gemfiles/rails_3_2.gemfile
150
162
  - gemfiles/rails_4_0.gemfile
163
+ - gemfiles/rails_4_1.gemfile
151
164
  - haml-rails.gemspec
152
165
  - lib/generators/haml/controller/controller_generator.rb
153
166
  - lib/generators/haml/controller/templates/view.html.haml
@@ -161,6 +174,7 @@ files:
161
174
  - lib/generators/haml/scaffold/templates/show.html.haml
162
175
  - lib/haml-rails.rb
163
176
  - lib/haml-rails/version.rb
177
+ - lib/rails/generators/haml/application_layout/application_layout_generator.rb
164
178
  - test/fixtures/routes.rb
165
179
  - test/lib/generators/haml/controller_generator_test.rb
166
180
  - test/lib/generators/haml/mailer_generator_test.rb
@@ -177,17 +191,17 @@ require_paths:
177
191
  - lib
178
192
  required_ruby_version: !ruby/object:Gem::Requirement
179
193
  requirements:
180
- - - '>='
194
+ - - ">="
181
195
  - !ruby/object:Gem::Version
182
196
  version: '0'
183
197
  required_rubygems_version: !ruby/object:Gem::Requirement
184
198
  requirements:
185
- - - '>='
199
+ - - ">="
186
200
  - !ruby/object:Gem::Version
187
201
  version: 1.3.6
188
202
  requirements: []
189
203
  rubyforge_project: haml-rails
190
- rubygems_version: 2.1.9
204
+ rubygems_version: 2.2.2
191
205
  signing_key:
192
206
  specification_version: 4
193
207
  summary: let your Gemfile do the configuring
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 3.1.0"
6
-
7
- gemspec :path=>"../"
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 3.2.0"
6
-
7
- gemspec :path=>"../"