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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/bandcamp-discover/analyzer.rb +4 -0
- data/lib/bandcamp-discover/version.rb +1 -1
- data/test/analyzer_test.rb +12 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c2f1f8a4daa65012813a3a09bd62db1afc77e51751f14d9f69fa39ecfb144dab
|
|
4
|
+
data.tar.gz: f0311426fe47b54f71c722869395a9b435f63b13085e3c6779e0b82d40e81a77
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ff76b0b9b44909e568340ad18db61ed52af685391e9607ea88478bb23ba8feb346a96504a9624b9aed68b5c17b2f074bf38a2c9d26dde9f215c36b803a360bbc
|
|
7
|
+
data.tar.gz: 503083930726ae15941c4cbcf63a7783aed3c921c4f25af1745e1ef684481743f69efd4d87cae53c0ec572df95fdcd7ac197ac69291a59b9e9f4f2a94c9a688a
|
data/Gemfile.lock
CHANGED
|
@@ -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)
|
data/test/analyzer_test.rb
CHANGED
|
@@ -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
|
-
|
|
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
|