From 9309c2c1048557be5f9ff07e2efc915508eb0f93 Mon Sep 17 00:00:00 2001 From: Daniel Nitsikopoulos Date: Wed, 1 Feb 2023 21:24:02 +1100 Subject: [PATCH] Fix pinboard integration --- Gemfile | 2 +- Gemfile.lock | 12 ++++++------ config/providers/syndication.rb | 2 +- config/settings.rb | 2 ++ lib/adamantium/syndication/pinboard.rb | 2 +- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Gemfile b/Gemfile index baf28b8..b223978 100644 --- a/Gemfile +++ b/Gemfile @@ -28,7 +28,7 @@ gem "httparty" gem "redcarpet" gem "rexml" gem "babosa" -gem "pinboard" +gem "pinboard", "~> 1.0.0" group :cli, :development do gem "hanami-reloader" diff --git a/Gemfile.lock b/Gemfile.lock index 7e2637a..bdc2fff 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -170,8 +170,8 @@ GEM dry-validation (>= 1.10, < 2) zeitwerk (~> 2.6.0) hansi (0.2.1) - httparty (0.21.0) - mini_mime (>= 1.0.0) + httparty (0.11.0) + multi_json (~> 1.0) multi_xml (>= 0.5.2) i18n (1.12.0) concurrent-ruby (~> 1.0) @@ -183,7 +183,7 @@ GEM rb-inotify (~> 0.9, >= 0.9.10) lumberjack (1.2.8) method_source (1.0.0) - mini_mime (1.1.2) + multi_json (1.15.0) multi_xml (0.6.0) mustermann (3.0.0) ruby2_keywords (~> 0.0.1) @@ -202,8 +202,8 @@ GEM parser (3.2.0.0) ast (~> 2.4.1) pg (1.4.5) - pinboard (0.0.3) - httparty (~> 0.7) + pinboard (1.0.0) + httparty (= 0.11.0) pry (0.14.1) coderay (~> 1.1) method_source (~> 1.0) @@ -331,7 +331,7 @@ DEPENDENCIES hanami-view! httparty pg - pinboard + pinboard (~> 1.0.0) puma rack-test rake diff --git a/config/providers/syndication.rb b/config/providers/syndication.rb index 36b18e5..40eae75 100644 --- a/config/providers/syndication.rb +++ b/config/providers/syndication.rb @@ -1,6 +1,6 @@ Hanami.app.register_provider :syndication, namespace: true do start do 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 diff --git a/config/settings.rb b/config/settings.rb index 9934856..33b1e2a 100644 --- a/config/settings.rb +++ b/config/settings.rb @@ -28,5 +28,7 @@ module Adamantium setting :mastodon_token, default: nil setting :mastodon_server, default: nil + + setting :pinboard_api_key, default: nil end end diff --git a/lib/adamantium/syndication/pinboard.rb b/lib/adamantium/syndication/pinboard.rb index 92463fc..f38acf7 100644 --- a/lib/adamantium/syndication/pinboard.rb +++ b/lib/adamantium/syndication/pinboard.rb @@ -8,7 +8,7 @@ module Adamantium include Dry::Monads[:result] def initialize(api_key:) - @pinboard = Pinboard::Client.new(token: api_key) + @pinboard = ::Pinboard::Client.new(token: api_key) end def call(post:)