trello_flow 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trello_flow/api/card.rb +13 -2
- data/lib/trello_flow/api/item.rb +3 -2
- data/lib/trello_flow/main.rb +5 -5
- data/lib/trello_flow/version.rb +1 -1
- data/lib/trello_flow.rb +0 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f99d2bf54687421b7cf14354599c6403cb4296d2
|
4
|
+
data.tar.gz: 1267f4c7f3c1bf9b7d71881b07eb8a974b5c48ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a37bf292d08da928d2846dd8c4afdc58a2b5cf50300a87ef094df11fd1e611309da443316ac45146aaa9478db3bd9095290ddf19e7fc55cd7b2c0fe6c2e8db16
|
7
|
+
data.tar.gz: 4254950004330b58bee324d9bf34095f7bbe87283bc1b0c09a04c6c8d6a68ef8304edac4f029eea152842f1a7d12f6ed9e9d03773b2231deea664cebf75ae0cf
|
data/lib/trello_flow/api/card.rb
CHANGED
@@ -12,8 +12,13 @@ module TrelloFlow
|
|
12
12
|
find(id)
|
13
13
|
end
|
14
14
|
|
15
|
-
def self.for(
|
16
|
-
with("members/:username/cards/open").where(username: username)
|
15
|
+
def self.for(user)
|
16
|
+
with("members/:username/cards/open").where(username: user.username)
|
17
|
+
end
|
18
|
+
|
19
|
+
def add_member(user)
|
20
|
+
return if member_ids.include?(user.id)
|
21
|
+
self.class.with("cards/:id/members").where(id: id, value: user.id).post
|
17
22
|
end
|
18
23
|
|
19
24
|
def find_or_create_checklist
|
@@ -23,6 +28,12 @@ module TrelloFlow
|
|
23
28
|
def url
|
24
29
|
attributes[:shortUrl]
|
25
30
|
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def member_ids
|
35
|
+
attributes["idMembers"] || []
|
36
|
+
end
|
26
37
|
end
|
27
38
|
end
|
28
39
|
end
|
data/lib/trello_flow/api/item.rb
CHANGED
@@ -28,8 +28,9 @@ module TrelloFlow
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def assign(owner)
|
31
|
-
return if mentions.include?(owner)
|
32
|
-
self.class.request :put, "cards/#{card_id}/checklist/#{checklist_id}/checkItem/#{id}/name", value: name_without_mentions + " @#{owner}"
|
31
|
+
return if mentions.include?(owner.username)
|
32
|
+
self.class.request :put, "cards/#{card_id}/checklist/#{checklist_id}/checkItem/#{id}/name", value: name_without_mentions + " @#{owner.username}"
|
33
|
+
card.add_member(owner)
|
33
34
|
end
|
34
35
|
|
35
36
|
def complete
|
data/lib/trello_flow/main.rb
CHANGED
@@ -14,12 +14,12 @@ module TrelloFlow
|
|
14
14
|
|
15
15
|
checklist = card.find_or_create_checklist
|
16
16
|
item = checklist.select_or_create_item(name)
|
17
|
-
item.assign(
|
17
|
+
item.assign(current_user)
|
18
18
|
Branch.from_item(item).checkout
|
19
19
|
end
|
20
20
|
|
21
21
|
def open
|
22
|
-
Branch.current.open_trello(
|
22
|
+
Branch.current.open_trello(current_user)
|
23
23
|
end
|
24
24
|
|
25
25
|
def finish
|
@@ -50,11 +50,11 @@ module TrelloFlow
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def pick_existing_card
|
53
|
-
Table.pick Api::Card.for(
|
53
|
+
Table.pick Api::Card.for(current_user)
|
54
54
|
end
|
55
55
|
|
56
|
-
def
|
57
|
-
@
|
56
|
+
def current_user
|
57
|
+
@_current_user ||= Api::Member.current
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
data/lib/trello_flow/version.rb
CHANGED
data/lib/trello_flow.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trello_flow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jens Balvig
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|