discourse_api 0.26.0 → 0.27.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/CHANGELOG.md +4 -0
- data/lib/discourse_api/api/site_settings.rb +12 -0
- data/lib/discourse_api/client.rb +2 -0
- data/lib/discourse_api/version.rb +1 -1
- data/spec/discourse_api/api/site_settings_spec.rb +17 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 027a0cf42cc22b38ef1231a6da581bd9712e8994b1146be486bf649a0a8fd43c
|
4
|
+
data.tar.gz: 8411ff9d157d4878882f0627015413177fe5ff4a74534a5ac354f0ff600d4429
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4fa3b475556573c567702f6e5480d1fcd9ed30208beeec66bf784e38ae0a8c109708b2098481fd23a69efbe8f5bd91ffa463726b16fe0b3ac8cccc0f682db30
|
7
|
+
data.tar.gz: 00a134e132b3b9731a7f0d2bc3b707627961110dab24f95fbe94db3f277347d7ae39d49cd496f61484e801f58516c07cc6c507ab7d1c7763622850683b4cb6ff
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
4
|
|
5
|
+
## [0.27.0] - 2018-09-14
|
6
|
+
### Added
|
7
|
+
- Added `site_settings_update` method
|
8
|
+
|
5
9
|
## [0.26.0] - 2018-09-10
|
6
10
|
### Added
|
7
11
|
- Added user `user_actions` endpoint so you can retrieve `user_replies` and
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module DiscourseApi
|
2
|
+
module API
|
3
|
+
module SiteSettings
|
4
|
+
def site_setting_update(args={})
|
5
|
+
params = API.params(args)
|
6
|
+
.required(:name, :value).to_h
|
7
|
+
new_site_setting = { params[:name] => params[:value] }
|
8
|
+
response = put("/admin/site_settings/#{params[:name]}", new_site_setting)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
data/lib/discourse_api/client.rb
CHANGED
@@ -21,6 +21,7 @@ require 'discourse_api/api/backups'
|
|
21
21
|
require 'discourse_api/api/dashboard'
|
22
22
|
require 'discourse_api/api/uploads'
|
23
23
|
require 'discourse_api/api/user_actions'
|
24
|
+
require 'discourse_api/api/site_settings'
|
24
25
|
|
25
26
|
module DiscourseApi
|
26
27
|
class Client
|
@@ -45,6 +46,7 @@ module DiscourseApi
|
|
45
46
|
include DiscourseApi::API::Dashboard
|
46
47
|
include DiscourseApi::API::Uploads
|
47
48
|
include DiscourseApi::API::UserActions
|
49
|
+
include DiscourseApi::API::SiteSettings
|
48
50
|
|
49
51
|
def initialize(host, api_key = nil, api_username = nil)
|
50
52
|
raise ArgumentError, 'host needs to be defined' if host.nil? || host.empty?
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe DiscourseApi::API::SiteSettings do
|
4
|
+
subject { DiscourseApi::Client.new("http://localhost:3000", "test_d7fd0429940", "test_user" )}
|
5
|
+
|
6
|
+
describe "#site_setting_update" do
|
7
|
+
before do
|
8
|
+
stub_put("http://localhost:3000/admin/site_settings/foo?api_key=test_d7fd0429940&api_username=test_user")
|
9
|
+
subject.site_setting_update(name: "foo", value: "bar")
|
10
|
+
end
|
11
|
+
|
12
|
+
it "makes a site_settings_update request" do
|
13
|
+
expect(a_put("http://localhost:3000/admin/site_settings/foo?api_key=test_d7fd0429940&api_username=test_user")
|
14
|
+
.with(body: "foo=bar")).to have_been_made
|
15
|
+
end
|
16
|
+
end
|
17
|
+
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.
|
4
|
+
version: 0.27.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: 2018-09-
|
14
|
+
date: 2018-09-14 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: faraday
|
@@ -220,6 +220,7 @@ files:
|
|
220
220
|
- lib/discourse_api/api/posts.rb
|
221
221
|
- lib/discourse_api/api/private_messages.rb
|
222
222
|
- lib/discourse_api/api/search.rb
|
223
|
+
- lib/discourse_api/api/site_settings.rb
|
223
224
|
- lib/discourse_api/api/sso.rb
|
224
225
|
- lib/discourse_api/api/tags.rb
|
225
226
|
- lib/discourse_api/api/topics.rb
|
@@ -242,6 +243,7 @@ files:
|
|
242
243
|
- spec/discourse_api/api/posts_spec.rb
|
243
244
|
- spec/discourse_api/api/private_messages_spec.rb
|
244
245
|
- spec/discourse_api/api/search_spec.rb
|
246
|
+
- spec/discourse_api/api/site_settings_spec.rb
|
245
247
|
- spec/discourse_api/api/sso_spec.rb
|
246
248
|
- spec/discourse_api/api/topics_spec.rb
|
247
249
|
- spec/discourse_api/api/uploads_spec.rb
|
@@ -327,6 +329,7 @@ test_files:
|
|
327
329
|
- spec/discourse_api/api/posts_spec.rb
|
328
330
|
- spec/discourse_api/api/private_messages_spec.rb
|
329
331
|
- spec/discourse_api/api/search_spec.rb
|
332
|
+
- spec/discourse_api/api/site_settings_spec.rb
|
330
333
|
- spec/discourse_api/api/sso_spec.rb
|
331
334
|
- spec/discourse_api/api/topics_spec.rb
|
332
335
|
- spec/discourse_api/api/uploads_spec.rb
|