nidobata 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/nidobata.rb +23 -0
- data/lib/nidobata/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9406b4676173d12fe4894d19c005421fa6b76b71
|
4
|
+
data.tar.gz: 18451da692b9cbd9a6ed160540702b8e5df0a827
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 493c84f5dce90d5ebc1eeefbdbede36613b66caabc22ac9b6773465b9eab6d705aff9f3aaaf2207373e4d37a681a033823c2ced60c9183c5e631c65b56673a6a
|
7
|
+
data.tar.gz: b117612bb6fd0463d9d61c2022947b1b2b8919e9a92845681c9dc3c0d9df0737f30fe09d616dbe126fb31dd4b37b582270eb649c39d26afad449f88e4fd2a3db
|
data/README.md
CHANGED
data/lib/nidobata.rb
CHANGED
@@ -41,6 +41,29 @@ module Nidobata
|
|
41
41
|
http.post('/api/messages', payload.to_json, default_headers).value
|
42
42
|
end
|
43
43
|
|
44
|
+
desc 'rooms [ORG_SLUG]', 'list rooms'
|
45
|
+
def rooms(slug = nil)
|
46
|
+
ensure_api_token
|
47
|
+
|
48
|
+
if slug
|
49
|
+
rooms_url = "/api/rooms?organization_slug=#{slug}"
|
50
|
+
org_slug = -> _ { slug }
|
51
|
+
else
|
52
|
+
rooms_url = "/api/rooms"
|
53
|
+
orgs = JSON.parse(http.get("/api/organizations", default_headers).tap(&:value).body)
|
54
|
+
org_slug = -> id do
|
55
|
+
org = orgs["organizations"].detect {|org| org["id"] == id }
|
56
|
+
org["slug"]
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
rooms = JSON.parse(http.get(rooms_url, default_headers).tap(&:value).body)
|
61
|
+
|
62
|
+
rooms["rooms"].each do |room|
|
63
|
+
puts "#{org_slug[room["organization_id"]]}/#{room["name"]}"
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
44
67
|
no_commands do
|
45
68
|
private
|
46
69
|
|
data/lib/nidobata/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nidobata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hibariya
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
105
|
version: '0'
|
106
106
|
requirements: []
|
107
107
|
rubyforge_project:
|
108
|
-
rubygems_version: 2.
|
108
|
+
rubygems_version: 2.6.8
|
109
109
|
signing_key:
|
110
110
|
specification_version: 4
|
111
111
|
summary: Read stdin and post it into idobata.io.
|