bitly 2.1.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/sonarcloud.yml +4 -8
- data/.github/workflows/tests.yml +1 -1
- data/Gemfile +4 -0
- data/History.txt +12 -1
- data/README.md +118 -65
- data/lib/bitly/api/base.rb +1 -1
- data/lib/bitly/api/bitlink/link_click.rb +1 -1
- data/lib/bitly/api/bitlink/paginated_list.rb +7 -41
- data/lib/bitly/api/bitlink.rb +29 -14
- data/lib/bitly/api/bsd.rb +1 -1
- data/lib/bitly/api/click_metric.rb +18 -2
- data/lib/bitly/api/client.rb +30 -43
- data/lib/bitly/api/group/preferences.rb +2 -2
- data/lib/bitly/api/group.rb +20 -24
- data/lib/bitly/api/organization.rb +3 -3
- data/lib/bitly/api/paginated_list.rb +61 -0
- data/lib/bitly/api/qrcode/paginated_list.rb +18 -0
- data/lib/bitly/api/qrcode/scans_summary.rb +34 -0
- data/lib/bitly/api/qrcode.rb +104 -0
- data/lib/bitly/api/shorten_counts.rb +2 -2
- data/lib/bitly/api/user.rb +2 -2
- data/lib/bitly/api.rb +1 -1
- data/lib/bitly/http/adapters/net_http.rb +11 -1
- data/lib/bitly/version.rb +1 -1
- metadata +7 -4
- data/lib/bitly/api/oauth_app.rb +0 -26
@@ -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,
|
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
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:
|
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:
|
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.
|
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
|
data/lib/bitly/api/oauth_app.rb
DELETED
@@ -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
|