discourse_api 0.11.0 → 0.12.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.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +21 -21
  3. data/.travis.yml +5 -5
  4. data/CHANGELOG.md +105 -99
  5. data/Gemfile +4 -4
  6. data/Guardfile +5 -5
  7. data/LICENSE.txt +22 -22
  8. data/README.md +73 -73
  9. data/Rakefile +7 -7
  10. data/discourse_api.gemspec +35 -35
  11. data/examples/backups.rb +18 -18
  12. data/examples/category.rb +21 -21
  13. data/examples/change_topic_status.rb +33 -33
  14. data/examples/create_topic.rb +23 -23
  15. data/examples/create_user.rb +14 -14
  16. data/examples/dashboard.rb +13 -13
  17. data/examples/disposable_invite_tokens.rb +18 -18
  18. data/examples/example.rb +9 -9
  19. data/examples/groups.rb +25 -25
  20. data/examples/invite_users.rb +15 -15
  21. data/examples/post_action.rb +25 -25
  22. data/examples/search.rb +9 -9
  23. data/examples/sso.rb +14 -14
  24. data/examples/topic_lists.rb +15 -15
  25. data/examples/update_user.rb +22 -22
  26. data/lib/discourse_api.rb +5 -5
  27. data/lib/discourse_api/api/api_key.rb +31 -31
  28. data/lib/discourse_api/api/backups.rb +24 -24
  29. data/lib/discourse_api/api/badges.rb +28 -28
  30. data/lib/discourse_api/api/categories.rb +57 -57
  31. data/lib/discourse_api/api/dashboard.rb +24 -24
  32. data/lib/discourse_api/api/email.rb +15 -15
  33. data/lib/discourse_api/api/groups.rb +52 -52
  34. data/lib/discourse_api/api/invite.rb +17 -17
  35. data/lib/discourse_api/api/notifications.rb +9 -9
  36. data/lib/discourse_api/api/params.rb +55 -55
  37. data/lib/discourse_api/api/posts.rb +41 -41
  38. data/lib/discourse_api/api/private_messages.rb +10 -10
  39. data/lib/discourse_api/api/search.rb +19 -19
  40. data/lib/discourse_api/api/sso.rb +22 -22
  41. data/lib/discourse_api/api/tags.rb +10 -10
  42. data/lib/discourse_api/api/topics.rb +78 -78
  43. data/lib/discourse_api/api/users.rb +93 -85
  44. data/lib/discourse_api/client.rb +133 -133
  45. data/lib/discourse_api/error.rb +17 -17
  46. data/lib/discourse_api/single_sign_on.rb +110 -110
  47. data/lib/discourse_api/version.rb +3 -3
  48. data/routes.txt +203 -203
  49. data/spec/discourse_api/api/api_key_spec.rb +121 -121
  50. data/spec/discourse_api/api/backups_spec.rb +23 -23
  51. data/spec/discourse_api/api/badges_spec.rb +40 -40
  52. data/spec/discourse_api/api/categories_spec.rb +87 -87
  53. data/spec/discourse_api/api/email_spec.rb +39 -39
  54. data/spec/discourse_api/api/groups_spec.rb +94 -94
  55. data/spec/discourse_api/api/notifications_spec.rb +24 -24
  56. data/spec/discourse_api/api/params_spec.rb +32 -32
  57. data/spec/discourse_api/api/posts_spec.rb +41 -41
  58. data/spec/discourse_api/api/private_messages_spec.rb +22 -22
  59. data/spec/discourse_api/api/search_spec.rb +30 -30
  60. data/spec/discourse_api/api/sso_spec.rb +16 -16
  61. data/spec/discourse_api/api/topics_spec.rb +113 -113
  62. data/spec/discourse_api/api/users_spec.rb +255 -227
  63. data/spec/discourse_api/client_spec.rb +115 -115
  64. data/spec/fixtures/api.json +12 -12
  65. data/spec/fixtures/backups.json +12 -12
  66. data/spec/fixtures/badges.json +569 -569
  67. data/spec/fixtures/categories.json +72 -72
  68. data/spec/fixtures/category_latest_topics.json +92 -92
  69. data/spec/fixtures/category_topics.json +91 -91
  70. data/spec/fixtures/email_list_all.json +749 -749
  71. data/spec/fixtures/email_settings.json +13 -13
  72. data/spec/fixtures/generate_api_key.json +12 -12
  73. data/spec/fixtures/generate_master_key.json +7 -7
  74. data/spec/fixtures/groups.json +18 -18
  75. data/spec/fixtures/hot.json +113 -113
  76. data/spec/fixtures/latest.json +115 -115
  77. data/spec/fixtures/members_0.json +403 -403
  78. data/spec/fixtures/members_1.json +363 -363
  79. data/spec/fixtures/new.json +113 -113
  80. data/spec/fixtures/notifications.json +16 -16
  81. data/spec/fixtures/post.json +94 -94
  82. data/spec/fixtures/post_action_users.json +18 -18
  83. data/spec/fixtures/private_messages.json +69 -69
  84. data/spec/fixtures/regenerate_api_key.json +7 -7
  85. data/spec/fixtures/search.json +24 -24
  86. data/spec/fixtures/topic.json +739 -739
  87. data/spec/fixtures/topic_invite_user.json +3 -3
  88. data/spec/fixtures/topics_created_by.json +49 -49
  89. data/spec/fixtures/update_trust_level.json +37 -37
  90. data/spec/fixtures/upload_avatar.json +13 -13
  91. data/spec/fixtures/user.json +65 -65
  92. data/spec/fixtures/user_activate_success.json +3 -3
  93. data/spec/fixtures/user_badges.json +170 -170
  94. data/spec/fixtures/user_create_success.json +5 -5
  95. data/spec/fixtures/user_grant_admin.json +37 -37
  96. data/spec/fixtures/user_list.json +583 -583
  97. data/spec/fixtures/user_log_out_success.json +3 -3
  98. data/spec/fixtures/user_update_avatar_success.json +3 -3
  99. data/spec/fixtures/user_update_user.json +3 -3
  100. data/spec/fixtures/user_update_username.json +4 -4
  101. data/spec/spec_helper.rb +61 -61
  102. metadata +2 -2
@@ -1,3 +1,3 @@
1
- {
2
- "success": "OK"
3
- }
1
+ {
2
+ "success": "OK"
3
+ }
@@ -1,3 +1,3 @@
1
- {
2
- "success": "OK"
3
- }
1
+ {
2
+ "success": "OK"
3
+ }
@@ -1,3 +1,3 @@
1
- {
2
- "success": true
3
- }
1
+ {
2
+ "success": true
3
+ }
@@ -1,4 +1,4 @@
1
- {
2
- "id": 7,
3
- "username": "fake_user_2"
4
- }
1
+ {
2
+ "id": 7,
3
+ "username": "fake_user_2"
4
+ }
data/spec/spec_helper.rb CHANGED
@@ -1,61 +1,61 @@
1
- require 'simplecov'
2
-
3
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
4
- SimpleCov::Formatter::HTMLFormatter
5
- ])
6
-
7
- SimpleCov.start do
8
- add_filter "/spec/"
9
- end
10
-
11
- require 'discourse_api'
12
- require 'rspec'
13
- require 'webmock/rspec'
14
-
15
- RSpec.configure do |config|
16
- config.expect_with :rspec do |c|
17
- c.syntax = :expect
18
- end
19
- end
20
-
21
- WebMock.disable_net_connect!(:allow_localhost => true)
22
-
23
- def a_delete(path)
24
- a_request(:delete, path)
25
- end
26
-
27
- def a_get(path)
28
- a_request(:get, path)
29
- end
30
-
31
- def a_post(path)
32
- a_request(:post, path)
33
- end
34
-
35
- def a_put(path)
36
- a_request(:put, path)
37
- end
38
-
39
- def stub_delete(path)
40
- stub_request(:delete, path)
41
- end
42
-
43
- def stub_get(path)
44
- stub_request(:get, path)
45
- end
46
-
47
- def stub_post(path)
48
- stub_request(:post, path)
49
- end
50
-
51
- def stub_put(path)
52
- stub_request(:put, path)
53
- end
54
-
55
- def fixture_path
56
- File.expand_path("../fixtures", __FILE__)
57
- end
58
-
59
- def fixture(file)
60
- File.new(fixture_path + '/' + file)
61
- end
1
+ require 'simplecov'
2
+
3
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
4
+ SimpleCov::Formatter::HTMLFormatter
5
+ ])
6
+
7
+ SimpleCov.start do
8
+ add_filter "/spec/"
9
+ end
10
+
11
+ require 'discourse_api'
12
+ require 'rspec'
13
+ require 'webmock/rspec'
14
+
15
+ RSpec.configure do |config|
16
+ config.expect_with :rspec do |c|
17
+ c.syntax = :expect
18
+ end
19
+ end
20
+
21
+ WebMock.disable_net_connect!(:allow_localhost => true)
22
+
23
+ def a_delete(path)
24
+ a_request(:delete, path)
25
+ end
26
+
27
+ def a_get(path)
28
+ a_request(:get, path)
29
+ end
30
+
31
+ def a_post(path)
32
+ a_request(:post, path)
33
+ end
34
+
35
+ def a_put(path)
36
+ a_request(:put, path)
37
+ end
38
+
39
+ def stub_delete(path)
40
+ stub_request(:delete, path)
41
+ end
42
+
43
+ def stub_get(path)
44
+ stub_request(:get, path)
45
+ end
46
+
47
+ def stub_post(path)
48
+ stub_request(:post, path)
49
+ end
50
+
51
+ def stub_put(path)
52
+ stub_request(:put, path)
53
+ end
54
+
55
+ def fixture_path
56
+ File.expand_path("../fixtures", __FILE__)
57
+ end
58
+
59
+ def fixture(file)
60
+ File.new(fixture_path + '/' + file)
61
+ 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: 0.11.0
4
+ version: 0.12.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: 2016-09-04 00:00:00.000000000 Z
14
+ date: 2016-10-07 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: faraday