summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Scherer <gabriel.scherer@gmail.com>2020-12-24 23:04:23 +0100
committerGabriel Scherer <gabriel.scherer@gmail.com>2020-12-24 23:05:39 +0100
commit5293501d69cece2d40bfe89c51bfa522a55af932 (patch)
treec8a805c65584bf69370f02892866d9ca7565d9e9
parent83b0721610a4e11832e83df19c73ace3289972b9 (diff)
downloadmustache-spec-5293501d69cece2d40bfe89c51bfa522a55af932.tar.gz
Rakefile: ensure the ATTN warning is merged before the test data, not after
On my system (yaml gem version 0.1.0), `foo.merge(bar)` will include the keys of `foo` before the keys of `bar`, so the previous Rakebuild definition would include the ATTN warning *after* the test data in the rendered JSON files.
-rw-r--r--Rakefile3
1 files changed, 2 insertions, 1 deletions
diff --git a/Rakefile b/Rakefile
index 5254ce6..1bbcc72 100644
--- a/Rakefile
+++ b/Rakefile
@@ -19,8 +19,9 @@ namespace :build do
json_file = filename.gsub('.yml', '.json')
File.open(json_file, 'w') do |file|
+ warning = {:__ATTN__ => note}
doc = YAML.load_file(filename)
- file << doc.merge(:__ATTN__ => note).to_json()
+ file << warning.merge(doc).to_json()
end
end
end