Skip to content

Commit ae73423

Browse files
author
Ruslan Korolev
committed
rake task visible to rails app
1 parent 424475e commit ae73423

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
namespace :haml do
2+
3+
desc 'Convert html.erb to html.haml each file in app/views'
24
task :erb_2_haml do
35

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

0 commit comments

Comments
 (0)