erb2haml 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +12 -0
- data/README.md +28 -18
- data/lib/erb2haml/railties/erb2haml.rake +3 -3
- data/lib/erb2haml/version.rb +1 -1
- metadata +9 -5
data/CHANGELOG.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# erb2html Changelog
|
2
|
+
|
3
|
+
## 0.1.4 / 2013-02-25
|
4
|
+
|
5
|
+
* Relaxed conversion condition so that all ERB view templates are
|
6
|
+
converted to Haml. not just the HTML ones.
|
7
|
+
* Rewrote README to improve readability.
|
8
|
+
* Updated gem summary and description to clarify purpose.
|
9
|
+
|
10
|
+
## 0.1.3 / 2013-02-25
|
11
|
+
|
12
|
+
* Merged pull request #3 to enable removal of ERB files after conversion.
|
data/README.md
CHANGED
@@ -1,26 +1,36 @@
|
|
1
|
-
erb2haml
|
2
|
-
========
|
3
|
-
**erb2haml** adds a simple rake task to your Rails app to converts all ERb HTML files in `APP_HOME/app/views/` to Haml.
|
1
|
+
# erb2haml
|
4
2
|
|
5
|
-
|
3
|
+
**erb2haml** gives your Rails app rake tasks to convert or replace all
|
4
|
+
ERB view templates to [Haml](http://haml.info/).
|
6
5
|
|
7
|
-
Getting Started
|
8
|
-
---------------
|
6
|
+
## Getting Started
|
9
7
|
|
10
|
-
|
8
|
+
### Enabling the rake tasks
|
11
9
|
|
12
|
-
|
13
|
-
|
14
|
-
...
|
15
|
-
gem "erb2haml" # Add this line
|
16
|
-
...
|
17
|
-
end
|
10
|
+
Add `gem "erb2haml"` to the development group in your `Gemfile`. You can
|
11
|
+
do this by adding the line
|
18
12
|
|
19
|
-
|
20
|
-
|
13
|
+
`gem "erb2haml", :group => :development`
|
14
|
+
|
15
|
+
_or_ if you prefer the block syntax
|
21
16
|
|
22
|
-
|
17
|
+
group :development do
|
18
|
+
# ...
|
19
|
+
gem "erb2haml" # Add this line
|
20
|
+
# ...
|
21
|
+
end
|
22
|
+
|
23
|
+
### ERB-to-Haml Template Conversion
|
24
|
+
|
25
|
+
After enabling the rake tasks, you can convert your ERB templates to
|
26
|
+
Haml in two ways, depending on whether you would like to keep the
|
27
|
+
original ERB templates or not.
|
28
|
+
|
29
|
+
| Keep the original ERBs? | Rake task to run |
|
30
|
+
| :---------------------: | ------------------------ |
|
31
|
+
| Yes | `rake haml:replace_erbs` |
|
32
|
+
| No | `rake haml:convert_erbs` |
|
33
|
+
|
34
|
+
## License
|
23
35
|
|
24
|
-
License
|
25
|
-
-------
|
26
36
|
Copyright (c) 2011-2013 David Leung and [contributors](https://github.com/dhl/erb2haml/contributors). See LICENSE for further details.
|
@@ -16,14 +16,14 @@ namespace :haml do
|
|
16
16
|
if `which html2haml`.empty?
|
17
17
|
puts "#{color "ERROR: ", RED_FG} Could not find " +
|
18
18
|
"#{color "html2haml", GREEN_FG} in your PATH. Aborting."
|
19
|
-
exit(false)
|
19
|
+
exit(false)
|
20
20
|
end
|
21
21
|
|
22
22
|
puts "Looking for #{color "ERB", GREEN_FG} files to convert to " +
|
23
23
|
"#{color("Haml", RED_FG)}..."
|
24
24
|
|
25
25
|
Find.find("app/views/") do |path|
|
26
|
-
if FileTest.file?(path) and path.downcase.match(/\.
|
26
|
+
if FileTest.file?(path) and path.downcase.match(/\.erb$/i)
|
27
27
|
haml_path = path.slice(0...-3)+"haml"
|
28
28
|
|
29
29
|
unless FileTest.exists?(haml_path)
|
@@ -53,7 +53,7 @@ namespace :haml do
|
|
53
53
|
"#{color("Haml", RED_FG)}..."
|
54
54
|
|
55
55
|
Find.find("app/views/") do |path|
|
56
|
-
if FileTest.file?(path) and path.downcase.match(/\.
|
56
|
+
if FileTest.file?(path) and path.downcase.match(/\.erb$/i)
|
57
57
|
haml_path = path.slice(0...-3)+"haml"
|
58
58
|
|
59
59
|
unless FileTest.exists?(haml_path)
|
data/lib/erb2haml/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: erb2haml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -59,13 +59,16 @@ dependencies:
|
|
59
59
|
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
|
-
description:
|
63
|
-
|
62
|
+
description: erb2haml gives Rails simple rake tasks to convert all ERB view templates
|
63
|
+
to Haml.
|
64
|
+
email:
|
65
|
+
- david@davidslab.com
|
64
66
|
executables: []
|
65
67
|
extensions: []
|
66
68
|
extra_rdoc_files:
|
67
69
|
- LICENSE
|
68
70
|
- README.md
|
71
|
+
- CHANGELOG.md
|
69
72
|
files:
|
70
73
|
- Gemfile
|
71
74
|
- Rakefile
|
@@ -75,7 +78,8 @@ files:
|
|
75
78
|
- lib/erb2haml.rb
|
76
79
|
- LICENSE
|
77
80
|
- README.md
|
78
|
-
|
81
|
+
- CHANGELOG.md
|
82
|
+
homepage: https://github.com/dhl/erb2haml
|
79
83
|
licenses: []
|
80
84
|
post_install_message:
|
81
85
|
rdoc_options: []
|
@@ -98,6 +102,6 @@ rubyforge_project:
|
|
98
102
|
rubygems_version: 1.8.23
|
99
103
|
signing_key:
|
100
104
|
specification_version: 3
|
101
|
-
summary:
|
105
|
+
summary: ERB to Haml view templates conversion for Rails.
|
102
106
|
test_files: []
|
103
107
|
has_rdoc:
|