elibri_api_client 1.1.15 → 1.1.16

Sign up to get free protection for your applications and to get access to all the features.
@@ -63,16 +63,18 @@ module Elibri
63
63
  # publishers -> array
64
64
  #
65
65
  def publishers
66
- resp = get '/publishers'
66
+ get_publishers_from_url('/publishers')
67
+ end
67
68
 
68
- Array.new.tap do |publishers|
69
- resp.parsed_response.css('publisher').each do |publisher_xml|
70
- publisher = Elibri::ApiClient::ApiAdapters::V1::Publisher.build_from_xml(self, publisher_xml)
71
- publishers << publisher
72
- end
73
- end
69
+ def pdw_publishers
70
+ get_publishers_from_url('/publishers/pdw')
74
71
  end
75
72
 
73
+ def olesiejuk_publishers
74
+ get_publishers_from_url('/publishers/olesiejuk')
75
+ end
76
+
77
+
76
78
  def remove_from_queue(queue_name, record_reference)
77
79
  resp = post "/queues/#{queue_name}/remove/#{record_reference}", :body => ' '
78
80
  return true
@@ -156,6 +158,17 @@ module Elibri
156
158
  @host_uri + URI_PREFIX
157
159
  end
158
160
 
161
+ def get_publishers_from_url(url)
162
+ resp = get(url)
163
+
164
+ Array.new.tap do |publishers|
165
+ resp.parsed_response.css('publisher').each do |publisher_xml|
166
+ publisher = Elibri::ApiClient::ApiAdapters::V1::Publisher.build_from_xml(self, publisher_xml)
167
+ publishers << publisher
168
+ end
169
+ end
170
+ end
171
+
159
172
 
160
173
  def get(request_uri, options = {})
161
174
  options.merge!({:digest_auth => @auth})
@@ -2,7 +2,7 @@ module Elibri
2
2
  class ApiClient
3
3
  z = $VERBOSE
4
4
  $VERBOSE = nil
5
- VERSION = "1.1.15"
5
+ VERSION = "1.1.16"
6
6
  Version = VERSION
7
7
  $VERBOSE = z
8
8
  end
@@ -45,7 +45,8 @@ module Elibri
45
45
 
46
46
  # Metody API delegujemy do odpowiedniego adaptera:
47
47
  def_delegators :@api_adapter, :refill_all_queues!, :pending_data?, :pending_queues, :publishers, :last_pop_from_queue, :pop_from_queue,
48
- :remove_from_queue, :onix_xml_for_product, :get_product, :add_to_queue, :get_onix_message_with_product
48
+ :remove_from_queue, :onix_xml_for_product, :get_product, :add_to_queue, :get_onix_message_with_product,
49
+ :pdw_publishers, :olesiejuk_publishers
49
50
 
50
51
  end
51
52
  end
metadata CHANGED
@@ -1,8 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elibri_api_client
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 51
4
5
  prerelease:
5
- version: 1.1.15
6
+ segments:
7
+ - 1
8
+ - 1
9
+ - 16
10
+ version: 1.1.16
6
11
  platform: ruby
7
12
  authors:
8
13
  - "Marcin Urba\xC5\x84ski"
@@ -10,7 +15,8 @@ autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
17
 
13
- date: 2011-12-19 00:00:00 Z
18
+ date: 2011-12-19 00:00:00 +01:00
19
+ default_executable:
14
20
  dependencies:
15
21
  - !ruby/object:Gem::Dependency
16
22
  name: httparty
@@ -20,6 +26,11 @@ dependencies:
20
26
  requirements:
21
27
  - - ">="
22
28
  - !ruby/object:Gem::Version
29
+ hash: 61
30
+ segments:
31
+ - 0
32
+ - 8
33
+ - 1
23
34
  version: 0.8.1
24
35
  type: :runtime
25
36
  version_requirements: *id001
@@ -31,6 +42,11 @@ dependencies:
31
42
  requirements:
32
43
  - - ~>
33
44
  - !ruby/object:Gem::Version
45
+ hash: 3
46
+ segments:
47
+ - 1
48
+ - 5
49
+ - 0
34
50
  version: 1.5.0
35
51
  type: :runtime
