transit-ruby 0.8.569 → 0.8.572

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9aa135b3c83c542508b02a2b31d61f817762e2cb
4
- data.tar.gz: 639d6dee946974d8d76b10194e81222321074162
3
+ metadata.gz: 5fbd02765bf5e56918772bd7f95227aaa3a93d2a
4
+ data.tar.gz: 6a4c50abf34ccb4b3b8a7968d3e0284041a5cb81
5
5
  SHA512:
6
- metadata.gz: 489d162a2452d4058ae3aad448f11058dad17c6ef3fd825265f676b66ff0242ce7895d5c4b81f24eac3a59b0b5e305e49cb7b73f8cfa36f784449cba405bf811
7
- data.tar.gz: bd2cfcdfcff3bc4ae49ac312fb1926bd1a81258ebc53730a3e0617d5c428c8639ff0cc6ba04b975cdeaae1cc7d567f3ce1012b8e0114fc57a8667aa93fc59f8b
6
+ metadata.gz: 86c8d24ffa6d87f8327fdb530b5a47e332eb81cbcb0dcf92debb145caef32ee03d259d9ad1dda826435fa125d55dcc505989eb5d30bb8c2b36ebd04290290695
7
+ data.tar.gz: 4b5198fda8bf5016cf94c2a8399a7be5786ba89b9b2a7c609c1fe81ebb15ef0ab505814defe2adf0c5d91e0f691a8fd653da58ecdc2d6549b2a61a7089b19c0b
data/CHANGELOG.md CHANGED
@@ -1,7 +1,18 @@
1
+ ### 0.8.569 / 2014-12-03
2
+
3
+ * ByteArray#to_s forces default encoding for platform
4
+ * fixes rare bug in which trying to print binary data nested within
5
+ decoded binary data raises an encoding incompatibility error.
6
+
7
+ ### 0.8.567 / 2014-09-21
8
+
9
+ * restore newline suppression when writing in json mode
10
+ * helpful error message when nested object has no handler
11
+
1
12
  ### 0.8.560 (java platform only) / 2014-09-12
2
13
 
3
14
  * Bump dependency on transit-java to 0.8.269
4
- ** fixes bug which turned an empty set into an array
15
+ * fixes bug which turned an empty set into an array
5
16
 
6
17
  ### 0.8.552 (java platform only) / 2014-09-12
7
18
 
@@ -78,14 +78,6 @@ module Transit
78
78
  as_map_key ? emit_string(ESC, "?", handler.string_rep(b), true, cache) : emit_value(b)
79
79
  end
80
80
 
81
- def emit_int(tag, i, as_map_key, cache)
82
- if as_map_key || i > @max_int || i < @min_int
83
- emit_string(ESC, tag, i, as_map_key, cache)
84
- else
85
- emit_value(i, as_map_key)
86
- end
87
- end
88
-
89
81
  def emit_double(d, as_map_key, cache)
90
82
  as_map_key ? emit_string(ESC, "d", d, true, cache) : emit_value(d)
91
83
  end
@@ -51,6 +51,14 @@ module Transit
51
51
  @oj.pop
52
52
  end
53
53
 
54
+ def emit_int(tag, i, as_map_key, cache)
55
+ if as_map_key || i > @max_int || i < @min_int
56
+ emit_string(ESC, tag, i, as_map_key, cache)
57
+ else
58
+ emit_value(i, as_map_key)
59
+ end
60
+ end
61
+
54
62
  def emit_value(obj, as_map_key=false)
55
63
  if @state.last == :array
56
64
  @oj.push_value(obj)
@@ -47,6 +47,14 @@ module Transit
47
47
  # no-op
48
48
  end
49
49
 
50
+ def emit_int(tag, i, as_map_key, cache)
51
+ if i > @max_int || i < @min_int
52
+ emit_string(ESC, tag, i, as_map_key, cache)
53
+ else
54
+ emit_value(i, as_map_key)
55
+ end
56
+ end
57
+
50
58
  def emit_value(obj, as_map_key=:ignore)
51
59
  @packer.write(obj)
52
60
  end
@@ -175,6 +175,11 @@ module Transit
175
175
  writer.write("this")
176
176
  assert { JSON.parse(io.string) == ["~#'", "this"] }
177
177
  end
178
+
179
+ it "writes an int map-key as an encoded string" do
180
+ writer.write({1 => :one})
181
+ assert { io.string =~ /~i1/ }
182
+ end
178
183
  end
179
184
 
180
185
  describe "JSON_VERBOSE" do
@@ -214,10 +219,15 @@ module Transit
214
219
  writer.write("this")
215
220
  assert { JSON.parse(io.string) == {"~#'" => "this"} }
216
221
  end
222
+
223
+ it "writes an int map-key as an encoded string" do
224
+ writer.write({1 => :one})
225
+ assert { io.string =~ /~i1/ }
226
+ end
217
227
  end
218
228
 
219
229
  # JRuby skips these 3 examples since they use raw massage pack
220
- # api. Also, JRuby doesn't hava good counterpart.
230
+ # api. Also, JRuby doesn't have good counterpart.
221
231
  describe "MESSAGE_PACK", :unless => Transit::jruby? do
222
232
  let(:writer) { Writer.new(:msgpack, io) }
223
233
 
@@ -235,6 +245,11 @@ module Transit
235
245
  writer.write("this")
236
246
  assert { MessagePack::Unpacker.new(StringIO.new(io.string)).read == ["~#'", "this"] }
237
247
  end
248
+
249
+ it "writes an int map-key as an int" do
250
+ writer.write({1 => :one})
251
+ assert { io.string.each_char.drop(1).first == "\u0001" }
252
+ end
238
253
  end
239
254
 
240
255
  describe "ints" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transit-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.569
4
+ version: 0.8.572
5
5
  platform: ruby
6
6
  authors:
7
7
  - Russ Olsen
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-12-03 00:00:00.000000000 Z
13
+ date: 2015-01-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: oj