transit-ruby 0.8.567 → 0.8.569

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: fe3de1c0cb0b40c993517350d09d3cbeafd65671
4
- data.tar.gz: 4c7d0f451d76ff25a5d5b34eae1ec4a910132db0
3
+ metadata.gz: 9aa135b3c83c542508b02a2b31d61f817762e2cb
4
+ data.tar.gz: 639d6dee946974d8d76b10194e81222321074162
5
5
  SHA512:
6
- metadata.gz: 355faa7d96d7bc98a696950ffef72930f626f5d104ff692aef5a751d604dff7725da864e5629929a2e3fe597989c34dae3c9332a48376b344f558cfb39736a9b
7
- data.tar.gz: 9a3544ffe4f173d17cefbedd5f4391a60fc165a0095f51536bae003b0866ca66b11d7a4251c9529c2966738ebeb6e8bf01fc2002ec3a5005cd9f55713b7fb409
6
+ metadata.gz: 489d162a2452d4058ae3aad448f11058dad17c6ef3fd825265f676b66ff0242ce7895d5c4b81f24eac3a59b0b5e305e49cb7b73f8cfa36f784449cba405bf811
7
+ data.tar.gz: bd2cfcdfcff3bc4ae49ac312fb1926bd1a81258ebc53730a3e0617d5c428c8639ff0cc6ba04b975cdeaae1cc7d567f3ce1012b8e0114fc57a8667aa93fc59f8b
data/README.md CHANGED
@@ -75,7 +75,6 @@ abc
75
75
  Implement `tag`, `rep(obj)` and `string_rep(obj)` methods. For example:
76
76
 
77
77
  ```ruby
78
- require 'ostruct'
79
78
  Point = Struct.new(:x,:y) do
80
79
  def to_a; [x,y] end
81
80
  end
@@ -67,8 +67,15 @@ module Transit
67
67
  Base64.encode64(@value)
68
68
  end
69
69
 
70
+ # For human-readable display only. Use value() for programmatic
71
+ # consumption of the decoded value.
72
+ #
73
+ # Forces the platform's default external encoding, which is
74
+ # potentially lossy, but also guarantees that something will be
75
+ # printed instead of raising an error when there is no encoding
76
+ # information provided.
70
77
  def to_s
71
- @value
78
+ @value.dup.force_encoding(Encoding.default_external)
72
79
  end
73
80
  end
74
81
 
@@ -133,4 +133,12 @@ module Transit
133
133
  assert { Link.new("/path", "the-rel").to_h.frozen? }
134
134
  end
135
135
  end
136
+
137
+ describe ByteArray do
138
+ it 'uses the default_external encoding for to_s' do
139
+ src = ByteArray.new("foo".force_encoding("ascii")).to_base64
140
+ target = ByteArray.from_base64(src)
141
+ assert { target.to_s.encoding == Encoding.default_external }
142
+ end
143
+ end
136
144
  end
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.567
4
+ version: 0.8.569
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-10-23 00:00:00.000000000 Z
13
+ date: 2014-12-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: oj
@@ -195,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
195
195
  version: '0'
196
196
  requirements: []
197
197
  rubyforge_project:
198
- rubygems_version: 2.3.0
198
+ rubygems_version: 2.2.2
199
199
  signing_key:
200
200
  specification_version: 4
201
201
  summary: Transit marshalling for Ruby