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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d104da8dfd738e452eae411c79c12e2155ea7336
4
- data.tar.gz: 8299426d2060115b603a6c1d361a478395bdbbd3
3
+ metadata.gz: 027d0dd35c5fc2dd4713c4d9c25b074ba35d882c
4
+ data.tar.gz: e79ef52e92ac4f0005bf03e719e1d14cc28fc9f5
5
5
  SHA512:
6
- metadata.gz: 9cb0a4d432c6a6ecac4166201f58fbcf12df47329c0cf9ec75b7614c90b6cc08b358b1b96e9528b7fba7ea12a93cd2f94c98528166867a270e3e68178c2c9b5e
7
- data.tar.gz: 1a5daff07d4dd274f3d9cba41542f742e89d1ffa37142b65d8d7f67380b42167d22713cf30d2fe08439eec959833411036b05acdcc27da5b5ebaa9f60385a340
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.6.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.22)
11
- minitest (4.7.1)
12
- rake (10.0.4)
13
- rest (2.6.0)
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.4)
19
+ test-unit (2.5.5)
18
20
 
19
21
  PLATFORMS
20
22
  ruby
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  module IronCore
2
- VERSION = "0.6.2"
2
+ VERSION = "1.0.0"
3
3
 
4
4
  def self.version
5
5
  VERSION
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.6.2
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-05-08 00:00:00.000000000 Z
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: