diff options
author | murphy <murphy@rubychan.de> | 2009-04-14 01:41:13 +0000 |
---|---|---|
committer | murphy <murphy@rubychan.de> | 2009-04-14 01:41:13 +0000 |
commit | d0e95e2cb7e1d7336a850178bb27ab98bc5b4ef0 (patch) | |
tree | 2ddd8d47635cb2fd3606f271090d29deba4d051b /rake_tasks/generator.rake | |
parent | d6d19bb78824977a2a95751e7c6aeaa5996ea807 (diff) | |
download | coderay-d0e95e2cb7e1d7336a850178bb27ab98bc5b4ef0.tar.gz |
Fixed generate:scanner task; it now also sets the file_extension.
For example, to create a stub for the Python Scanner, I can use:
rake generate:scanner NAME=python BASE=c EXT=py
Diffstat (limited to 'rake_tasks/generator.rake')
-rw-r--r-- | rake_tasks/generator.rake | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/rake_tasks/generator.rake b/rake_tasks/generator.rake index 54050ca..a485907 100644 --- a/rake_tasks/generator.rake +++ b/rake_tasks/generator.rake @@ -25,7 +25,8 @@ namespace :generate do File.open(scanner_file, 'w') do |file| file.write base_scanner. sub(/class \w+ < Scanner/, "class #{class_name} < Scanner"). - sub!(/register_for :\w+/, "register_for :#{lang}") + sub(/register_for :\w+/, "register_for :#{lang}"). + sub(/file_extension '\S+'/, "file_extension '#{ENV.fetch('EXT', lang).split(',').first}'") end test_dir = File.join(ROOT, 'test', 'scanners', lang) @@ -68,7 +69,7 @@ namespace :generate do *.expected.html *.debug.diff SVN_IGNORE - sh "svn pset svn:ignore 'svn_ignore' #{test_dir}" + sh "svn pset svn:ignore '#{svn_ignore}' #{test_dir}" end end end |