discourse_api 0.4.3 → 0.4.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: de86c959cd3684d4a57978d3023333a50ef06346
4
- data.tar.gz: 6b45438b44e767e41a6e2588291fd8630a4ad821
3
+ metadata.gz: a8bfbf08cac232e8db407b3c443cf5c0a231b203
4
+ data.tar.gz: 2d738a394e1bfafbc019055380adc1a865878e2d
5
5
  SHA512:
6
- metadata.gz: a529fe5b5b23fb05b75ec05da3d8b6abd470e6361dd8c284a80218c10963b4150a51906d9d77995dd4aafa42e45d8d633582808c0e72e5c1878bd7547637cb1d
7
- data.tar.gz: f08590e96b69f74d0df212ff02335a92dd4bcec863586f8ff850de2d98265549232cb7cff449c54f97dddf6871e28a672af822a081758a6873bc9e0d8b32fef9
6
+ metadata.gz: e16cbaa04e7bc0976b85e7c56445d252ea166c724215349f4cef2389536e16b3f204dda6d4823f08d389e4e4c363b87ebc3c9b70d11924cb7c3da36a9a3935d0
7
+ data.tar.gz: 9365bb0c6b7a48f744ac89bca8389def7655b1d74e10715488547298c1306f6c85da1f01394c16fdc969bd775f2c1d399821fced83a598d23a777167a4950223
data/README.md CHANGED
@@ -1,9 +1,7 @@
1
1
  # DiscourseApi
2
2
 
3
- [![Build Status](https://travis-ci.org/discourse/discourse_api.pong?branch=master)][travis]
4
3
  [![Code Climate](https://codeclimate.com/github/discourse/discourse_api.png)][codeclimate]
5
4
 
6
- [travis]: http://travis-ci.org/discourse/discourse_api
7
5
  [codeclimate]: https://codeclimate.com/github/discourse/discourse_api
8
6
 
9
7
  The Discourse API gem allows you to consume the Discourse API
@@ -30,5 +30,4 @@ Gem::Specification.new do |spec|
30
30
  spec.add_development_dependency "guard", "~> 2.6"
31
31
  spec.add_development_dependency "rb-inotify", "~> 0.9"
32
32
  spec.add_development_dependency "simplecov", "~> 0.9"
33
- spec.add_development_dependency "dotenv", ">= 1.0", "< 3.0"
34
33
  end
@@ -0,0 +1,14 @@
1
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
+ require File.expand_path('../../lib/discourse_api', __FILE__)
3
+
4
+ client = DiscourseApi::Client.new("http://localhost:3000")
5
+ client.api_key = "YOUR_API_KEY"
6
+ client.api_username = "YOUR_USERNAME"
7
+
8
+ # create user
9
+ client.create_user(
10
+ name: "Bruce Wayne",
11
+ email: "bruce@wayne.com",
12
+ username: "batman",
13
+ password: "WhySoSerious"
14
+ )
data/examples/groups.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
2
  require File.expand_path('../../lib/discourse_api', __FILE__)
3
3
 
4
- Dotenv.load
5
4
  client = DiscourseApi::Client.new
6
5
 
7
6
  response = client.create_group(name: "engineering_team")
@@ -1,4 +1,3 @@
1
- require 'dotenv'
2
1
  require 'faraday'
3
2
  require 'faraday_middleware'
4
3
  require 'json'
@@ -40,9 +39,7 @@ module DiscourseApi
40
39
  include DiscourseApi::API::ApiKey
41
40
  include DiscourseApi::API::Backups
42
41
 
43
- def initialize(host = ENV["DISCOURSE_URL"],
44
- api_key = ENV["DISCOURSE_API_KEY"],
45
- api_username = ENV["DISCOURSE_USERNAME"])
42
+ def initialize(host, api_key = nil, api_username = nil)
46
43
  raise ArgumentError, 'host needs to be defined' if host.nil? || host.empty?
47
44
  @host = host
48
45
  @api_key = api_key
@@ -1,3 +1,3 @@
1
1
  module DiscourseApi
2
- VERSION = "0.4.3"
2
+ VERSION = "0.4.4"
3
3
  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.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-05-30 00:00:00.000000000 Z
13
+ date: 2015-06-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday
@@ -166,26 +166,6 @@ dependencies:
166
166
  - - "~>"
167
167
  - !ruby/object:Gem::Version
168
168
  version: '0.9'
169
- - !ruby/object:Gem::Dependency
170
- name: dotenv
171
- requirement: !ruby/object:Gem::Requirement
172
- requirements:
173
- - - ">="
174
- - !ruby/object:Gem::Version
175
- version: '1.0'
176
- - - "<"
177
- - !ruby/object:Gem::Version
178
- version: '3.0'
179
- type: :development
180
- prerelease: false
181
- version_requirements: !ruby/object:Gem::Requirement
182
- requirements:
183
- - - ">="
184
- - !ruby/object:Gem::Version
185
- version: '1.0'
186
- - - "<"
187
- - !ruby/object:Gem::Version
188
- version: '3.0'
189
169
  description: Discourse API
190
170
  email:
191
171
  - sam.saffron@gmail.com
@@ -207,6 +187,7 @@ files:
207
187
  - examples/backups.rb
208
188
  - examples/category.rb
209
189
  - examples/create_topic.rb
190
+ - examples/create_user.rb
210
191
  - examples/disposable_invite_tokens.rb
211
192
  - examples/example.rb
212
193
  - examples/groups.rb