ruboty-toggl_team 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 28a13c43cbbca66f8a5650acb8ae0cf86d51087f0a187d042d082e93f556bc3a
4
- data.tar.gz: 79af0f9046069a1881532a21fb7dcb890ba4ae748c06f28d593bad39d96a3203
3
+ metadata.gz: 387fc35235be107052ab84dab491fb8e9147288fb712d53fa625693fe74f1a34
4
+ data.tar.gz: '069ae7fad28b761f950d37dc21fc20f745258f79f6f179844e5003e80a6427df'
5
5
  SHA512:
6
- metadata.gz: 2888884c7b69369aaa54a9680d86732afd68a3d2ccf4a733556e931851dec82ea9605ef4b3719bac75e10b2e8d625ae0e823d38eb1b0983fc3791bb97cc6b9bf
7
- data.tar.gz: 8fdc080e2554bad3e31a89053f7d9febfb3086fb8965d2d26bfa8ba61674978738b6927d8b0abf64da82b6f42dc791013360965d2089bbdc92aff092c451de29
6
+ metadata.gz: 3ade8193f092dfc8daa1b0e419929e9a772c1452b974af6c9148133661878dae514ead63d4c3670ffed1491be018e5c78dbe05787dbdaea6f8f18e3145c18540
7
+ data.tar.gz: 9317ef42b3f628105fb7f9ef65412f86e0c571360095728a370dc28bf0e86726b9dbef41e2cf34f5cf31fc788d22452edda01e365abb17a2c47a26c11dd11f7d
data/README.md CHANGED
@@ -24,6 +24,11 @@ Set workspace(name).
24
24
  ruboty toggl set-workspace <workspace-name>
25
25
  ```
26
26
 
27
+ ### Get project names
28
+
29
+ ```
30
+ projects
31
+ ```
27
32
  ### Start task
28
33
 
29
34
  ```
@@ -15,6 +15,13 @@ module Ruboty
15
15
  description: 'set toggl workspace name'
16
16
  )
17
17
 
18
+ on(
19
+ /^projects$/,
20
+ name: 'projects',
21
+ description: 'get projects',
22
+ all: true
23
+ )
24
+
18
25
  on(
19
26
  /^start (?<task>\S+)(?<project_name>.*)/,
20
27
  name: 'start',
@@ -37,6 +44,10 @@ module Ruboty
37
44
  action(message).set_workspace
38
45
  end
39
46
 
47
+ def projects(message)
48
+ action(message).projects
49
+ end
50
+
40
51
  def start(message)
41
52
  action(message).start
42
53
  end
@@ -37,6 +37,15 @@ module Ruboty
37
37
  message.reply("error! #{e}")
38
38
  end
39
39
 
40
+ def projects
41
+ unless user_token && user_workspace
42
+ message.reply("please set #{user}'s toggl token and workspace!") and return
43
+ end
44
+
45
+ projects = toggl.projects(user_workspace['id'], active: true)
46
+ message.reply(projects.map {|p| p['name'] }.join("\n"))
47
+ end
48
+
40
49
  def start
41
50
  unless user_token && user_workspace
42
51
  message.reply("please set #{user}'s toggl token and workspace!") and return
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module TogglTeam
3
- VERSION = "0.2.0"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty-toggl_team
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kimromi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-26 00:00:00.000000000 Z
11
+ date: 2019-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruboty