sawyer 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b8d6739744f9370d824be0539484471d4bf1e86
4
- data.tar.gz: cfd655d0df2b5d13392a8e552440bcc70a219b54
3
+ metadata.gz: ea76751fcf6274b2f73f762bf677f0cce3853f66
4
+ data.tar.gz: d38ab2bdb51b5444cdec30b6091679cd67f805d2
5
5
  SHA512:
6
- metadata.gz: 4b47d791dd1cebfc7afcce9912b7e47eae29d0410e4afd2ea4ce1e676e52a1ae5072f2eae4f4721f66588d09422b74d9c18eeb025332ceb8dd2a4d0c9c38a776
7
- data.tar.gz: 1091cf3a6072a334e806febaea04fa66d520c54a754b9e230cfb233b69c7cd1b6da682f6703a19eaff9b95f49a364d9093558651ea2ac0a57e3ae1548e3a3045
6
+ metadata.gz: 6ea0e68b367d3cfe2f5d77501f4f6b26f8f246a5b04205ccb7a5e2c3a514f48b7880f3aed7829c8169a7984affbe1afa08d93b05e0d8e282d7b41c57562ca46e
7
+ data.tar.gz: cd211dfe87d81e4f4acfea027d904c1a11e2b03a10e2732e2abb7156f4568bfc8b57368e035556647f8ca2cbe79f31d8f59e50258432cbbba09442e2cfbd6abb
@@ -1,5 +1,5 @@
1
1
  module Sawyer
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.3"
3
3
 
4
4
  class Error < StandardError; end
5
5
  end
@@ -147,5 +147,12 @@ module Sawyer
147
147
  [:@endpoint]
148
148
  end
149
149
 
150
+ def marshal_dump
151
+ [@endpoint]
152
+ end
153
+
154
+ def marshal_load(dumped)
155
+ @endpoint = *dumped.shift(1)
156
+ end
150
157
  end
151
158
  end
@@ -18,7 +18,7 @@ module Sawyer
18
18
  @attrs = {}
19
19
  data.each do |key, value|
20
20
  @_fields << key
21
- @attrs[key.to_sym] = process_value(value)
21
+ @attrs[key.to_sym] = process_value(value)
22
22
  end
23
23
  @_metaclass.send(:attr_accessor, *data.keys)
24
24
  end
@@ -120,6 +120,13 @@ module Sawyer
120
120
  [:@attrs, :@_fields, :@_rels]
121
121
  end
122
122
 
123
+ def marshal_dump
124
+ [@attrs, @_fields, @_rels]
125
+ end
126
+
127
+ def marshal_load(dumped)
128
+ @attrs, @_fields, @_rels = *dumped.shift(3)
129
+ end
123
130
  end
124
131
  end
125
132
 
@@ -0,0 +1,5 @@
1
+ #!/bin/sh
2
+
3
+ set -e
4
+
5
+ bundle install --quiet "$@"
@@ -2,4 +2,5 @@
2
2
  # Usage: script/test
3
3
  # Runs the library's test suite.
4
4
 
5
+ script/bootstrap
5
6
  bundle exec rake test
@@ -169,6 +169,13 @@ module Sawyer
169
169
  YAML.load(YAML.dump(res))
170
170
  end
171
171
  end
172
+
173
+ def test_handle_marshal_dump_and_load
174
+ assert_nothing_raised do
175
+ res = Agent.new 'http://example.com', :a => 1
176
+ Marshal.load(Marshal.dump(res))
177
+ end
178
+ end
172
179
  end
173
180
  end
174
181
 
@@ -157,5 +157,12 @@ module Sawyer
157
157
  YAML.dump(res)
158
158
  end
159
159
  end
160
+
161
+ def test_handle_marshal_dump
162
+ assert_nothing_raised do
163
+ res = Resource.new @agent, :a => 1
164
+ Marshal.dump(res)
165
+ end
166
+ end
160
167
  end
161
168
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sawyer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rick Olson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-19 00:00:00.000000000 Z
12
+ date: 2014-01-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -69,6 +69,7 @@ files:
69
69
  - test/relation_test.rb
70
70
  - test/resource_test.rb
71
71
  - test/response_test.rb
72
+ - script/bootstrap
72
73
  - script/console
73
74
  - script/package
74
75
  - script/release