rest-core 3.5.5 → 3.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 02a017ca6ef776af782e4e7c575858b0cb8f3703
4
- data.tar.gz: 8d29c4f87749dccb787c0134f6938a95fe57b733
3
+ metadata.gz: 22b1bd4e98e62b8b87bbe2021020e0fc3897d429
4
+ data.tar.gz: 15f1a45e675881ad5a2de3c10fd56ffd2d0837e3
5
5
  SHA512:
6
- metadata.gz: 0d6aad0bedad2f4b7a72a78ec984721515157508d20983425eb2f0354fad6cd092beaaa4d626ae4f1000339d248535d83b9b1da8568afe13adcdb5cf5064fe07
7
- data.tar.gz: 2b75fccd0ba262c7f8915217cd142dbcc85f49497a2fe7b40b5d84b3818b74dea0b0982ba8ab601fa6a044c83e346054edd7beab24a56f67766a5c688ad61942
6
+ metadata.gz: ecf7a1ec80da7bc369bd49985f5c43eac6c298050f7b2777790c170e2f80cf0062725320a41efe268605faaab212f34c84b662bd563195c561dfd900d25f92d4
7
+ data.tar.gz: d4203a3a72e2c511d4e0b0312942e9155dc5ef440c8e4de76ef45a8ee1e16660a69aad3c0b8e4d38cb5688d9926db466b193932b27999365b1d74138d3f30d2f
data/CHANGES.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # CHANGES
2
2
 
3
+ ## rest-core 3.5.6 -- 2015-07-23
4
+
5
+ ### Bugs fixed
6
+
7
+ * Removed changes shouldn't be made into JsonResponse. My bad.
8
+ I should `git stash` before making releases.
9
+
3
10
  ## rest-core 3.5.5 -- 2015-07-22
4
11
 
5
12
  ### Bugs fixed
@@ -28,16 +28,11 @@ class RestCore::JsonResponse
28
28
  end
29
29
 
30
30
  def process response
31
+ # StackExchange returns the problematic BOM! in UTF-8, so we need to
32
+ # strip it or it would break JSON parsers (i.e. yajl-ruby and json)
31
33
  body = response[RESPONSE_BODY].to_s.sub(/\A\xEF\xBB\xBF/, '')
32
- if response[HIJACK] && Json.respond_to?(:decode_from_io)
33
- response.merge(
34
- RESPONSE_SOCKET => Json.decode_from_io(response[RESPONSE_SOCKET]))
35
- else
36
- # StackExchange returns the problematic BOM! in UTF-8, so we need to
37
- # strip it or it would break JSON parsers (i.e. yajl-ruby and json)
38
- response.merge(RESPONSE_BODY => Json.decode("[#{body}]").first)
39
- # [this].first is not needed for yajl-ruby
40
- end
34
+ response.merge(RESPONSE_BODY => Json.decode("[#{body}]").first)
35
+ # [this].first is not needed for yajl-ruby
41
36
  rescue Json.const_get(:ParseError) => error
42
37
  fail(response, ParseError.new(error, body))
43
38
  end
@@ -23,7 +23,6 @@ module RestCore::Json
23
23
  def decode json
24
24
  Yajl::Parser.parse(json)
25
25
  end
26
- alias_method :decode_from_io, :decode
27
26
  end
28
27
 
29
28
  module Json
@@ -1,4 +1,4 @@
1
1
 
2
2
  module RestCore
3
- VERSION = '3.5.5'
3
+ VERSION = '3.5.6'
4
4
  end
data/rest-core.gemspec CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: rest-core 3.5.5 ruby lib
2
+ # stub: rest-core 3.5.6 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "rest-core"
6
- s.version = "3.5.5"
6
+ s.version = "3.5.6"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib"]
10
10
  s.authors = ["Lin Jen-Shin (godfat)"]
11
- s.date = "2015-07-22"
11
+ s.date = "2015-07-23"
12
12
  s.description = "Modular Ruby clients interface for REST APIs.\n\nThere has been an explosion in the number of REST APIs available today.\nTo address the need for a way to access these APIs easily and elegantly,\nwe have developed rest-core, which consists of composable middleware\nthat allows you to build a REST client for any REST API. Or in the case of\ncommon APIs such as Facebook, Github, and Twitter, you can simply use the\ndedicated clients provided by [rest-more][].\n\n[rest-more]: https://github.com/godfat/rest-more"
13
13
  s.email = ["godfat (XD) godfat.org"]
14
14
  s.files = [
@@ -2,33 +2,9 @@
2
2
  require 'rest-core/test'
3
3
 
4
4
  describe RC::ThreadPool do
5
- # would 'have the same pool for the same client' do
6
- # client = RC::Builder.client
7
- # pool = RC::ThreadPool[client]
8
- # RC::ThreadPool[client].object_id.should.eq pool.object_id
9
- # end
10
-
11
- would 'not waiting forever' do
12
- mutex = Mutex.new
13
- condv = ConditionVariable.new
14
- klass = Struct.new(:pool_size, :pool_idle_time).new(2, 10)
15
- pool = RC::ThreadPool[klass]
16
- pool.defer(mutex){mutex.synchronize{ condv.signal }} # populate one worker
17
- mutex.synchronize{ condv.wait(mutex) }
18
- called = []
19
- pool.defer(mutex) do
20
- sleep 1
21
- called << 0
22
- end
23
- pool.defer(mutex) do
24
- sleep 1
25
- called << 0
26
- pool.defer(mutex) do
27
- called << 1
28
- end
29
- end
30
- sleep 5
31
- p called
32
- ok
5
+ would 'have the same pool for the same client' do
6
+ client = RC::Builder.client
7
+ pool = RC::ThreadPool[client]
8
+ RC::ThreadPool[client].object_id.should.eq pool.object_id
33
9
  end
34
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rest-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.5
4
+ version: 3.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lin Jen-Shin (godfat)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-22 00:00:00.000000000 Z
11
+ date: 2015-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient