patreon 0.4.0 → 0.5.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.
- checksums.yaml +4 -4
- data/.circleci/config.yml +32 -0
- data/CHANGELOG.md +6 -0
- data/Rakefile +7 -0
- data/lib/patreon.rb +11 -2
- data/lib/patreon/api.rb +24 -20
- data/lib/patreon/oauth.rb +0 -3
- data/lib/patreon/utils/jsonapi/url_util.rb +13 -16
- data/lib/patreon/version.rb +1 -1
- data/patreon.gemspec +8 -1
- data/spec/api_spec.rb +74 -0
- data/spec/fixtures/current_user.json +1472 -0
- data/spec/fixtures/fetch_campaign.json +512 -0
- data/spec/spec_helper.rb +4 -0
- data/spec/util_spec.rb +33 -0
- metadata +86 -5
- data/lib/patreon/schemas.rb +0 -7
data/spec/spec_helper.rb
ADDED
data/spec/util_spec.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
describe Patreon::Utils::JSONAPI::URLUtil do
|
2
|
+
describe "build_url" do
|
3
|
+
it "should build a url" do
|
4
|
+
url = Patreon::Utils::JSONAPI::URLUtil.build_url("/")
|
5
|
+
assert_equal url, "/"
|
6
|
+
end
|
7
|
+
|
8
|
+
it "should build a url with a string includes" do
|
9
|
+
url = Patreon::Utils::JSONAPI::URLUtil.build_url("/", "include")
|
10
|
+
assert_equal url, "/?include=include"
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should build a url with an array includes" do
|
14
|
+
url = Patreon::Utils::JSONAPI::URLUtil.build_url("/", ["some", "include"])
|
15
|
+
assert_equal url, "/?include=some%2Cinclude"
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should build a url with a fields" do
|
19
|
+
url = Patreon::Utils::JSONAPI::URLUtil.build_url("/", nil, {hey: 123})
|
20
|
+
assert_equal url, "/?fields%5Bhey%5D=123"
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should build a url with a fields and includes" do
|
24
|
+
url = Patreon::Utils::JSONAPI::URLUtil.build_url("/", ["some", "include"], {hey: 123})
|
25
|
+
assert_equal url, "/?include=some%2Cinclude&fields%5Bhey%5D=123"
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should merge with a pre-existing querystring" do
|
29
|
+
url = Patreon::Utils::JSONAPI::URLUtil.build_url("/?1=2", ["some", "include"], {hey: 123})
|
30
|
+
assert_equal url, "/?1=2&include=some%2Cinclude&fields%5Bhey%5D=123"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: patreon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patreon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json-api-vanilla
|
@@ -24,6 +24,76 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.0.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rack
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 5.11.3
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 5.11.3
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: minitest-hooks
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.0.1
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 1.0.1
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: mocha
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.3.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.3.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 12.3.0
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 12.3.0
|
27
97
|
description: Interact with the Patreon API via OAuth
|
28
98
|
email:
|
29
99
|
- david@patreon.com
|
@@ -31,12 +101,14 @@ executables: []
|
|
31
101
|
extensions: []
|
32
102
|
extra_rdoc_files: []
|
33
103
|
files:
|
104
|
+
- ".circleci/config.yml"
|
34
105
|
- ".gitignore"
|
35
106
|
- CHANGELOG.md
|
36
107
|
- Gemfile
|
37
108
|
- LICENSE
|
38
109
|
- NOTICE
|
39
110
|
- README.md
|
111
|
+
- Rakefile
|
40
112
|
- example/fetch_all_patrons.rb
|
41
113
|
- example/sinatra/.gitignore
|
42
114
|
- example/sinatra/Gemfile
|
@@ -54,7 +126,6 @@ files:
|
|
54
126
|
- lib/patreon.rb
|
55
127
|
- lib/patreon/api.rb
|
56
128
|
- lib/patreon/oauth.rb
|
57
|
-
- lib/patreon/schemas.rb
|
58
129
|
- lib/patreon/schemas/campaign.rb
|
59
130
|
- lib/patreon/schemas/goal.rb
|
60
131
|
- lib/patreon/schemas/pledge.rb
|
@@ -65,6 +136,11 @@ files:
|
|
65
136
|
- lib/patreon/utils/jsonapi/url_util.rb
|
66
137
|
- lib/patreon/version.rb
|
67
138
|
- patreon.gemspec
|
139
|
+
- spec/api_spec.rb
|
140
|
+
- spec/fixtures/current_user.json
|
141
|
+
- spec/fixtures/fetch_campaign.json
|
142
|
+
- spec/spec_helper.rb
|
143
|
+
- spec/util_spec.rb
|
68
144
|
homepage: https://github.com/Patreon/patreon-ruby
|
69
145
|
licenses:
|
70
146
|
- Apache 2.0
|
@@ -85,8 +161,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
161
|
version: '0'
|
86
162
|
requirements: []
|
87
163
|
rubyforge_project:
|
88
|
-
rubygems_version: 2.6.
|
164
|
+
rubygems_version: 2.6.8
|
89
165
|
signing_key:
|
90
166
|
specification_version: 4
|
91
167
|
summary: Visit patreon.com/oauth2/documentation for more information.
|
92
|
-
test_files:
|
168
|
+
test_files:
|
169
|
+
- spec/api_spec.rb
|
170
|
+
- spec/fixtures/current_user.json
|
171
|
+
- spec/fixtures/fetch_campaign.json
|
172
|
+
- spec/spec_helper.rb
|
173
|
+
- spec/util_spec.rb
|