instapaper 1.0.0 → 1.0.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
- SHA1:
3
- metadata.gz: 9d5a373c9cb9c47ef7fcadc1b9608974f9710756
4
- data.tar.gz: d3f197b58e0cd8a74f69bf6644333d0071a76220
2
+ SHA256:
3
+ metadata.gz: f676a4a48c703e736cfd38eb18782f59695b96a90f161dceef13ebdc3c2a59cb
4
+ data.tar.gz: 7578b717fbc477c7b1607ad66fbf71474c9ab74d6feaf2732cf01e91372499cd
5
5
  SHA512:
6
- metadata.gz: c1cb814139e10f430465001d096a71e48c4b94f5da15f5ea960c80647c4a67e6946d8bd219b4a7c0acd01a5fff0462a9467fe628c49b90694f6e13710a47d8ce
7
- data.tar.gz: 716df4e63310adf3a2dba476cfd75e66d31ed42483cd9441fdb59beb583af65527138d927f123b2f7a31f43fca4a9991c98ba70133dfe9fd42af6cca5abe2f45
6
+ metadata.gz: b0bb55c79906debe49a45b95413ede8d85de5bb6f583d7a51b9ff3fda0795f0e4342eee24da19ddd24360d989c251c3946bd58b473d4256011c480ccaa3b632e
7
+ data.tar.gz: 540559d498d6a4d8dcddbfa1f48ee8f19ab7bcb4df03fd3331cccb96c8642f3cfc28bcfa1fe604f5bcbefce2be3ccc054ca7998d656b9b85e63794b96b9f9c30
data/README.md CHANGED
@@ -2,12 +2,10 @@
2
2
 
