rocketchat 0.0.8 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/lib/rocket_chat/gem_version.rb +1 -1
- data/lib/rocket_chat/messages/settings.rb +45 -0
- data/lib/rocket_chat/session.rb +8 -0
- data/lib/rocketchat.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63e5c3e6c2532784d89443021ab60e3cdcd7f6a9
|
4
|
+
data.tar.gz: bd1d984b6706dad200ca49dde43c56de337bb4b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7d31791d785e2198e312c003a9260a75e2677b6485d7587915ee9cf7b526a54dd43ea8887a0a8e41816db597bf4bfc67cb4b293cad0de52d23085149c6a086b
|
7
|
+
data.tar.gz: 1c0168a638feef734657f0d6ee7190c8e10e42f19370902493618f9e314fca21bce52f593cde9c70fb68b97cd1b0ecefbd6aba0ba53b9c0559c9763e66a3db90
|
data/README.md
CHANGED
@@ -35,7 +35,7 @@ This gem supports the following Rocket.Chat APIs (Tested against Rocket.Chat v0.
|
|
35
35
|
* [/api/v1/logout](#authentication)
|
36
36
|
* /api/v1/me
|
37
37
|
|
38
|
-
|
38
|
+
#### Users
|
39
39
|
* [/api/v1/users.create](docs/users.md#userscreate)
|
40
40
|
* [/api/v1/users.delete](docs/users.md#usersdelete)
|
41
41
|
* [/api/v1/users.getPresence](docs/users.md#usersgetpresence)
|
@@ -44,6 +44,9 @@ This gem supports the following Rocket.Chat APIs (Tested against Rocket.Chat v0.
|
|
44
44
|
* [/api/v1/users.setAvatar](docs/users.md#userssetavatar)
|
45
45
|
* [/api/v1/users.update](docs/users.md#usersupdate)
|
46
46
|
|
47
|
+
#### Settings
|
48
|
+
* [/api/v1/settings/:_id](docs/settings.md#settingsget)
|
49
|
+
|
47
50
|
|
48
51
|
## Usage
|
49
52
|
|
@@ -74,6 +77,7 @@ session.logout
|
|
74
77
|
For details of specific APIs:
|
75
78
|
|
76
79
|
* [Users](docs/users.md)
|
80
|
+
* [Settings](docs/settings.md)
|
77
81
|
|
78
82
|
|
79
83
|
## Contributing
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module RocketChat
|
2
|
+
module Messages
|
3
|
+
#
|
4
|
+
# Rocket.Chat Settings messages
|
5
|
+
#
|
6
|
+
class Settings
|
7
|
+
#
|
8
|
+
# @param [Session] session Session
|
9
|
+
#
|
10
|
+
def initialize(session)
|
11
|
+
@session = session
|
12
|
+
end
|
13
|
+
|
14
|
+
#
|
15
|
+
# settings get REST API
|
16
|
+
# @param [String] id Setting id
|
17
|
+
# @return [various]
|
18
|
+
# @raise [HTTPError, StatusError]
|
19
|
+
#
|
20
|
+
def [](id)
|
21
|
+
response = session.request_json(
|
22
|
+
"/api/v1/settings/#{id}"
|
23
|
+
)
|
24
|
+
|
25
|
+
response['value'] if response['success']
|
26
|
+
end
|
27
|
+
|
28
|
+
def []=(id, value)
|
29
|
+
response = session.request_json(
|
30
|
+
"/api/v1/settings/#{id}",
|
31
|
+
method: :post,
|
32
|
+
body: {
|
33
|
+
value: value
|
34
|
+
}
|
35
|
+
)
|
36
|
+
|
37
|
+
value if response['success']
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
attr_reader :session
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
data/lib/rocket_chat/session.rb
CHANGED
@@ -47,5 +47,13 @@ module RocketChat
|
|
47
47
|
def users
|
48
48
|
@users ||= RocketChat::Messages::User.new(self)
|
49
49
|
end
|
50
|
+
|
51
|
+
#
|
52
|
+
# Settings messages proxy
|
53
|
+
# @return [Messages::Settings]
|
54
|
+
#
|
55
|
+
def settings
|
56
|
+
@settings ||= RocketChat::Messages::Settings.new(self)
|
57
|
+
end
|
50
58
|
end
|
51
59
|
end
|
data/lib/rocketchat.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rocketchat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- int512
|
@@ -115,6 +115,7 @@ files:
|
|
115
115
|
- lib/rocket_chat/error.rb
|
116
116
|
- lib/rocket_chat/gem_version.rb
|
117
117
|
- lib/rocket_chat/info.rb
|
118
|
+
- lib/rocket_chat/messages/settings.rb
|
118
119
|
- lib/rocket_chat/messages/user.rb
|
119
120
|
- lib/rocket_chat/presence_status.rb
|
120
121
|
- lib/rocket_chat/request_helper.rb
|