gh 0.13.3 → 0.14.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: 9f27136f8c1bb3a943ca92eabcbab99921033ac8
4
- data.tar.gz: a1186fce3b38759b628bbd627c6a95644954a1e3
3
+ metadata.gz: af2e529d7301065889daa1e1ba6690662e37a71c
4
+ data.tar.gz: ee8723c7221de6ef184f9702fe6e74bf9a7cf646
5
5
  SHA512:
6
- metadata.gz: 375582cf7da1f15a0f96fc55e4b259dbe7023e563e699e672e7e6ec45c345d8d8ab30bc3e1f980dd5c6eb2ebf61b4ab2d1cb80c79f10ee2b31a6ee2973db3f0c
7
- data.tar.gz: 011b6c877c20300724b8184f3949797c03739a481c390e239f609a12b213d61b2836523906b1f17f1605377ae9de9f56533bdf9a31b1fe0a9bf753dcaf4c00e1
6
+ metadata.gz: 8bd70a3d15130459e5dd573b673477f39abdea64c54dd442938b394905ed63295516997b265f39c4b9fd9ea0a08a8d245831eb517297664cfcd033ed1681628e
7
+ data.tar.gz: 874fb8258eea02135cd481b6f081057bf70a2a89d6825f1404aac297f6dc9cc6639b7fa1ea866575da25d450abbf68c2d82f9fedb454abb15dfc2180e8c2fe88
@@ -8,7 +8,7 @@ module GH
8
8
 
9
9
  def modify_hash(hash, loaded = false)
10
10
  hash = super(hash)
11
- link = hash['_links'].try(:[], 'self') unless loaded
11
+ link = hash['_links']['self'] unless loaded or hash['_links'].nil?
12
12
  setup_lazy_loading(hash, link['href']) if link
13
13
  hash
14
14
  rescue Exception => error
@@ -8,7 +8,7 @@ module GH
8
8
 
9
9
  def modify_hash(hash, loaded = false)
10
10
  hash = super(hash)
11
- link = hash['_links'].try(:[], 'self') unless loaded
11
+ link = hash['_links']['self'] unless loaded or hash['_links'].nil?
12
12
  set_links hash, Addressable::URI.parse(link['href']) if link
13
13
  hash
14
14
  end
@@ -68,7 +68,8 @@ module GH
68
68
  # Internal: ...
69
69
  def generate_response(key, response)
70
70
  body, headers = response.body, response.headers
71
- url = response.respond_to?(:url) ? response.url : response.env.try(:[], :url)
71
+ url = response.env[:url] if response.respond_to? :env and response.env
72
+ url = response.url if response.respond_to?(:url)
72
73
  url = frontend.full_url(key) if url.to_s.empty?
73
74
  modify(body, headers, url)
74
75
  end
@@ -1,4 +1,4 @@
1
1
  module GH
2
2
  # Public: Library version.
3
- VERSION = "0.13.3"
3
+ VERSION = "0.14.0"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.3
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-21 00:00:00.000000000 Z
11
+ date: 2015-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec