slackdo 0.3.4 → 0.3.5
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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +9 -1
- data/bin/slackdo +1 -0
- data/lib/slackdo.rb +29 -8
- data/lib/slackdo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b39828c03be73fb6c86aaa55c6c635f1dfff83b
|
4
|
+
data.tar.gz: c8f0c26aa86b691b342978a11d8f2e69b7f25d24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efd658ea8ad184d4067d25f3730947b462dd7a0aacb47627f93284dd82eb5417385387c0523338958875cc81103af482418389553cd0805f1e4f34cf83862807
|
7
|
+
data.tar.gz: 776cffa4e495eaf4de10ee359b8156ff04652d2e4d17b8adf4485b6aecd0a4d85c067857b35837294afc05dcc58e04b24561df96f6bd1877350e0af85a7e7e76
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -28,6 +28,13 @@ First thing you should do is configure your incoming webhook by doing the follow
|
|
28
28
|
slackdo configure slack
|
29
29
|
```
|
30
30
|
|
31
|
+
Next up is configuring your categories. To add or remove a category use:
|
32
|
+
|
33
|
+
```
|
34
|
+
slackdo category add
|
35
|
+
slackdo category remove
|
36
|
+
```
|
37
|
+
|
31
38
|
After that you're all set to go.
|
32
39
|
Add a new TODO item by using
|
33
40
|
|
@@ -55,10 +62,11 @@ slackdo task
|
|
55
62
|
|
56
63
|

|
57
64
|
|
58
|
-
You can add your label ids to the configuration to enable SlackDO to automatically assign labels to your cards. You can
|
65
|
+
You can add your label ids to the configuration to enable SlackDO to automatically assign labels to your cards. You can add or remove a label by doing the following:
|
59
66
|
|
60
67
|
```
|
61
68
|
slackdo label add
|
69
|
+
slackdo label remove
|
62
70
|
```
|
63
71
|
|
64
72
|
SlackDO will look for labels that have the same name as the category you have selected for your new task.
|
data/bin/slackdo
CHANGED
data/lib/slackdo.rb
CHANGED
@@ -18,7 +18,7 @@ module Slackdo
|
|
18
18
|
"trello_public_key" => "",
|
19
19
|
"trello_member_token" => "",
|
20
20
|
"trello_list_id" => "",
|
21
|
-
"
|
21
|
+
"trello_label_ids" => [],
|
22
22
|
"categories" => [GENERAL]
|
23
23
|
}
|
24
24
|
File.open("#{ENV['HOME']}/.slackdo/config.json",'w') do |f|
|
@@ -54,12 +54,33 @@ module Slackdo
|
|
54
54
|
file = File.read("#{ENV['HOME']}/.slackdo/config.json")
|
55
55
|
hash = JSON.parse(file)
|
56
56
|
id = $prompt.ask('What is the ID of the label you wish to add?')
|
57
|
-
hash['
|
57
|
+
hash['trello_label_ids'].push(id)
|
58
58
|
File.open("#{ENV['HOME']}/.slackdo/config.json",'w') do |f|
|
59
59
|
f.write(hash.to_json)
|
60
60
|
end
|
61
61
|
puts "Label with ID '#{id}' was added..."
|
62
62
|
end
|
63
|
+
def remove_label
|
64
|
+
Card.configure_trello
|
65
|
+
file = File.read("#{ENV['HOME']}/.slackdo/config.json")
|
66
|
+
hash = JSON.parse(file)
|
67
|
+
label_names = []
|
68
|
+
hash['trello_label_ids'].each do |i|
|
69
|
+
label_name = Trello::Label.find(i).name
|
70
|
+
label_names.push(label_name)
|
71
|
+
end
|
72
|
+
label = $prompt.select('What is the label you wish to remove?', label_names)
|
73
|
+
id = ""
|
74
|
+
hash['trello_label_ids'].each do |i|
|
75
|
+
label_name = Trello::Label.find(i).name
|
76
|
+
id = i if label_name == label
|
77
|
+
end
|
78
|
+
hash['trello_label_ids'].delete(id)
|
79
|
+
File.open("#{ENV['HOME']}/.slackdo/config.json",'w') do |f|
|
80
|
+
f.write(hash.to_json)
|
81
|
+
end
|
82
|
+
puts "Label '#{label}' was removed..."
|
83
|
+
end
|
63
84
|
def enable_trello
|
64
85
|
file = File.read("#{ENV['HOME']}/.slackdo/config.json")
|
65
86
|
hash = JSON.parse(file)
|
@@ -81,9 +102,9 @@ module Slackdo
|
|
81
102
|
def configure_trello_api
|
82
103
|
file = File.read("#{ENV['HOME']}/.slackdo/config.json")
|
83
104
|
hash = JSON.parse(file)
|
84
|
-
public_key = $prompt.ask('What is your Trello public key?')
|
85
|
-
member_token = $prompt.ask('What is your Trello member token?')
|
86
|
-
list_id = $prompt.ask('What is your
|
105
|
+
public_key = $prompt.ask('What is your Trello public key?', default: hash['trello_public_key'])
|
106
|
+
member_token = $prompt.ask('What is your Trello member token?', default: hash['trello_member_token'])
|
107
|
+
list_id = $prompt.ask('What is your Trello list ID where the cards should be created?', default: hash['trello_list_id'])
|
87
108
|
hash["trello_public_key"] = public_key
|
88
109
|
hash["trello_member_token"] = member_token
|
89
110
|
hash["allow_trello_pushing"] = "true"
|
@@ -96,7 +117,7 @@ module Slackdo
|
|
96
117
|
def configure_slack_webhook
|
97
118
|
file = File.read("#{ENV['HOME']}/.slackdo/config.json")
|
98
119
|
hash = JSON.parse(file)
|
99
|
-
webhook = $prompt.ask('What is your Slack webhook?')
|
120
|
+
webhook = $prompt.ask('What is your Slack webhook?', default: hash['slack_webhook'])
|
100
121
|
hash["slack_webhook"] = webhook
|
101
122
|
File.open("#{ENV['HOME']}/.slackdo/config.json",'w') do |f|
|
102
123
|
f.write(hash.to_json)
|
@@ -106,7 +127,7 @@ module Slackdo
|
|
106
127
|
end
|
107
128
|
|
108
129
|
class Card
|
109
|
-
def configure_trello
|
130
|
+
def self.configure_trello
|
110
131
|
file = File.read("#{ENV['HOME']}/.slackdo/config.json")
|
111
132
|
hash = JSON.parse(file)
|
112
133
|
Trello.configure do |config|
|
@@ -122,7 +143,7 @@ module Slackdo
|
|
122
143
|
card_name_full << "[#{card_category}]"
|
123
144
|
card_name_full << " #{card_name}"
|
124
145
|
label_id = ''
|
125
|
-
hash['
|
146
|
+
hash['trello_label_ids'].each do |id|
|
126
147
|
label = Trello::Label.find(id)
|
127
148
|
label_id = id if label.name == card_category
|
128
149
|
end
|
data/lib/slackdo/version.rb
CHANGED