discourse_api 0.26.0 → 0.27.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 34fb79c6ebf88b13b27124084931d6cd5f9123e00d322ab7dec1378313a1b7ec
4
- data.tar.gz: 2a5eac533a5798735fae8fbb0e6e7d9293b679bfaac7baf19129994a2f079d4b
3
+ metadata.gz: 027a0cf42cc22b38ef1231a6da581bd9712e8994b1146be486bf649a0a8fd43c
4
+ data.tar.gz: 8411ff9d157d4878882f0627015413177fe5ff4a74534a5ac354f0ff600d4429
5
5
  SHA512:
6
- metadata.gz: 3dd703fefbaae4b70f8011754faef120e430fc6dafcca5bef8020d6618c75d10920caa7455dbcb551b2f0c2105618a94a2c4590d02dcbbe89c1d51b2448f45ea
7
- data.tar.gz: 60c1008147db8883a5f0afb0f9f497c22ab8f9b4be06199f25cb2dc94edd7fa14768a9662a06fd5e369cb28187d31eb52289d9ffc7d59b2c2c96959436c62c9d
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
@@ -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?
@@ -1,3 +1,3 @@
1
1
  module DiscourseApi
2
- VERSION = "0.26.0"
2
+ VERSION = "0.27.0"
3
3
  end
@@ -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.26.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-10 00:00:00.000000000 Z
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