Title: Only subset of YAML supported and raises on encrypt `no implicit conversion of Hash into Integer (TypeError)` · Issue #122 · diffcrypt/diffcrypt-ruby · GitHub
Open Graph Title: Only subset of YAML supported and raises on encrypt `no implicit conversion of Hash into Integer (TypeError)` · Issue #122 · diffcrypt/diffcrypt-ruby
X Title: Only subset of YAML supported and raises on encrypt `no implicit conversion of Hash into Integer (TypeError)` · Issue #122 · diffcrypt/diffcrypt-ruby
Description: Problem When calling encrypt with some YAML it raises. This means only a subset of YAML is supported, but the file I am trying to encrypt has a structure like this: list: - item: 1 details: detail1 - item: 2 details: detail2 The exceptio...
Open Graph Description: Problem When calling encrypt with some YAML it raises. This means only a subset of YAML is supported, but the file I am trying to encrypt has a structure like this: list: - item: 1 details: detail1...
X Description: Problem When calling encrypt with some YAML it raises. This means only a subset of YAML is supported, but the file I am trying to encrypt has a structure like this: list: - item: 1 details: detail1...
Opengraph URL: https://github.com/diffcrypt/diffcrypt-ruby/issues/122
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Only subset of YAML supported and raises on encrypt `no implicit conversion of Hash into Integer (TypeError)`","articleBody":"## Problem\r\n\r\nWhen calling `encrypt` with some YAML it raises. This means only a subset of YAML is supported, but the file I am trying to encrypt has a structure like this:\r\n\r\n```yaml\r\nlist:\r\n -\r\n item: 1\r\n details: detail1\r\n -\r\n item: 2\r\n details: detail2\r\n```\r\n\r\nThe exception raised is:\r\n```\r\n/ruby/3.0.2/lib/ruby/gems/3.0.0/gems/diffcrypt-0.6.1/lib/diffcrypt/encryptor.rb:84:in `[]=': no implicit conversion of Hash into Integer (TypeError)\r\n\tfrom /ruby/3.0.2/lib/ruby/gems/3.0.0/gems/diffcrypt-0.6.1/lib/diffcrypt/encryptor.rb:84:in `block in encrypt_values'\r\n\tfrom /ruby/3.0.2/lib/ruby/gems/3.0.0/gems/diffcrypt-0.6.1/lib/diffcrypt/encryptor.rb:80:in `each'\r\n\tfrom /ruby/3.0.2/lib/ruby/gems/3.0.0/gems/diffcrypt-0.6.1/lib/diffcrypt/encryptor.rb:80:in `encrypt_values'\r\n\tfrom /ruby/3.0.2/lib/ruby/gems/3.0.0/gems/diffcrypt-0.6.1/lib/diffcrypt/encryptor.rb:85:in `block in encrypt_values'\r\n\tfrom /ruby/3.0.2/lib/ruby/gems/3.0.0/gems/diffcrypt-0.6.1/lib/diffcrypt/encryptor.rb:80:in `each'\r\n\tfrom /ruby/3.0.2/lib/ruby/gems/3.0.0/gems/diffcrypt-0.6.1/lib/diffcrypt/encryptor.rb:80:in `encrypt_values'\r\n\tfrom /ruby/3.0.2/lib/ruby/gems/3.0.0/gems/diffcrypt-0.6.1/lib/diffcrypt/encryptor.rb:65:in `encrypt_data'\r\n\tfrom /ruby/3.0.2/lib/ruby/gems/3.0.0/gems/diffcrypt-0.6.1/lib/diffcrypt/encryptor.rb:51:in `encrypt'\r\n```\r\n\r\nWith this debug call stack information:\r\n```\r\nencrypt_values(data={\"list\"=\u003e[{\"item\"=\u003e1, \"details\"=\u003e\"detail1\"}, {\"item\"=\u003e2, \"details\"=\u003e\"detail2\"}]}, original_data=)\r\n data[list] = [{\"item\"=\u003e1, \"details\"=\u003e\"detail1\"}, {\"item\"=\u003e2, \"details\"=\u003e\"detail2\"}] (Array)\r\nencrypt_values(data=[{\"item\"=\u003e1, \"details\"=\u003e\"detail1\"}, {\"item\"=\u003e2, \"details\"=\u003e\"detail2\"}], original_data=)\r\n data[{\"item\"=\u003e1, \"details\"=\u003e\"detail1\"}] = nil (NilClass)\r\n```\r\n\r\n## Reproduction\r\n\r\n```ruby\r\nrequire \"diffcrypt\"\r\nkey = \"a5c51953b9c43c3f0e1dff3d5761c7d0000aefd85903d428e01bdb6d5916dc01\"\r\ntext = \"list:\\n -\\n item: 1\\n details: detail1\\n -\\n item: 2\\n details: detail2\\n\"\r\nencryptor = Diffcrypt::Encryptor.new(key)\r\nencryptor.encrypt(text)\r\n```","author":{"url":"https://github.com/kmcphillips","@type":"Person","name":"kmcphillips"},"datePublished":"2022-11-03T13:50:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/122/diffcrypt-ruby/issues/122"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5d2be4b8-cdb8-50a1-6ae9-96c8ad82231d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E544:D4C17:1016E06:14DFC4B:69802A51 |
| html-safe-nonce | ef83c155336f3d50df9e5beb3d058fc27e0601380c88b87f2e73ce15b082c920 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTQ0OkQ0QzE3OjEwMTZFMDY6MTRERkM0Qjo2OTgwMkE1MSIsInZpc2l0b3JfaWQiOiIxNjY5MTg5NDAwMTI4Mzk5OTUzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 284907d8b5988391bf26c6b475d6ca9d78e08e16143f1431c13d21bfab0ade8f |
| hovercard-subject-tag | issue:1434698142 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/diffcrypt/diffcrypt-ruby/122/issue_layout |
| twitter:image | https://opengraph.githubassets.com/83a3efb86bd758cac42374bebc43b2ffe928bd03ad84a1138f048c4bc83c6645/diffcrypt/diffcrypt-ruby/issues/122 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/83a3efb86bd758cac42374bebc43b2ffe928bd03ad84a1138f048c4bc83c6645/diffcrypt/diffcrypt-ruby/issues/122 |
| og:image:alt | Problem When calling encrypt with some YAML it raises. This means only a subset of YAML is supported, but the file I am trying to encrypt has a structure like this: list: - item: 1 details: detail1... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kmcphillips |
| hostname | github.com |
| expected-hostname | github.com |
| None | 60279d4097367e16897439d16d6bbe4180663db828c666eeed2656988ffe59f6 |
| turbo-cache-control | no-preview |
| go-import | github.com/diffcrypt/diffcrypt-ruby git https://github.com/diffcrypt/diffcrypt-ruby.git |
| octolytics-dimension-user_id | 77545058 |
| octolytics-dimension-user_login | diffcrypt |
| octolytics-dimension-repository_id | 275567034 |
| octolytics-dimension-repository_nwo | diffcrypt/diffcrypt-ruby |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 275567034 |
| octolytics-dimension-repository_network_root_nwo | diffcrypt/diffcrypt-ruby |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7c85641c598ad130c74f7bcc27f58575cac69551 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width