Skip to content

Commit

Permalink
Merge pull request #22 from franktisellano/master
Browse files Browse the repository at this point in the history
Updates HTTParty to avoid using URI methods deprecated in newer Ruby versions; control flow change in client.rb
  • Loading branch information
ryw authored Jul 23, 2023
2 parents 3334c4c + 825e96e commit 5c813b7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions lib/pinboard/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,15 @@ def get(params = {})
def suggest(url)
options = create_params({url: url})
suggested = self.class.get('/posts/suggest', options)['suggested']
popular = suggested['popular']
popular = [] if popular.nil?
popular = [popular] if popular.class != Array

recommended = suggested['recommended']
recommended = [] if recommended.nil?
if suggested.nil?
popular = []
recommended = []
else
popular = suggested['popular']
recommended = suggested['recommended']
end
popular = [popular] if popular.class != Array
recommended = [recommended] if recommended.class != Array

{:popular => popular, :recommended => recommended}
Expand Down
2 changes: 1 addition & 1 deletion pinboard.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'httparty'
s.name = 'pinboard'
s.version = '1.1.0'
s.date = '2020-12-30'
s.date = '2023-07-22'
s.summary = "Ruby wrapper for the Pinboard API"
s.description = "Ruby wrapper for the Pinboard API"
s.authors = ["Ry Waker", "Jan-Erik Rediger", "Nicholas E. Rabenau"]
Expand Down

0 comments on commit 5c813b7

Please sign in to comment.