iron_core 0.6.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +8 -6
- data/lib/iron_core/client.rb +23 -0
- data/lib/iron_core/version.rb +1 -1
- 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: 027d0dd35c5fc2dd4713c4d9c25b074ba35d882c
|
4
|
+
data.tar.gz: e79ef52e92ac4f0005bf03e719e1d14cc28fc9f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 369f5f3f5f81fe87fa498fbcf7826011c0e85700584456f893b44594a3418b941464f0e5472a840877f15654ad26f846aa71a9c862dda8fc9012d679b4bb8866
|
7
|
+
data.tar.gz: ab39f3498b1bcde3c922c2b5886877f01fe0a4acb753068a32056e51b401f35d31f0c8b42c340f1ec89ba0d90bdc651030a7c362ea370b94926afb8e6884a794
|
data/Gemfile.lock
CHANGED
@@ -1,20 +1,22 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
iron_core (0.
|
4
|
+
iron_core (1.0.0)
|
5
5
|
rest (>= 2.2.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: http://rubygems.org/
|
9
9
|
specs:
|
10
|
-
mime-types (1.
|
11
|
-
minitest (
|
12
|
-
|
13
|
-
|
10
|
+
mime-types (1.23)
|
11
|
+
minitest (5.0.6)
|
12
|
+
net-http-persistent (2.9)
|
13
|
+
rake (10.1.0)
|
14
|
+
rest (2.6.3)
|
15
|
+
net-http-persistent
|
14
16
|
rest-client (>= 0.3.0)
|
15
17
|
rest-client (1.6.7)
|
16
18
|
mime-types (>= 1.16)
|
17
|
-
test-unit (2.5.
|
19
|
+
test-unit (2.5.5)
|
18
20
|
|
19
21
|
PLATFORMS
|
20
22
|
ruby
|
data/lib/iron_core/client.rb
CHANGED
@@ -225,6 +225,29 @@ module IronCore
|
|
225
225
|
@rest.post_file(base_url + method, request_hash)
|
226
226
|
end
|
227
227
|
|
228
|
+
def stream_get(method, params = {})
|
229
|
+
request_hash = {}
|
230
|
+
request_hash[:headers] = headers
|
231
|
+
request_hash[:params] = params
|
232
|
+
|
233
|
+
uri = url(method)
|
234
|
+
unless request_hash[:params].empty?
|
235
|
+
query_string = request_hash[:params].collect { |k, v| "#{k.to_s}=#{CGI::escape(v.to_s)}" }.join('&')
|
236
|
+
uri += "?#{query_string}"
|
237
|
+
end
|
238
|
+
|
239
|
+
IronCore::Logger.debug 'IronCore', "Streaming GET #{uri} with params='#{request_hash.to_s}'"
|
240
|
+
|
241
|
+
req = URI(uri)
|
242
|
+
Net::HTTP.start(req.hostname, req.port, use_ssl: req.scheme == 'https') do |http|
|
243
|
+
http.request_get(req, request_hash[:headers]) do |res|
|
244
|
+
res.read_body do |chunk|
|
245
|
+
yield(chunk)
|
246
|
+
end
|
247
|
+
end
|
248
|
+
end
|
249
|
+
end
|
250
|
+
|
228
251
|
def parse_response(response, parse_json = true)
|
229
252
|
IronCore::Logger.debug 'IronCore', "GOT #{response.code} with params='#{response.body}'"
|
230
253
|
|
data/lib/iron_core/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iron_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kirilenko
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-07-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest
|
@@ -111,3 +111,4 @@ signing_key:
|
|
111
111
|
specification_version: 4
|
112
112
|
summary: Core library for Iron products
|
113
113
|
test_files: []
|
114
|
+
has_rdoc:
|