Fix pinboard integration

This commit is contained in:
2023-02-01 21:24:02 +11:00
parent 1defc79496
commit 9309c2c104
5 changed files with 11 additions and 9 deletions

View File

@@ -28,7 +28,7 @@ gem "httparty"
gem "redcarpet" gem "redcarpet"
gem "rexml" gem "rexml"
gem "babosa" gem "babosa"
gem "pinboard" gem "pinboard", "~> 1.0.0"
group :cli, :development do group :cli, :development do
gem "hanami-reloader" gem "hanami-reloader"

View File

@@ -170,8 +170,8 @@ GEM
dry-validation (>= 1.10, < 2) dry-validation (>= 1.10, < 2)
zeitwerk (~> 2.6.0) zeitwerk (~> 2.6.0)
hansi (0.2.1) hansi (0.2.1)
httparty (0.21.0) httparty (0.11.0)
mini_mime (>= 1.0.0) multi_json (~> 1.0)
multi_xml (>= 0.5.2) multi_xml (>= 0.5.2)
i18n (1.12.0) i18n (1.12.0)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
@@ -183,7 +183,7 @@ GEM
rb-inotify (~> 0.9, >= 0.9.10) rb-inotify (~> 0.9, >= 0.9.10)
lumberjack (1.2.8) lumberjack (1.2.8)
method_source (1.0.0) method_source (1.0.0)
mini_mime (1.1.2) multi_json (1.15.0)
multi_xml (0.6.0) multi_xml (0.6.0)
mustermann (3.0.0) mustermann (3.0.0)
ruby2_keywords (~> 0.0.1) ruby2_keywords (~> 0.0.1)
@@ -202,8 +202,8 @@ GEM
parser (3.2.0.0) parser (3.2.0.0)
ast (~> 2.4.1) ast (~> 2.4.1)
pg (1.4.5) pg (1.4.5)
pinboard (0.0.3) pinboard (1.0.0)
httparty (~> 0.7) httparty (= 0.11.0)
pry (0.14.1) pry (0.14.1)
coderay (~> 1.1) coderay (~> 1.1)
method_source (~> 1.0) method_source (~> 1.0)
@@ -331,7 +331,7 @@ DEPENDENCIES
hanami-view! hanami-view!
httparty httparty
pg pg
pinboard pinboard (~> 1.0.0)
puma puma
rack-test rack-test
rake rake

View File

@@ -1,6 +1,6 @@
Hanami.app.register_provider :syndication, namespace: true do Hanami.app.register_provider :syndication, namespace: true do
start do start do
register "mastodon", Adamantium::Syndication::Mastodon.new register "mastodon", Adamantium::Syndication::Mastodon.new
register "pinboard", Adamantium::Syndication::Pinboard.new(api_key: settings.pinboard_api_key) register "pinboard", Adamantium::Syndication::Pinboard.new(api_key: target["settings"].pinboard_api_key)
end end
end end

View File

@@ -28,5 +28,7 @@ module Adamantium
setting :mastodon_token, default: nil setting :mastodon_token, default: nil
setting :mastodon_server, default: nil setting :mastodon_server, default: nil
setting :pinboard_api_key, default: nil
end end
end end

View File

@@ -8,7 +8,7 @@ module Adamantium
include Dry::Monads[:result] include Dry::Monads[:result]
def initialize(api_key:) def initialize(api_key:)
@pinboard = Pinboard::Client.new(token: api_key) @pinboard = ::Pinboard::Client.new(token: api_key)
end end
def call(post:) def call(post:)