discourse_api 1.1.0 → 2.0.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/ci.yml +23 -10
- data/.rubocop.yml +1 -1
- data/.streerc +2 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +1 -1
- data/README.md +0 -4
- data/discourse_api.gemspec +7 -4
- data/examples/backups.rb +5 -5
- data/examples/badges.rb +5 -5
- data/examples/bookmark_topic.rb +5 -5
- data/examples/category.rb +10 -6
- data/examples/change_topic_status.rb +12 -11
- data/examples/create_private_message.rb +6 -6
- data/examples/create_topic.rb +9 -9
- data/examples/create_update_category.rb +13 -16
- data/examples/create_user.rb +12 -11
- data/examples/dashboard.rb +5 -5
- data/examples/disposable_invite_tokens.rb +9 -10
- data/examples/example.rb +5 -5
- data/examples/group_set_user_notification_level.rb +18 -19
- data/examples/groups.rb +7 -7
- data/examples/invite_users.rb +5 -5
- data/examples/manage_api_keys.rb +6 -11
- data/examples/notifications.rb +6 -6
- data/examples/polls.rb +12 -12
- data/examples/post_action.rb +5 -5
- data/examples/search.rb +5 -5
- data/examples/sent_private_messages.rb +6 -6
- data/examples/sso.rb +6 -6
- data/examples/topic_lists.rb +5 -5
- data/examples/update_user.rb +15 -7
- data/examples/upload_file.rb +7 -7
- data/lib/discourse_api/api/api_key.rb +1 -3
- data/lib/discourse_api/api/backups.rb +1 -1
- data/lib/discourse_api/api/badges.rb +21 -6
- data/lib/discourse_api/api/categories.rb +69 -37
- data/lib/discourse_api/api/dashboard.rb +2 -6
- data/lib/discourse_api/api/groups.rb +68 -73
- data/lib/discourse_api/api/invite.rb +30 -30
- data/lib/discourse_api/api/notifications.rb +2 -3
- data/lib/discourse_api/api/params.rb +4 -14
- data/lib/discourse_api/api/polls.rb +9 -12
- data/lib/discourse_api/api/posts.rb +5 -8
- data/lib/discourse_api/api/private_messages.rb +9 -8
- data/lib/discourse_api/api/search.rb +2 -2
- data/lib/discourse_api/api/topics.rb +20 -22
- data/lib/discourse_api/api/uploads.rb +7 -5
- data/lib/discourse_api/api/user_actions.rb +2 -2
- data/lib/discourse_api/api/users.rb +31 -19
- data/lib/discourse_api/client.rb +58 -56
- data/lib/discourse_api/example_helper.rb +2 -4
- data/lib/discourse_api/single_sign_on.rb +53 -57
- data/lib/discourse_api/version.rb +1 -1
- data/spec/discourse_api/api/api_key_spec.rb +39 -25
- data/spec/discourse_api/api/backups_spec.rb +8 -3
- data/spec/discourse_api/api/badges_spec.rb +17 -7
- data/spec/discourse_api/api/categories_spec.rb +95 -53
- data/spec/discourse_api/api/email_spec.rb +17 -7
- data/spec/discourse_api/api/groups_spec.rb +71 -52
- data/spec/discourse_api/api/invite_spec.rb +41 -21
- data/spec/discourse_api/api/notifications_spec.rb +8 -4
- data/spec/discourse_api/api/params_spec.rb +5 -3
- data/spec/discourse_api/api/polls_spec.rb +53 -44
- data/spec/discourse_api/api/posts_spec.rb +33 -16
- data/spec/discourse_api/api/private_messages_spec.rb +25 -12
- data/spec/discourse_api/api/search_spec.rb +8 -3
- data/spec/discourse_api/api/site_settings_spec.rb +2 -3
- data/spec/discourse_api/api/sso_spec.rb +29 -25
- data/spec/discourse_api/api/topics_spec.rb +100 -31
- data/spec/discourse_api/api/uploads_spec.rb +16 -7
- data/spec/discourse_api/api/user_actions_spec.rb +13 -3
- data/spec/discourse_api/api/users_spec.rb +137 -55
- data/spec/discourse_api/client_spec.rb +32 -32
- data/spec/discourse_api/single_sign_on_spec.rb +15 -15
- data/spec/fixtures/categories.json +1 -1
- data/spec/spec_helper.rb +10 -15
- metadata +55 -12
data/spec/spec_helper.rb
CHANGED
@@ -1,17 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require
|
2
|
+
require "simplecov"
|
3
3
|
|
4
|
-
SimpleCov.formatter =
|
5
|
-
SimpleCov::Formatter::HTMLFormatter
|
6
|
-
])
|
4
|
+
SimpleCov.formatter =
|
5
|
+
SimpleCov::Formatter::MultiFormatter.new([SimpleCov::Formatter::HTMLFormatter])
|
7
6
|
|
8
|
-
SimpleCov.start
|
9
|
-
add_filter "/spec/"
|
10
|
-
end
|
7
|
+
SimpleCov.start { add_filter "/spec/" }
|
11
8
|
|
12
|
-
require
|
13
|
-
require
|
14
|
-
require
|
9
|
+
require "discourse_api"
|
10
|
+
require "rspec"
|
11
|
+
require "webmock/rspec"
|
15
12
|
|
16
13
|
RSpec.configure do |config|
|
17
14
|
config.expect_with :rspec do |c|
|
@@ -22,7 +19,7 @@ end
|
|
22
19
|
WebMock.disable_net_connect!(allow_localhost: true)
|
23
20
|
|
24
21
|
def host
|
25
|
-
|
22
|
+
"http://localhost:3000"
|
26
23
|
end
|
27
24
|
|
28
25
|
def a_delete(path)
|
@@ -62,11 +59,9 @@ def fixture_path
|
|
62
59
|
end
|
63
60
|
|
64
61
|
def fixture(file)
|
65
|
-
File.new(fixture_path +
|
62
|
+
File.new(fixture_path + "/" + file)
|
66
63
|
end
|
67
64
|
|
68
65
|
def escape_params(params)
|
69
|
-
params.map
|
70
|
-
[CGI.escape(key), value].join('=')
|
71
|
-
end.join('&')
|
66
|
+
params.map { |key, value| [CGI.escape(key), value].join("=") }.join("&")
|
72
67
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: discourse_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Saffron
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2023-05-26 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: faraday
|
@@ -19,28 +19,42 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - "~>"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '2.7'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - "~>"
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
29
|
+
version: '2.7'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
|
-
name:
|
31
|
+
name: faraday-follow_redirects
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
requirements:
|
34
|
-
- - "
|
34
|
+
- - ">="
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: '
|
36
|
+
version: '0'
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
|
-
- - "
|
41
|
+
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: '
|
43
|
+
version: '0'
|
44
|
+
- !ruby/object:Gem::Dependency
|
45
|
+
name: faraday-multipart
|
46
|
+
requirement: !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- - ">="
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '0'
|
51
|
+
type: :runtime
|
52
|
+
prerelease: false
|
53
|
+
version_requirements: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0'
|
44
58
|
- !ruby/object:Gem::Dependency
|
45
59
|
name: rack
|
46
60
|
requirement: !ruby/object:Gem::Requirement
|
@@ -173,14 +187,42 @@ dependencies:
|
|
173
187
|
requirements:
|
174
188
|
- - "~>"
|
175
189
|
- !ruby/object:Gem::Version
|
176
|
-
version: 2.
|
190
|
+
version: 3.2.0
|
191
|
+
type: :development
|
192
|
+
prerelease: false
|
193
|
+
version_requirements: !ruby/object:Gem::Requirement
|
194
|
+
requirements:
|
195
|
+
- - "~>"
|
196
|
+
- !ruby/object:Gem::Version
|
197
|
+
version: 3.2.0
|
198
|
+
- !ruby/object:Gem::Dependency
|
199
|
+
name: syntax_tree
|
200
|
+
requirement: !ruby/object:Gem::Requirement
|
201
|
+
requirements:
|
202
|
+
- - "~>"
|
203
|
+
- !ruby/object:Gem::Version
|
204
|
+
version: 6.1.1
|
205
|
+
type: :development
|
206
|
+
prerelease: false
|
207
|
+
version_requirements: !ruby/object:Gem::Requirement
|
208
|
+
requirements:
|
209
|
+
- - "~>"
|
210
|
+
- !ruby/object:Gem::Version
|
211
|
+
version: 6.1.1
|
212
|
+
- !ruby/object:Gem::Dependency
|
213
|
+
name: syntax_tree-disable_ternary
|
214
|
+
requirement: !ruby/object:Gem::Requirement
|
215
|
+
requirements:
|
216
|
+
- - "~>"
|
217
|
+
- !ruby/object:Gem::Version
|
218
|
+
version: 1.0.0
|
177
219
|
type: :development
|
178
220
|
prerelease: false
|
179
221
|
version_requirements: !ruby/object:Gem::Requirement
|
180
222
|
requirements:
|
181
223
|
- - "~>"
|
182
224
|
- !ruby/object:Gem::Version
|
183
|
-
version:
|
225
|
+
version: 1.0.0
|
184
226
|
description: Discourse API
|
185
227
|
email:
|
186
228
|
- sam.saffron@gmail.com
|
@@ -194,6 +236,7 @@ files:
|
|
194
236
|
- ".github/workflows/ci.yml"
|
195
237
|
- ".gitignore"
|
196
238
|
- ".rubocop.yml"
|
239
|
+
- ".streerc"
|
197
240
|
- CHANGELOG.md
|
198
241
|
- Gemfile
|
199
242
|
- Guardfile
|
@@ -341,7 +384,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
341
384
|
requirements:
|
342
385
|
- - ">="
|
343
386
|
- !ruby/object:Gem::Version
|
344
|
-
version: 2.
|
387
|
+
version: 2.7.0
|
345
388
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
346
389
|
requirements:
|
347
390
|
- - ">="
|