bandcamp-discover 0.6.0 → 0.6.1

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
  SHA256:
3
- metadata.gz: 0d06bbc06b837c9d82502a0d9e9a61d3d2062af141f2a19e28ff0cb3e7e3fe5d
4
- data.tar.gz: 2b2bbe5682ed207b8911f31a74e1a1a0b8bf471326509b35a3849527b39bcab7
3
+ metadata.gz: c2f1f8a4daa65012813a3a09bd62db1afc77e51751f14d9f69fa39ecfb144dab
4
+ data.tar.gz: f0311426fe47b54f71c722869395a9b435f63b13085e3c6779e0b82d40e81a77
5
5
  SHA512:
6
- metadata.gz: 70c78eccc21549dd9c08fe183ec8ddf6a11060d79e913891ebca47de23f01248a07e7b73e27ea5fb45ba463ea93469d98f8be7f7fdcf5e99576600d5f2992c2a
7
- data.tar.gz: d345ad2550cd0ea344d0310a2aa8bdf351a5a3b08b999a19395092e7669ba07b9d98d9ea18a96b7480c3e5d4e44774922db943d115c1ca066ab1592cc058ac6c
6
+ metadata.gz: ff76b0b9b44909e568340ad18db61ed52af685391e9607ea88478bb23ba8feb346a96504a9624b9aed68b5c17b2f074bf38a2c9d26dde9f215c36b803a360bbc
7
+ data.tar.gz: 503083930726ae15941c4cbcf63a7783aed3c921c4f25af1745e1ef684481743f69efd4d87cae53c0ec572df95fdcd7ac197ac69291a59b9e9f4f2a94c9a688a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bandcamp-discover (0.6.0)
4
+ bandcamp-discover (0.6.1)
5
5
  async
6
6
  base64
7
7
  concurrent-ruby
@@ -25,8 +25,12 @@ module BandcampDiscover
25
25
 
26
26
  private
27
27
 
28
+ # open_router raises on a missing token rather than returning nil, which
29
+ # turned the documented regex fallback into an exception.
28
30
  def llm?
29
31
  defined?(OpenRouter) && !!OpenRouter.configuration.access_token
32
+ rescue OpenRouter::ConfigurationError
33
+ false
30
34
  end
31
35
 
32
36
  def ask(prompt)
@@ -1,3 +1,3 @@
1
1
  module BandcampDiscover
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
@@ -4,7 +4,18 @@ require "bandcamp-discover/analyzer"
4
4
  # OpenRouter is the host app's dependency, not this gem's, so a stand-in that
5
5
  # records the request is enough to prove what the Analyzer sends.
6
6
  module OpenRouter
7
- Configuration = Struct.new(:access_token)
7
+ class ConfigurationError < StandardError; end
8
+
9
+ # The real gem raises on a missing token instead of returning nil.
10
+ Configuration = Struct.new(:token) do
11
+ def access_token=(value)
12
+ self.token = value
13
+ end
14
+
15
+ def access_token
16
+ token or raise ConfigurationError, "OpenRouter access token missing!"
17
+ end
18
+ end
8
19
 
9
20
  def self.configuration
10
21
  @configuration ||= Configuration.new
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bandcamp-discover
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian RUbisch