Permalink
Browse files

Supporting .ruby, .yml and .yaml Extension in Rake Notes

  • Loading branch information...
1 parent 810af6f commit f43421cb65da635988f2bb5341d519c3c2748b74 @robertomiranda robertomiranda committed Mar 14, 2014
@@ -28,7 +28,7 @@ def self.register_extensions(*extensions, &block)
self.extensions[/\.(#{extensions.join("|")})$/] = block
end
- register_extensions("builder", "rb", "rake") { |tag| /#\s*(#{tag}):?\s*(.*)$/ }
+ register_extensions("builder", "rb", "rake", "yml", "yaml", "ruby") { |tag| /#\s*(#{tag}):?\s*(.*)$/ }
register_extensions("css", "js") { |tag| /\/\/\s*(#{tag}):?\s*(.*)$/ }
register_extensions("erb") { |tag| /<%\s*#\s*(#{tag}):?\s*(.*?)\s*%>/ }
@@ -24,6 +24,9 @@ def teardown
app_file "app/controllers/application_controller.rb", 1000.times.map { "" }.join("\n") << "# TODO: note in ruby"
app_file "lib/tasks/task.rake", "# TODO: note in rake"
app_file 'app/views/home/index.html.builder', '# TODO: note in builder'
+ app_file 'config/locales/en.yml', '# TODO: note in yml'
+ app_file 'config/locales/en.yaml', '# TODO: note in yml'
+ app_file "app/views/home/index.ruby", "# TODO: note in ruby"
boot_rails
require 'rake'
@@ -42,8 +45,10 @@ def teardown
assert_match(/note in css/, output)
assert_match(/note in rake/, output)
assert_match(/note in builder/, output)
+ assert_match(/note in yml/, output)
+ assert_match(/note in yaml/, output)
- assert_equal 6, lines.size
+ assert_equal 9, lines.size
lines.each do |line|
assert_equal 4, line[0].size

0 comments on commit f43421c

Please sign in to comment.