bitly 2.1.0 → 3.1.0

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.
@@ -6,8 +6,18 @@ module Bitly
6
6
  module HTTP
7
7
  module Adapters
8
8
  class NetHTTP
9
+ DEFAULT_OPTS = { use_ssl: true }
10
+
11
+ def initialize(proxy_addr: nil, proxy_port: nil, proxy_user: nil, proxy_pass: nil, request_opts: {})
12
+ @request_opts = DEFAULT_OPTS.merge(request_opts)
13
+ @proxy_addr = proxy_addr
14
+ @proxy_port = proxy_port
15
+ @proxy_user = proxy_user
16
+ @proxy_pass = proxy_pass
17
+ end
18
+
9
19
  def request(request)
10
- Net::HTTP.start(request.uri.host, request.uri.port, use_ssl: true) do |http|
20
+ Net::HTTP.start(request.uri.host, request.uri.port, @proxy_addr, @proxy_port, @proxy_user, @proxy_pass, @request_opts) do |http|
11
21
  method = Object.const_get("Net::HTTP::#{request.method.capitalize}")
12
22
  full_path = request.uri.path
13
23
  full_path += "?#{request.uri.query}" if request.uri.query
data/lib/bitly/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bitly
4
- VERSION = "2.1.0"
4
+ VERSION = "3.1.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitly
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Phil Nash
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-21 00:00:00.000000000 Z
11
+ date: 2025-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth2
@@ -178,8 +178,11 @@ files:
178
178
  - lib/bitly/api/group.rb
179
179
  - lib/bitly/api/group/preferences.rb
180
180
  - lib/bitly/api/list.rb
181
- - lib/bitly/api/oauth_app.rb
182
181
  - lib/bitly/api/organization.rb
182
+ - lib/bitly/api/paginated_list.rb
183
+ - lib/bitly/api/qrcode.rb
184
+ - lib/bitly/api/qrcode/paginated_list.rb
185
+ - lib/bitly/api/qrcode/scans_summary.rb
183
186
  - lib/bitly/api/shorten_counts.rb
184
187
  - lib/bitly/api/user.rb
185
188
  - lib/bitly/error.rb
@@ -216,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
216
219
  - !ruby/object:Gem::Version
217
220
  version: '0'
218
221
  requirements: []
219
- rubygems_version: 3.3.3
222
+ rubygems_version: 3.5.16
220
223
  signing_key:
221
224
  specification_version: 4
222
225
  summary: Use the Bitly API to shorten or expand URLs
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
- require_relative "./base"
3
-
4
- module Bitly
5
- module API
6
- class OAuthApp
7
- include Base
8
-
9
- def self.attributes
10
- [:name, :description, :link, :client_id]
11
- end
12
- attr_reader(*attributes)
13
-
14
- def self.fetch(client:, client_id:)
15
- response = client.request(path: "/apps/#{client_id}")
16
- new(data: response.body, client: client, response: response)
17
- end
18
-
19
- def initialize(data:, client:, response: nil)
20
- assign_attributes(data)
21
- @client = client
22
- @response = response
23
- end
24
- end
25
- end
26
- end