From 8d62787cecfc4e1ca4eec311850484ca0e06f304 Mon Sep 17 00:00:00 2001 From: Rick Carlino Date: Sat, 6 Jun 2020 15:20:14 -0500 Subject: [PATCH] Fix problem with "string" keys. --- README.md | 1 + lib/pigeon/draft.rb | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c7717b7..e1992c6 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ See `kitchen_sink.sh` examples. # Current Status + - [ ] CLI is wrapping `FILE.` and `FEED.` multihahshes in "string quotes". Why? - [ ] Update Dev docs in protocol spec to reflect changes to `lipmaa` header. - [ ] Update spec document CLI usage examples to reflect API changes in 2020. - [ ] 100% class / module documentation diff --git a/lib/pigeon/draft.rb b/lib/pigeon/draft.rb index 2f3d4af..8a00982 100644 --- a/lib/pigeon/draft.rb +++ b/lib/pigeon/draft.rb @@ -22,12 +22,11 @@ module Pigeon def []=(key, value) raise STRING_KEYS_ONLY unless key.is_a?(String) - case value[0..4] - when BLOB_SIGIL, MESSAGE_SIGIL, IDENTITY_SIGIL, STRING_SIGIL + when BLOB_SIGIL, MESSAGE_SIGIL, IDENTITY_SIGIL body[key] = value else - body[key] = value.inspect + body[key] = value.start_with?(STRING_SIGIL) ? value : value.inspect end end