mattermost-ruby 0.1.0.1 → 0.1.1

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: 2dbd77cb69baccb0f56d2a2b2671ee3e602e5d52
4
- data.tar.gz: e78806366fcee69bcb32fb63ba09791633d2f415
3
+ metadata.gz: 840e068b319f9d5211b3264fb9c9611a5fef1d4e
4
+ data.tar.gz: ba85421a1c3b0dfc59b1a4f9c7ab8cb34c94355a
5
5
  SHA512:
6
- metadata.gz: 5c943f34990584343f93103fd4022fbe2ad3cbf41ae1003d8d87a9827e4de142c23e0bdf612f0030cef4b849ccc48d81ffebdc55decef21bf3875d87e5ee1e4b
7
- data.tar.gz: 9de2faac62461b67d860c814139b306b3d80d6d28dd09faf9ed09470ab4aa53eab55e9ffc8c004a424e0d7431c1fd40a4af0024a96486024a1f7db717d61e3fc
6
+ metadata.gz: 99235fefb90bb3b9964d1f5ceb4969e0d06c915aea3f2e58394441ff201057f4784335b4cfe535c62974629317090eebcad9fb8e749db666ecb6b676c8663816
7
+ data.tar.gz: b47b2fe3cb4c41d6c647ab2458d9be5d80610c2c6f1793438793fc9dad0b9cb2944c17efb2f93142034e9f089909c873051120529bfe29c0ea914ab11caddf29
data/.gitignore CHANGED
@@ -7,3 +7,6 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ mattermost-ruby*.gem
11
+ .DS_Store
12
+ test.rb
data/README.md CHANGED
@@ -7,7 +7,7 @@ An ActiveRecord-inspired API client for Mattermost
7
7
  Add this line to your application's Gemfile:
8
8
 
9
9
  ```ruby
10
- gem 'mattermost'
10
+ gem 'mattermost-ruby'
11
11
  ```
12
12
 
13
13
  And then execute:
@@ -16,25 +16,21 @@ And then execute:
16
16
 
17
17
  Or install it yourself as:
18
18
 
19
- $ gem install mattermost
19
+ $ gem install mattermost-ruby
20
20
 
21
21
  ## Configuration
22
22
 
23
23
  ```
24
24
  options = {:httparty => {:debug_output => $stdout} } # pass defaults to httparty
25
-
26
25
  Mattermost.connect("apiuser", "apipassword", "https://mattermost.example.com/api/v1", "default_team_name", options)
27
26
 
28
27
  users = Mattermost::User.all
29
-
30
28
  users.last.class #User
31
29
 
32
30
  users.last.reset_password("newpassword")
33
-
34
31
  users.last.id # abcdefgh12345678
35
32
 
36
33
  Mattermost::User.find("abcdefgh12345678")
37
-
38
34
  Mattermost::User.find_by(:email => "me@example.com") # <#User ...>
39
35
  ```
40
36
 
@@ -33,6 +33,10 @@ module Mattermost
33
33
  end
34
34
  end
35
35
 
36
+ def self.connected?
37
+ Mattermost.get("/users/me").success?
38
+ end
39
+
36
40
  def self.team
37
41
  @team
38
42
  end
@@ -13,19 +13,5 @@ module Mattermost
13
13
  end
14
14
  end
15
15
 
16
- def connected?
17
- self.class.base_uri
18
- end
19
-
20
- def self.before_method(*names)
21
- names.each do |name|
22
- m = name # public_class_method(name)
23
- define_method(name) do |*args, &block|
24
- yield
25
- m.bind(self).(*args, &block)
26
- end
27
- end
28
- end
29
-
30
16
  end
31
17
  end
@@ -3,4 +3,5 @@ class Team < Base
3
3
  def add_user(user)
4
4
  Mattermost.post("/teams/#{Mattermost.team.id}/add_user_to_team", :body => { :user_id => user.id })
5
5
  end
6
+
6
7
  end
@@ -1,3 +1,3 @@
1
1
  module Mattermost
2
- VERSION = "0.1.0.1"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mattermost-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.1
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Brody