npr 2.0.2 → 3.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: bf4c4a011651edd95926dd6168ec80945425839f
4
- data.tar.gz: 9125e5a663d7dc27cc079894a7caea1b81fb5ca8
3
+ metadata.gz: e1b6311261f4e5cd3a5743fddea043ba07529ab1
4
+ data.tar.gz: 4c9d1025c17bad580780695bfe76df4c1d5ef134
5
5
  SHA512:
6
- metadata.gz: 67a68d05f54115dc9e8436b751e4fe08ddbdcb67040058e8213715364175b58f6eb0769f17c33d97eabf4c8cd3ad6199d105213e3a0627b8cba821bd134e65eb
7
- data.tar.gz: ae48c72b8bc9f3c9be4f4ff860ed4a25e87f590bc40c925b7fd1d6f8c055d902909a79649dd4c53c9c833c9381a42cbd450fae30b5c90ef748a851b87f69e62c
6
+ metadata.gz: dc0411b936d4fbf241e36d1c5a6eb171db590c8c9783b37cca862e951b59614c4280c85113975f6c9ac49234eb30cb90ec708df49dcf8c119a3f5e75d12aeadb
7
+ data.tar.gz: ecdc32dc23ee7ff07543e069b05357e0d12c61e3a296fa30bfdcdc2bf34a319e52567dcbe2eafb6e166fdb2f6f065bab7f9b2a3001d0b32890232747434df860
@@ -1,7 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.1
4
- - 2.1.0
5
- - 2.0.0
6
- - 1.9.3
7
- - 1.9.2
3
+ - 2.2
4
+ - 2.1
5
+ - 2.0
6
+
7
+ before_install:
8
+ - gem install bundler -v 1.11.2
@@ -1,3 +1,8 @@
1
+ ### 3.0.0
2
+ #### Changes
3
+ * Transcripts now has many links instead of one.
4
+ * `has_many` association can take either a collection or a single object.
5
+
1
6
  ### 2.0.2
2
7
  #### Changes
3
8
  * More strict faraday_middleware dependency.
@@ -19,7 +19,6 @@ module NPR
19
19
 
20
20
  @_response = response
21
21
  @raw = response.body
22
-
23
22
  @version = @raw["version"]
24
23
 
25
24
  if list = @raw["list"]
@@ -34,7 +34,11 @@ module NPR
34
34
  #------------------
35
35
 
36
36
  def string_time_parse(value)
37
- !value.empty? ? Time.parse(value) : nil
37
+ begin
38
+ !value.empty? ? Time.parse(value) : nil
39
+ rescue ArgumentError
40
+ nil
41
+ end
38
42
  end
39
43
 
40
44
  #------------------
@@ -84,7 +84,7 @@ module NPR
84
84
  collection = []
85
85
 
86
86
  if node = json[relation[:key]]
87
- node.each do |obj|
87
+ Array.wrap(node).each do |obj|
88
88
  collection.push relation[:class_name].new(obj)
89
89
  end
90
90
  end
@@ -4,7 +4,7 @@
4
4
  module NPR
5
5
  module Entity
6
6
  class Transcript < Base
7
- has_one "link", :class_name => NPR::Entity::Link
7
+ has_many "links", :key => 'link', :class_name => NPR::Entity::Link
8
8
 
9
9
  #-------------------
10
10
 
@@ -1,3 +1,3 @@
1
1
  module NPR
2
- VERSION = "2.0.2"
2
+ VERSION = "3.0.0"
3
3
  end
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
24
24
  s.add_dependency 'faraday', '~> 0.8.0'
25
25
  s.add_dependency 'faraday_middleware', '~> 0.9.0'
26
26
 
27
- s.add_development_dependency 'bundler', '>= 1.0.0'
27
+ s.add_development_dependency 'bundler', '>= 1.11.0'
28
28
  s.add_development_dependency 'rake'
29
29
  s.add_development_dependency 'rspec'
30
30
  s.add_development_dependency 'fakeweb'
@@ -17,6 +17,6 @@ describe NPR::Entity::Transcript do
17
17
  end
18
18
 
19
19
  it "creates relations" do
20
- @transcript.link.should be_a NPR::Entity::Link
20
+ @transcript.links[0].should be_a NPR::Entity::Link
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: npr
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Ricker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-02 00:00:00.000000000 Z
11
+ date: 2016-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 1.0.0
47
+ version: 1.11.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 1.0.0
54
+ version: 1.11.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -281,7 +281,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
281
281
  version: '0'
282
282
  requirements: []
283
283
  rubyforge_project:
284
- rubygems_version: 2.2.2
284
+ rubygems_version: 2.5.1
285
285
  signing_key:
286
286
  specification_version: 4
287
287
  summary: A Ruby client for the NPR API