3
3
  [![Gem Version](http://img.shields.io/gem/v/instapaper.svg)][gem]
4
4
  [![Build Status](http://img.shields.io/travis/stve/instapaper.svg)][travis]
5
- [![Dependency Status](http://img.shields.io/gemnasium/stve/instapaper.svg)][gemnasium]
6
- [![Code Climate](http://img.shields.io/codeclimate/github/stve/instapaper.svg)][codeclimate]
5
+ [![Code Climate](https://img.shields.io/codeclimate/maintainability/stve/instapaper.svg)][codeclimate]
7
6
 
8
7
  [gem]: https://rubygems.org/gems/instapaper
9
8
  [travis]: https://travis-ci.org/stve/instapaper
10
- [gemnasium]: https://gemnasium.com/stve/instapaper
11
9
  [codeclimate]: https://codeclimate.com/github/stve/instapaper
12
10
 
13
11
 
data/instapaper.gemspec CHANGED
@@ -1,22 +1,22 @@
1
- lib = File.expand_path('../lib', __FILE__)
1
+ lib = File.expand_path('lib', __dir__)
2
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
  require 'instapaper/version'
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.add_dependency 'addressable', '~> 2.3'
7
- spec.add_dependency 'http', '~> 2'
7
+ spec.add_dependency 'http', '>= 2', '< 6'
8
8
  spec.add_dependency 'multi_json', '~> 1'
9
9
  spec.add_dependency 'simple_oauth', '~> 0.3'
10
10
  spec.add_dependency 'virtus', '~> 1'
11
- spec.add_development_dependency 'bundler', '~> 1.0'
11
+ spec.add_development_dependency 'bundler'
12
12
  spec.author = 'Steve Agalloco'
13
13
  spec.description = "Ruby Client for Instapaper's Full API"
14
14
  spec.email = 'steve.agalloco@gmail.com'
15
- spec.files = %w(LICENSE.md README.md instapaper.gemspec) + Dir['lib/**/*.rb']
15
+ spec.files = %w[LICENSE.md README.md instapaper.gemspec] + Dir['lib/**/*.rb']
16
16
  spec.homepage = 'https://github.com/stve/instapaper'
17
- spec.licenses = %w(MIT)
17
+ spec.licenses = %w[MIT]
18
18
  spec.name = 'instapaper'
19
- spec.require_paths = %w(lib)
19
+ spec.require_paths = %w[lib]
20
20
  spec.required_ruby_version = '>= 2.0.0'
21
21
  spec.summary = 'Ruby Instapaper Client'
22
22
  spec.version = Instapaper::VERSION
@@ -27,7 +27,7 @@ module Instapaper
27
27
  # @param order [Array] An array of folder_id:position pairs joined by commas.
28
28
  # @example Ordering folder_ids 100, 200, and 300
29
29
  # Instapaper.set_order(['100:1','200:2','300:3'])
30
- def set_order(order = []) # rubocop:disable Style/AccessorMethodName
30
+ def set_order(order = []) # rubocop:disable Naming/AccessorMethodName
31
31
  perform_post_with_objects('/api/1.1/folders/set_order', {order: order.join(',')}, Instapaper::Folder)
32
32
  end
33
33
  end
@@ -10,6 +10,7 @@ module Instapaper
10
10
  response = perform_post_with_unparsed_response('/api/1.1/oauth/access_token', x_auth_username: username, x_auth_password: password, x_auth_mode: 'client_auth')
11
11
  parsed_response = QLineParser.parse(response)
12
12
  raise Instapaper::Error::OAuthError, parsed_response['error'] if parsed_response.key?('error')
13
+
13
14
  Instapaper::Credentials.new(parsed_response)
14
15
  end
15
16
  end
@@ -13,8 +13,8 @@ module Instapaper
13
13
  attribute :delete_ids, Array[Integer]
14
14
  end
15
15
 
16
- def each
17
- bookmarks.each { |bookmark| yield(bookmark) }
16
+ def each(&block)
17
+ bookmarks.each(&block)
18
18
  end
19
19
  end
20
20
  end
@@ -16,9 +16,11 @@ module Instapaper
16
16
  # @param options [Hash]
17
17
  # @return [Instapaper::Client]
18
18
  def initialize(options = {})
19
- options.each do |key, value|
20
- instance_variable_set("@#{key}", value)
21
- end
19
+ @oauth_token = options[:oauth_token]
20
+ @oauth_token_secret = options[:oauth_token_secret]
21
+ @consumer_key = options[:consumer_key]
22
+ @consumer_secret = options[:consumer_secret]
23
+ @proxy = options[:proxy]
22
24
  yield(self) if block_given?
23
25
  end
24
26
 
@@ -5,7 +5,9 @@ module Instapaper
5
5
  module HTTP
6
6
  class Response
7
7
  attr_reader :response, :raw_format, :path
8
- def initialize(response, path, raw_format = false)
8
+
9
+ # TODO: Change this to a keyword argument (needs a major version bump)
10
+ def initialize(response, path, raw_format = false) # rubocop:disable Style/OptionalBooleanParameter
9
11
  @response = response
10
12
  @path = path
11
13
  @raw_format = raw_format
@@ -28,9 +30,9 @@ module Instapaper
28
30
  private
29
31
 
30
32
  def parsed
31
- @parsed_response ||= begin
33
+ @parsed ||= begin
32
34
  response.parse(:json)
33
- rescue
35
+ rescue StandardError
34
36
  response.body
35
37
  end
36
38
  end
@@ -57,9 +57,7 @@ module Instapaper
57
57
  end
58
58
 
59
59
  def coerce_hash(response)
60
- if response.key?('hash')
61
- response['instapaper_hash'] = response.delete('hash')
62
- end
60
+ response['instapaper_hash'] = response.delete('hash') if response.key?('hash')
63
61
  if response.key?('bookmarks')
64
62
  response['bookmarks'] = response['bookmarks'].collect do |bookmark|
65
63
  coerce_hash(bookmark)
@@ -1,3 +1,3 @@
1
1
  module Instapaper
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: instapaper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Agalloco
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-17 00:00:00.000000000 Z
11
+ date: 2022-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -28,16 +28,22 @@ dependencies:
28
28
  name: http
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '2'
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: '6'
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
38
- - - "~>"
41
+ - - ">="
39
42
  - !ruby/object:Gem::Version
40
43
  version: '2'
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: '6'
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: multi_json
43
49
  requirement: !ruby/object:Gem::Requirement
@@ -84,16 +90,16 @@ dependencies:
84
90
  name: bundler
85
91
  requirement: !ruby/object:Gem::Requirement
86
92
  requirements:
87
- - - "~>"
93
+ - - ">="
88
94
  - !ruby/object:Gem::Version
89
- version: '1.0'
95
+ version: '0'
90
96
  type: :development
91
97
  prerelease: false
92
98
  version_requirements: !ruby/object:Gem::Requirement
93
99
  requirements:
94
- - - "~>"
100
+ - - ">="
95
101
  - !ruby/object:Gem::Version
96
- version: '1.0'
102
+ version: '0'
97
103
  description: Ruby Client for Instapaper's Full API
98
104
  email: steve.agalloco@gmail.com
99
105
  executables: []
@@ -128,7 +134,7 @@ homepage: https://github.com/stve/instapaper
128
134
  licenses:
129
135
  - MIT
130
136
  metadata: {}
131
- post_install_message:
137
+ post_install_message:
132
138
  rdoc_options: []
133
139
  require_paths:
134
140
  - lib
@@ -143,9 +149,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
149
  - !ruby/object:Gem::Version
144
150
  version: '0'
145
151
  requirements: []
146
- rubyforge_project:
147
- rubygems_version: 2.6.10
148
- signing_key:
152
+ rubygems_version: 3.3.4
153
+ signing_key:
149
154
  specification_version: 4
150
155
  summary: Ruby Instapaper Client
151
156
  test_files: []