Skip to content

Commit 54381b8

Browse files
committed
Merge pull request #83 from rusikf/patch-2
rake task visible to rails app Conflicts: lib/tasks/erb2haml.rake
2 parents 11e2bff + ae73423 commit 54381b8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/haml-rails.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ class Railtie < ::Rails::Railtie
5454
end
5555
end
5656
end
57+
58+
rake_tasks do
59+
load 'tasks/erb2haml.rake'
60+
end
5761
end
5862
end
5963
end

lib/tasks/erb2haml.rake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
namespace :haml do
2+
desc 'Convert html.erb to html.haml each file in app/views'
23
task :erb2haml do
34

4-
puts "This task will generate a .html.haml translation of each of the .html.erb files in app/views and its subdirectories."
5-
65
erb_files = Dir.glob('app/views/**/*.erb').select { |f| File.file? f}
76
haml_files = Dir.glob('app/views/**/*.haml').select { |f| File.file? f}
87

0 commit comments

Comments
 (0)