podcast_index 0.2.0 → 0.2.1

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
  SHA256:
3
- metadata.gz: be3811eb9cbde914e7e314e4d02e35a335fcb06250b8e22519ed0b59487d2e4b
4
- data.tar.gz: 19de21d136dbc55f8cf0adcc65a710d773baceb99398ff22182d7e67b26ebc6b
3
+ metadata.gz: fc3ddf4428c6108e1b2e5c3e5a9886283d34234cd85ccb8c6d927129d73d09fc
4
+ data.tar.gz: ebe518a53c0aeed362d57922464c13caae545b7535c7ea8622442286a55e2bd2
5
5
  SHA512:
6
- metadata.gz: 353f4074705cd1e93675d8bb8908698a57b07f321f54510d6d8e23af483736d6fd127b94aafcc67cd3d29e84e628c505aac290823e33425e30bc7c4343044cf8
7
- data.tar.gz: 03075bb9e16b26edaa2b4d865435b0bdf919fd896f7b19e0b5c3f7d204cb0093a2f35e02d1312b2e0248c2a3385dbb54cd240a504b92afd1bbae3bb8d8a22d40
6
+ metadata.gz: 83fe55e0065975fe9c6ee193247dacf1ba710cbf41660065ca81b1bdf7964f626f2540f7d2f63b6ef74b8937e6c5a3161e4d401777e23e0bee7bcdd74cfa4f55
7
+ data.tar.gz: 69a5aef31c4658c5934029522dd66f8e5e9b7d8c4040978302e03457b6ba181c6a70ddad786a12c8dab0d7d5de74fbb770d54daef08f197b4aada0a6e7818351
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.2.1] - 2023-07-06
4
+
5
+ * Raise exception when `Podcast.find` returns no result ([#6](https://github.com/jasonyork/podcast-index/issues/6))
6
+
3
7
  ## [0.2.0] - 2023-04-24
4
8
 
5
9
  * BREAKING: Switching to be more consistent with ActiveRecord conventions, using `find_by` and `where` methods for all models
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- podcast_index (0.2.0)
4
+ podcast_index (0.2.1)
5
5
  activesupport (>= 6.0, < 8)
6
6
  addressable (~> 2)
7
7
 
data/README.md CHANGED
@@ -56,6 +56,16 @@ podcast = PodcastIndex::Podcast.find(920666)
56
56
  podcast.title # => "Podcasting 2.0"
57
57
  ```
58
58
 
59
+ When the podcast cannot be found:
60
+
61
+ ```ruby
62
+ begin
63
+ podcast = PodcastIndex::Podcast.find("invalid")
64
+ rescue PodcastIndex::PodcastNotFound
65
+ puts "Podcast not found"
66
+ end
67
+ ```
68
+
59
69
  Find an episode by guid:
60
70
 
61
71
  ```ruby
@@ -10,6 +10,8 @@ module PodcastIndex
10
10
 
11
11
  def find(id)
12
12
  response = Api::Podcasts.by_feed_id(id: id)
13
+ raise PodcastIndex::PodcastNotFound, response["description"] if response["feed"].empty?
14
+
13
15
  from_response(response)
14
16
  end
15
17
 
@@ -1,3 +1,3 @@
1
1
  module PodcastIndex
2
- VERSION = "0.2.0".freeze
2
+ VERSION = "0.2.1".freeze
3
3
  end
data/lib/podcast_index.rb CHANGED
@@ -20,6 +20,7 @@ module PodcastIndex
20
20
  config_accessor :api_key, :api_secret, :base_url
21
21
 
22
22
  class Error < StandardError; end
23
+ class PodcastNotFound < Error; end
23
24
 
24
25
  def self.configure
25
26
  self.base_url = "https://api.podcastindex.org/api/1.0".freeze
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: podcast_index
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason York
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-24 00:00:00.000000000 Z
11
+ date: 2023-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport