amiando 0.4.5 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +4 -0
- data/lib/amiando/sync.rb +14 -3
- data/lib/amiando/version.rb +1 -1
- data/test/amiando/sync_test.rb +3 -2
- metadata +105 -109
data/ChangeLog
CHANGED
data/lib/amiando/sync.rb
CHANGED
@@ -52,13 +52,16 @@ module Amiando
|
|
52
52
|
#
|
53
53
|
# You should use mainly 4 attributes:
|
54
54
|
#
|
55
|
-
# *
|
55
|
+
# * obj_type and returned_obj_type will allow you to know what kind
|
56
56
|
# of object you should be dealing with. Read through the official docs
|
57
57
|
# to know the difference between them.
|
58
|
-
# *
|
58
|
+
# * obj_id is the id of whichever object you're dealing with.
|
59
59
|
# * operation is what happened to that object. Typically 'create', 'delete'
|
60
60
|
# and 'update'. But beware the 'resync' one.
|
61
61
|
#
|
62
|
+
# Please note that the original api returns object_id, object_type and
|
63
|
+
# returned_object_type, but ruby 1.9 throws warnings if defining a method
|
64
|
+
# called object_id. All three have been ranemd for consistency.
|
62
65
|
class Event
|
63
66
|
include Attributes
|
64
67
|
|
@@ -66,9 +69,17 @@ module Amiando
|
|
66
69
|
set_attributes(hash)
|
67
70
|
end
|
68
71
|
|
69
|
-
def
|
72
|
+
def obj_id
|
70
73
|
attributes[:object_id]
|
71
74
|
end
|
75
|
+
|
76
|
+
def obj_type
|
77
|
+
attributes[:object_type]
|
78
|
+
end
|
79
|
+
|
80
|
+
def returned_obj_type
|
81
|
+
attributes[:returned_obj_type]
|
82
|
+
end
|
72
83
|
end
|
73
84
|
end
|
74
85
|
end
|
data/lib/amiando/version.rb
CHANGED
data/test/amiando/sync_test.rb
CHANGED
@@ -25,10 +25,11 @@ describe Amiando::Sync do
|
|
25
25
|
|
26
26
|
describe Amiando::Sync::Event do
|
27
27
|
it 'simply converts the given attributes' do
|
28
|
-
sync_event = Amiando::Sync::Event.new(:id => 1, :object_id => 12, :path => '/some/thing')
|
28
|
+
sync_event = Amiando::Sync::Event.new(:id => 1, :object_id => 12, :object_type => 'Event', :path => '/some/thing')
|
29
29
|
|
30
30
|
sync_event.id.must_equal 1
|
31
|
-
sync_event.
|
31
|
+
sync_event.obj_id.must_equal 12
|
32
|
+
sync_event.obj_type.must_equal 'Event'
|
32
33
|
sync_event.path.must_equal '/some/thing'
|
33
34
|
end
|
34
35
|
end
|
metadata
CHANGED
@@ -1,122 +1,121 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: amiando
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.5.0
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 4
|
9
|
-
- 5
|
10
|
-
version: 0.4.5
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Jorge Dias
|
14
9
|
- Albert Llop
|
15
10
|
autorequire:
|
16
11
|
bindir: bin
|
17
12
|
cert_chain: []
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
- !ruby/object:Gem::Dependency
|
22
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
23
|
-
none: false
|
24
|
-
requirements:
|
25
|
-
- - ">="
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
hash: 3
|
28
|
-
segments:
|
29
|
-
- 0
|
30
|
-
version: "0"
|
31
|
-
version_requirements: *id001
|
32
|
-
prerelease: false
|
33
|
-
type: :runtime
|
13
|
+
date: 2012-10-25 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
34
16
|
name: typhoeus
|
35
|
-
|
36
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
37
18
|
none: false
|
38
|
-
requirements:
|
39
|
-
- -
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
|
42
|
-
segments:
|
43
|
-
- 0
|
44
|
-
version: "0"
|
45
|
-
version_requirements: *id002
|
46
|
-
prerelease: false
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '0'
|
47
23
|
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ! '>='
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '0'
|
31
|
+
- !ruby/object:Gem::Dependency
|
48
32
|
name: multi_json
|
49
|
-
|
50
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
51
34
|
none: false
|
52
|
-
requirements:
|
53
|
-
- -
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
|
56
|
-
|
57
|
-
- 0
|
58
|
-
version: "0"
|
59
|
-
version_requirements: *id003
|
35
|
+
requirements:
|
36
|
+
- - ! '>='
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
type: :runtime
|
60
40
|
prerelease: false
|
61
|
-
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ! '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
62
48
|
name: hydra_cache
|
63
|
-
|
64
|
-
requirement: &id004 !ruby/object:Gem::Requirement
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
65
50
|
none: false
|
66
|
-
requirements:
|
67
|
-
- -
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
|
70
|
-
segments:
|
71
|
-
- 2
|
72
|
-
- 9
|
73
|
-
- 0
|
74
|
-
version: 2.9.0
|
75
|
-
version_requirements: *id004
|
76
|
-
prerelease: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
77
55
|
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
- !ruby/object:Gem::Dependency
|
78
64
|
name: minitest
|
79
|
-
|
80
|
-
requirement: &id005 !ruby/object:Gem::Requirement
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
81
66
|
none: false
|
82
|
-
requirements:
|
83
|
-
- -
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
|
86
|
-
segments:
|
87
|
-
- 1
|
88
|
-
- 7
|
89
|
-
- 9
|
90
|
-
version: 1.7.9
|
91
|
-
version_requirements: *id005
|
92
|
-
prerelease: false
|
67
|
+
requirements:
|
68
|
+
- - '='
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: 2.9.0
|
93
71
|
type: :development
|
72
|
+
prerelease: false
|
73
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - '='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: 2.9.0
|
79
|
+
- !ruby/object:Gem::Dependency
|
94
80
|
name: webmock
|
95
|
-
|
96
|
-
requirement: &id006 !ruby/object:Gem::Requirement
|
81
|
+
requirement: !ruby/object:Gem::Requirement
|
97
82
|
none: false
|
98
|
-
requirements:
|
99
|
-
- -
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
|
102
|
-
segments:
|
103
|
-
- 0
|
104
|
-
version: "0"
|
105
|
-
version_requirements: *id006
|
106
|
-
prerelease: false
|
83
|
+
requirements:
|
84
|
+
- - ~>
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: 1.7.9
|
107
87
|
type: :development
|
88
|
+
prerelease: false
|
89
|
+
version_requirements: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
91
|
+
requirements:
|
92
|
+
- - ~>
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: 1.7.9
|
95
|
+
- !ruby/object:Gem::Dependency
|
108
96
|
name: rake
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
98
|
+
none: false
|
99
|
+
requirements:
|
100
|
+
- - ! '>='
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
type: :development
|
104
|
+
prerelease: false
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
109
111
|
description: A ruby client for the amiando REST API with parallel requests in mind
|
110
|
-
email:
|
112
|
+
email:
|
111
113
|
- jorge@mrdias.com
|
112
114
|
- mrsimo@gmail.com
|
113
115
|
executables: []
|
114
|
-
|
115
116
|
extensions: []
|
116
|
-
|
117
117
|
extra_rdoc_files: []
|
118
|
-
|
119
|
-
files:
|
118
|
+
files:
|
120
119
|
- .gitignore
|
121
120
|
- .travis.yml
|
122
121
|
- ChangeLog
|
@@ -251,40 +250,37 @@ files:
|
|
251
250
|
- test/support/factory.rb
|
252
251
|
- test/support/hydra_monkey_patch.rb
|
253
252
|
- test/test_helper.rb
|
254
|
-
homepage:
|
253
|
+
homepage: ''
|
255
254
|
licenses: []
|
256
|
-
|
257
255
|
post_install_message:
|
258
256
|
rdoc_options: []
|
259
|
-
|
260
|
-
require_paths:
|
257
|
+
require_paths:
|
261
258
|
- lib
|
262
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
259
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
263
260
|
none: false
|
264
|
-
requirements:
|
265
|
-
- -
|
266
|
-
- !ruby/object:Gem::Version
|
267
|
-
|
268
|
-
segments:
|
261
|
+
requirements:
|
262
|
+
- - ! '>='
|
263
|
+
- !ruby/object:Gem::Version
|
264
|
+
version: '0'
|
265
|
+
segments:
|
269
266
|
- 0
|
270
|
-
|
271
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
267
|
+
hash: -3858998560713218769
|
268
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
272
269
|
none: false
|
273
|
-
requirements:
|
274
|
-
- -
|
275
|
-
- !ruby/object:Gem::Version
|
276
|
-
|
277
|
-
segments:
|
270
|
+
requirements:
|
271
|
+
- - ! '>='
|
272
|
+
- !ruby/object:Gem::Version
|
273
|
+
version: '0'
|
274
|
+
segments:
|
278
275
|
- 0
|
279
|
-
|
276
|
+
hash: -3858998560713218769
|
280
277
|
requirements: []
|
281
|
-
|
282
278
|
rubyforge_project: amiando
|
283
279
|
rubygems_version: 1.8.24
|
284
280
|
signing_key:
|
285
281
|
specification_version: 3
|
286
282
|
summary: A ruby client for the amiando REST API
|
287
|
-
test_files:
|
283
|
+
test_files:
|
288
284
|
- test/amiando/amiando_test.rb
|
289
285
|
- test/amiando/api_key_test.rb
|
290
286
|
- test/amiando/boolean_test.rb
|