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 +4 -4
- data/lib/sawyer.rb +1 -1
- data/lib/sawyer/agent.rb +7 -0
- data/lib/sawyer/resource.rb +8 -1
- data/script/bootstrap +5 -0
- data/script/test +1 -0
- data/test/agent_test.rb +7 -0
- data/test/resource_test.rb +7 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea76751fcf6274b2f73f762bf677f0cce3853f66
|
4
|
+
data.tar.gz: d38ab2bdb51b5444cdec30b6091679cd67f805d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ea0e68b367d3cfe2f5d77501f4f6b26f8f246a5b04205ccb7a5e2c3a514f48b7880f3aed7829c8169a7984affbe1afa08d93b05e0d8e282d7b41c57562ca46e
|
7
|
+
data.tar.gz: cd211dfe87d81e4f4acfea027d904c1a11e2b03a10e2732e2abb7156f4568bfc8b57368e035556647f8ca2cbe79f31d8f59e50258432cbbba09442e2cfbd6abb
|
data/lib/sawyer.rb
CHANGED
data/lib/sawyer/agent.rb
CHANGED
data/lib/sawyer/resource.rb
CHANGED
@@ -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
|
|
data/script/bootstrap
ADDED
data/script/test
CHANGED
data/test/agent_test.rb
CHANGED
@@ -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
|
|
data/test/resource_test.rb
CHANGED
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.
|
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:
|
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
|