tiltify 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +6 -25
- data/README.md +9 -0
- data/lib/tiltify/client.rb +1 -3
- data/lib/tiltify/collection.rb +3 -5
- data/lib/tiltify/resources/campaigns.rb +1 -1
- data/lib/tiltify/version.rb +1 -1
- data/lib/tiltify.rb +0 -1
- data/tiltify.gemspec +1 -2
- metadata +5 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de4b0ac4ba6b988eca685054c25fc6f1e8579ceec00d1d7cdc6091bf06b1ace6
|
4
|
+
data.tar.gz: d88687edb6753f9a3b34bf3936740646322eea8be82b2ae18a2589763eda1c55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bfa30019176b28a06b42e2bab140d33cf1b7d4ba06a160a0a44f0e15dedc46798aa8f4e2108dc074c9400161ef988b518112b058ec13d939d1d8b8161e5ea84d
|
7
|
+
data.tar.gz: ea13d6f2ace92776824adbbb3f1532a77d754860f50fac5b47c223659281a04315ea0eb92a55dbb81272a63495154bdeb702b45c423670d739f0dec506cf9761
|
data/Gemfile.lock
CHANGED
@@ -1,37 +1,18 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
tiltify (0.1.
|
5
|
-
faraday (~>
|
6
|
-
faraday_middleware (~> 1.1)
|
4
|
+
tiltify (0.1.1)
|
5
|
+
faraday (~> 2.0)
|
7
6
|
|
8
7
|
GEM
|
9
8
|
remote: https://rubygems.org/
|
10
9
|
specs:
|
11
10
|
dotenv (2.7.6)
|
12
|
-
faraday (
|
13
|
-
faraday-
|
14
|
-
faraday-em_synchrony (~> 1.0)
|
15
|
-
faraday-excon (~> 1.1)
|
16
|
-
faraday-httpclient (~> 1.0.1)
|
17
|
-
faraday-net_http (~> 1.0)
|
18
|
-
faraday-net_http_persistent (~> 1.1)
|
19
|
-
faraday-patron (~> 1.0)
|
20
|
-
faraday-rack (~> 1.0)
|
21
|
-
multipart-post (>= 1.2, < 3)
|
11
|
+
faraday (2.2.0)
|
12
|
+
faraday-net_http (~> 2.0)
|
22
13
|
ruby2_keywords (>= 0.0.4)
|
23
|
-
faraday-
|
24
|
-
|
25
|
-
faraday-excon (1.1.0)
|
26
|
-
faraday-httpclient (1.0.1)
|
27
|
-
faraday-net_http (1.0.1)
|
28
|
-
faraday-net_http_persistent (1.2.0)
|
29
|
-
faraday-patron (1.0.0)
|
30
|
-
faraday-rack (1.0.0)
|
31
|
-
faraday_middleware (1.2.0)
|
32
|
-
faraday (~> 1.0)
|
33
|
-
minitest (5.14.4)
|
34
|
-
multipart-post (2.1.1)
|
14
|
+
faraday-net_http (2.0.2)
|
15
|
+
minitest (5.15.0)
|
35
16
|
rake (13.0.6)
|
36
17
|
ruby2_keywords (0.0.5)
|
37
18
|
|
data/README.md
CHANGED
@@ -92,3 +92,12 @@ Responses are created as objects like `Tiltify::Campaign`. Having types like `Ti
|
|
92
92
|
# Retrieves a list of a teams campaigns
|
93
93
|
@client.teams.campaigns(team_id: "id")
|
94
94
|
```
|
95
|
+
|
96
|
+
|
97
|
+
## Contributing
|
98
|
+
|
99
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/deanpcmad/tiltify.
|
100
|
+
|
101
|
+
## License
|
102
|
+
|
103
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/lib/tiltify/client.rb
CHANGED
@@ -32,9 +32,7 @@ module Tiltify
|
|
32
32
|
@connection ||= Faraday.new(BASE_URL) do |conn|
|
33
33
|
conn.request :authorization, :Bearer, access_token
|
34
34
|
conn.request :json
|
35
|
-
|
36
|
-
conn.response :dates
|
37
|
-
conn.response :json, content_type: "application/json"
|
35
|
+
conn.response :json
|
38
36
|
|
39
37
|
conn.adapter adapter, @stubs
|
40
38
|
end
|
data/lib/tiltify/collection.rb
CHANGED
@@ -1,21 +1,19 @@
|
|
1
1
|
module Tiltify
|
2
2
|
class Collection
|
3
|
-
attr_reader :data, :total
|
3
|
+
attr_reader :data, :total
|
4
4
|
|
5
5
|
def self.from_response(response, type:)
|
6
6
|
body = response.body
|
7
7
|
|
8
8
|
new(
|
9
9
|
data: body["data"].map { |attrs| type.new(attrs) },
|
10
|
-
total: body["data"].count
|
11
|
-
cursor: body.dig("pagination", "cursor")
|
10
|
+
total: body["data"].count
|
12
11
|
)
|
13
12
|
end
|
14
13
|
|
15
|
-
def initialize(data:, total
|
14
|
+
def initialize(data:, total:)
|
16
15
|
@data = data
|
17
16
|
@total = total
|
18
|
-
@cursor = cursor.nil? ? nil : cursor
|
19
17
|
end
|
20
18
|
end
|
21
19
|
end
|
@@ -6,7 +6,7 @@ module Tiltify
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def donations(campaign_id:, **params)
|
9
|
-
response = get_request("campaigns/#{campaign_id}/donations", params)
|
9
|
+
response = get_request("campaigns/#{campaign_id}/donations", params: params)
|
10
10
|
Collection.from_response(response, type: Donation)
|
11
11
|
end
|
12
12
|
|
data/lib/tiltify/version.rb
CHANGED
data/lib/tiltify.rb
CHANGED
data/tiltify.gemspec
CHANGED
@@ -28,6 +28,5 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
29
29
|
spec.require_paths = ["lib"]
|
30
30
|
|
31
|
-
spec.add_dependency "faraday", "~>
|
32
|
-
spec.add_dependency "faraday_middleware", "~> 1.1"
|
31
|
+
spec.add_dependency "faraday", "~> 2.0"
|
33
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tiltify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dean Perry
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -16,28 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: faraday_middleware
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '1.1'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '1.1'
|
26
|
+
version: '2.0'
|
41
27
|
description:
|
42
28
|
email:
|
43
29
|
- dean@deanpcmad.com
|
@@ -94,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
80
|
- !ruby/object:Gem::Version
|
95
81
|
version: '0'
|
96
82
|
requirements: []
|
97
|
-
rubygems_version: 3.
|
83
|
+
rubygems_version: 3.3.7
|
98
84
|
signing_key:
|
99
85
|
specification_version: 4
|
100
86
|
summary: A Ruby library for the Tiltify v3 API
|