toon-fu 4.1.3 → 4.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +19 -0
  3. data/exe/toon +13 -0
  4. data/lib/toon_fu/version.rb +1 -1
  5. metadata +5 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4b2af3b4dc45618bf09ddc862816f4bd173efc0a127d7a4554bdbc475d7be869
4
- data.tar.gz: 502cc64707081cd0ba3a6b1b2577435fe0fc40716f4d7bca003ac61da65f407e
3
+ metadata.gz: 4a5a734c469d08f497c36883702683c8a1c7edc3245df9f886d5f6159ff26db1
4
+ data.tar.gz: 784178fff8819a4895e5252b8e356ffaddaceca1ff10d9d6067a73984d5ef8cc
5
5
  SHA512:
6
- metadata.gz: '094c5bdf3d7f30170e955878a90c688241dafd4bfbc198aeaba4797e774cca2eb7af28bae402b6cd45d206c8b48913c0b09204a1ddbdd503c2e9337e9ee79239'
7
- data.tar.gz: 88b2f6001a47e7c04eb0f86711ef1b4f8d0338e291bbc356bff66640c0135ce61c1d604c852a74196de0b2a5ee4c7b06932765e1121e5bf7e054956aaf591188
6
+ metadata.gz: 4acf57be096b69fa1c675a97efb59fe63db7b66234e649305f5cb1dafa319465fa3ffb235d2aa252dd714861476720a910b7859e6916dc6ba45584b1d75a886c
7
+ data.tar.gz: 3ba5aa86ccfae68c53da20cfaa66a31d3ddee6b5e57af7c72f3ef884d36be45fe485b234973cd6cef2b31d1751d482d1f36b20a9d5eff746f02ff486ccc997e3
data/README.md CHANGED
@@ -147,6 +147,23 @@ decoder = ToonFu::Decoder.new(indent_size: 4) # reuse for many documents
147
147
  decoder.decode(text)
148
148
  ```
149
149
 
150
+ ## On the command line
151
+
152
+ The gem installs a `toon` executable that encodes JSON on stdin — handy for reading a command's output in fewer tokens:
153
+
154
+ ```bash
155
+ $ gh api repos/ruby/ruby/pulls --jq '.[0] | {number, title}' | toon
156
+ number: 13579
157
+ title: Fix a typo
158
+ ```
159
+
160
+ Input it cannot encode is passed through unchanged, so putting it at the end of a pipe never costs you the output:
161
+
162
+ ```bash
163
+ $ git log --oneline -1 | toon
164
+ b08ea2d feat: ship a toon executable
165
+ ```
166
+
150
167
  ## Compared with other Ruby TOON gems
151
168
 
152
169
  The only one that passes every spec fixture: toon-fu passes all 179 encode and all 359 decode fixtures. The table compares encoding — the 154 encode fixtures that use default options, which every gem can run; none of the others reads TOON back.
@@ -186,6 +203,8 @@ The gem version tracks the TOON specification it implements:
186
203
  - `MAJOR.MINOR` is the spec version: `X.Y.Z` speaks TOON `X.Y`.
187
204
  - `PATCH` is the gem's own: fixes and improvements within the same dialect.
188
205
 
206
+ This release speaks `toon-spec: 4.1`.
207
+
189
208
  Pin the spec line with `gem "toon-fu", "~> X.Y.0"`: it takes our fixes and keeps you on the dialect you speak. The gem badge above shows the current release; the spec-drift badge turns red when a newer spec is released and toon-fu has not caught up yet.
190
209
 
191
210
  Release notes: [GitHub releases](https://github.com/hoblin/toon-fu/releases).
data/exe/toon ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "json"
5
+ require "toon_fu"
6
+
7
+ input = $stdin.read
8
+
9
+ puts(begin
10
+ ToonFu.encode(JSON.parse(input))
11
+ rescue
12
+ input
13
+ end)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ToonFu
4
- VERSION = "4.1.3"
4
+ VERSION = "4.1.4"
5
5
  end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toon-fu
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.3
4
+ version: 4.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yevhenii Hurin
8
- bindir: bin
8
+ bindir: exe
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies: []
@@ -16,12 +16,14 @@ description: 'Encodes Ruby hashes, arrays, dates and your own objects into TOON,
16
16
  an error so your data arrives complete.'
17
17
  email:
18
18
  - evgeny.gurin@gmail.com
19
- executables: []
19
+ executables:
20
+ - toon
20
21
  extensions: []
21
22
  extra_rdoc_files: []
22
23
  files:
23
24
  - LICENSE
24
25
  - README.md
26
+ - exe/toon
25
27
  - lib/toon-fu.rb
26
28
  - lib/toon_fu.rb
27
29
  - lib/toon_fu/decimal_literal.rb