36
52
  version_requirements: *id002
@@ -42,6 +58,11 @@ dependencies:
42
58
  requirements:
43
59
  - - ">="
44
60
  - !ruby/object:Gem::Version
61
+ hash: 9
62
+ segments:
63
+ - 2
64
+ - 3
65
+ - 5
45
66
  version: 2.3.5
46
67
  type: :runtime
47
68
  version_requirements: *id003
@@ -53,6 +74,11 @@ dependencies:
53
74
  requirements:
54
75
  - - ">="
55
76
  - !ruby/object:Gem::Version
77
+ hash: 13
78
+ segments:
79
+ - 0
80
+ - 1
81
+ - 11
56
82
  version: 0.1.11
57
83
  type: :runtime
58
84
  version_requirements: *id004
@@ -64,6 +90,9 @@ dependencies:
64
90
  requirements:
65
91
  - - ">="
66
92
  - !ruby/object:Gem::Version
93
+ hash: 3
94
+ segments:
95
+ - 0
67
96
  version: "0"
68
97
  type: :development
69
98
  version_requirements: *id005
@@ -75,6 +104,9 @@ dependencies:
75
104
  requirements:
76
105
  - - ">="
77
106
  - !ruby/object:Gem::Version
107
+ hash: 3
108
+ segments:
109
+ - 0
78
110
  version: "0"
79
111
  type: :development
80
112
  version_requirements: *id006
@@ -86,6 +118,9 @@ dependencies:
86
118
  requirements:
87
119
  - - ">="
88
120
  - !ruby/object:Gem::Version
121
+ hash: 3
122
+ segments:
123
+ - 0
89
124
  version: "0"
90
125
  type: :development
91
126
  version_requirements: *id007
@@ -97,6 +132,9 @@ dependencies:
97
132
  requirements:
98
133
  - - ">="
99
134
  - !ruby/object:Gem::Version
135
+ hash: 3
136
+ segments:
137
+ - 0
100
138
  version: "0"
101
139
  type: :development
102
140
  version_requirements: *id008
@@ -108,6 +146,11 @@ dependencies:
108
146
  requirements:
109
147
  - - ~>
110
148
  - !ruby/object:Gem::Version
149
+ hash: 11
150
+ segments:
151
+ - 1
152
+ - 6
153
+ - 2
111
154
  version: 1.6.2
112
155
  type: :development
113
156
  version_requirements: *id009
@@ -119,6 +162,9 @@ dependencies:
119
162
  requirements:
120
163
  - - ">="
121
164
  - !ruby/object:Gem::Version
165
+ hash: 3
166
+ segments:
167
+ - 0
122
168
  version: "0"
123
169
  type: :development
124
170
  version_requirements: *id010
@@ -154,6 +200,7 @@ files:
154
200
  - test/elibri_api_v1_adapter_queue_test.rb
155
201
  - test/elibri_api_v1_adapter_test.rb
156
202
  - test/helper.rb
203
+ has_rdoc: true
157
204
  homepage: http://github.com/elibri/elibri_api_client
158
205
  licenses:
159
206
  - MIT
@@ -167,17 +214,23 @@ required_ruby_version: !ruby/object:Gem::Requirement
167
214
  requirements:
168
215
  - - ">="
169
216
  - !ruby/object:Gem::Version
217
+ hash: 3
218
+ segments:
219
+ - 0
170
220
  version: "0"
171
221
  required_rubygems_version: !ruby/object:Gem::Requirement
172
222
  none: false
173
223
  requirements:
174
224
  - - ">="
175
225
  - !ruby/object:Gem::Version
226
+ hash: 3
227
+ segments:
228
+ - 0
176
229
  version: "0"
177
230
  requirements: []
178
231
 
179
232
  rubyforge_project:
180
- rubygems_version: 1.8.23
233
+ rubygems_version: 1.5.2
181
234
  signing_key:
182
235
  specification_version: 3
183
236
  summary: API client for elibri.com.pl publishing system
@@ -189,4 +242,3 @@ test_files:
189
242
  - test/elibri_api_v1_adapter_queue_test.rb
190
243
  - test/elibri_api_v1_adapter_test.rb
191
244
  - test/helper.rb
192
- has_rdoc: