diff options
Diffstat (limited to 'docs/build/node_modules/hogan.js/test/spec/Rakefile')
| -rw-r--r-- | docs/build/node_modules/hogan.js/test/spec/Rakefile | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/docs/build/node_modules/hogan.js/test/spec/Rakefile b/docs/build/node_modules/hogan.js/test/spec/Rakefile new file mode 100644 index 000000000..5254ce65a --- /dev/null +++ b/docs/build/node_modules/hogan.js/test/spec/Rakefile @@ -0,0 +1,27 @@ +require 'json' +require 'yaml' + +# Our custom YAML tags must retain their magic. +%w[ code ].each do |tag| + YAML::add_builtin_type(tag) { |_,val| val.merge(:__tag__ => tag) } +end + +desc 'Build all alternate versions of the specs.' +multitask :build => [ 'build:json' ] + +namespace :build do + note = 'Do not edit this file; changes belong in the appropriate YAML file.' + + desc 'Build JSON versions of the specs.' + task :json do + rm(Dir['specs/*.json'], :verbose => false) + Dir.glob('specs/*.yml').each do |filename| + json_file = filename.gsub('.yml', '.json') + + File.open(json_file, 'w') do |file| + doc = YAML.load_file(filename) + file << doc.merge(:__ATTN__ => note).to_json() + end + end + end +end |
