3llo 0.1.10 → 0.1.11
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/README.md +1 -0
- data/lib/3llo/api/card.rb +13 -0
- data/lib/3llo/card_command_factory.rb +4 -0
- data/lib/3llo/commands/card/comment.rb +34 -0
- data/lib/3llo/commands/card/invalid.rb +1 -0
- data/lib/3llo/presenter/card/show.rb +3 -0
- data/lib/3llo/presenter/help.rb +1 -0
- data/lib/3llo/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e7e2c44a64f8a1b7ce84549c9ecc8c65c7bf793
|
4
|
+
data.tar.gz: bac8d528a87bc23510aefc254002392b3062de08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8d31fcd43b99d64453d7a0fe3cb79f691316b5438641c3cff14e494a81fcb8e7167672193cceaff61e970ac6a2014de3cf9d63047b1c2b447cd8f445f21e44a
|
7
|
+
data.tar.gz: 9b535ae6a132468c0d9c10372f65019d587836518cd2c5f4cd111c909165c744a5572c4d06cf21480b835dcc69d7d94f66d26f6f2ab6ecd694532ae6a4449993
|
data/README.md
CHANGED
@@ -46,6 +46,7 @@ There are a couple of commands available in 3llo.
|
|
46
46
|
* `card move <card_id> <list_id>`: Move card to a specified list.
|
47
47
|
* `card self-assign <card_id>`: Self-assign a card.
|
48
48
|
* `card comments <card_id>`: Show recent comments of a card.
|
49
|
+
* `card comment <card_id>`: Add a comment to a card.
|
49
50
|
* `list list`: List all the lists of the active board.
|
50
51
|
* `help`: Show help menu.
|
51
52
|
* `exit`: Exit.
|
data/lib/3llo/api/card.rb
CHANGED
@@ -104,6 +104,19 @@ module Tr3llo
|
|
104
104
|
)
|
105
105
|
end
|
106
106
|
|
107
|
+
def comment(card_id, text)
|
108
|
+
url = "/cards/#{card_id}/actions/comments"
|
109
|
+
JSON.parse(
|
110
|
+
client.post(
|
111
|
+
url,
|
112
|
+
key: api_key,
|
113
|
+
token: api_token,
|
114
|
+
text: text
|
115
|
+
),
|
116
|
+
symbolize_names: true
|
117
|
+
)
|
118
|
+
end
|
119
|
+
|
107
120
|
private
|
108
121
|
|
109
122
|
def api_key
|
@@ -5,6 +5,7 @@ require '3llo/commands/card/move'
|
|
5
5
|
require '3llo/commands/card/self_assign'
|
6
6
|
require '3llo/commands/card/invalid'
|
7
7
|
require '3llo/commands/card/comments'
|
8
|
+
require '3llo/commands/card/comment'
|
8
9
|
require '3llo/commands/card/add'
|
9
10
|
|
10
11
|
module Tr3llo
|
@@ -35,6 +36,9 @@ module Tr3llo
|
|
35
36
|
when 'comments'
|
36
37
|
card_id, _ = args
|
37
38
|
Command::Card::CommentsCommand.new(card_id)
|
39
|
+
when 'comment'
|
40
|
+
card_id, _ = args
|
41
|
+
Command::Card::CommentCommand.new(card_id)
|
38
42
|
when 'move'
|
39
43
|
card_id, _ = args
|
40
44
|
board_id = $container.resolve(:board)[:id]
|
@@ -0,0 +1,34 @@
|
|
1
|
+
module Tr3llo
|
2
|
+
module Command
|
3
|
+
module Card
|
4
|
+
class CommentCommand
|
5
|
+
def initialize(card_id)
|
6
|
+
@card_id = card_id
|
7
|
+
end
|
8
|
+
|
9
|
+
def execute
|
10
|
+
interface.print_frame do
|
11
|
+
text = interface.input.ask("Comment:")
|
12
|
+
|
13
|
+
interface.puts(
|
14
|
+
create_comment!(text) &&
|
15
|
+
"Comment created"
|
16
|
+
)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
attr_reader :card_id
|
23
|
+
|
24
|
+
def create_comment!(text)
|
25
|
+
API::Card.comment(@card_id, text)
|
26
|
+
end
|
27
|
+
|
28
|
+
def interface
|
29
|
+
$container.resolve(:interface)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -26,6 +26,9 @@ module Tr3llo
|
|
26
26
|
"Name: ".labelize + card[:name] + " (#{label_str})" "\n" +
|
27
27
|
"Description: ".labelize + card[:desc] + "\n" +
|
28
28
|
"List: ".labelize + card[:list][:name] + "\n" +
|
29
|
+
"Subscribed: ".labelize + (card[:badges][:subscribed] ? "Yes" : "No") + "\n" +
|
30
|
+
"Comments: ".labelize + card[:badges][:comments].to_s + "\n" +
|
31
|
+
"Attachments: ".labelize + card[:badges][:attachments].to_s + "\n" +
|
29
32
|
"Link: ".labelize + card[:shortUrl] + "\n"
|
30
33
|
)
|
31
34
|
end
|
data/lib/3llo/presenter/help.rb
CHANGED
@@ -29,6 +29,7 @@ module Tr3llo
|
|
29
29
|
card move <card_id> - Move card to a list
|
30
30
|
card self-assign <card_id> - Self-assign a card
|
31
31
|
card comments <card_id> - Load recent comments of a card
|
32
|
+
card comment <card_id> - Add a comment to a card
|
32
33
|
list list - Show all lists
|
33
34
|
list cards <list_id> - Show all cards in list
|
34
35
|
help - Show help menu
|
data/lib/3llo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: 3llo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cẩm Huỳnh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty-prompt
|
@@ -56,6 +56,7 @@ files:
|
|
56
56
|
- lib/3llo/commands/board/list.rb
|
57
57
|
- lib/3llo/commands/board/select.rb
|
58
58
|
- lib/3llo/commands/card/add.rb
|
59
|
+
- lib/3llo/commands/card/comment.rb
|
59
60
|
- lib/3llo/commands/card/comments.rb
|
60
61
|
- lib/3llo/commands/card/invalid.rb
|
61
62
|
- lib/3llo/commands/card/list.rb
|