trello_flow 3.7.1 → 3.8.0
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/lib/trello_flow/api/card.rb +0 -4
- data/lib/trello_flow/branch.rb +7 -13
- data/lib/trello_flow/branch_name.rb +30 -0
- data/lib/trello_flow/cli.rb +3 -4
- data/lib/trello_flow/main.rb +1 -1
- data/lib/trello_flow/pull_request.rb +4 -2
- data/lib/trello_flow/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: a0616f6846753dffe0c73a6e08926f5b7ab7a1a8
|
4
|
+
data.tar.gz: 985fcdf1d7bad05ea11cd2858c4a6a58eaef3afe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95c22b4aeb7f688cafc149fb20c630c2bab5795eb753a172db6a1f013bccb40f089b0bc822ba1037cd3bee2c1cb3882ae513e589ccf81ca0c8229a08c4c2d513
|
7
|
+
data.tar.gz: fe2901bcb364f8ba8773c28642b8457c8d7b10256a1ebf752da9b50fcc3848dccb9db20c5600e1dc1664831e01c9a0100417972e01719becb6bb049c22161025
|
data/lib/trello_flow/api/card.rb
CHANGED
data/lib/trello_flow/branch.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "active_support/core_ext/string/inflections"
|
2
2
|
require "trello_flow/pull_request"
|
3
|
+
require "trello_flow/branch_name"
|
3
4
|
|
4
5
|
module TrelloFlow
|
5
6
|
class Branch
|
@@ -12,7 +13,7 @@ module TrelloFlow
|
|
12
13
|
end
|
13
14
|
|
14
15
|
def self.from_card(user:, card:)
|
15
|
-
new(
|
16
|
+
new BranchName.new(user: user, target: current.target, card: card).to_s
|
16
17
|
end
|
17
18
|
|
18
19
|
def checkout
|
@@ -24,10 +25,11 @@ module TrelloFlow
|
|
24
25
|
end
|
25
26
|
|
26
27
|
def open_pull_request(options = {})
|
27
|
-
PullRequest.new
|
28
|
+
pr = PullRequest.new options.merge(card: current_card, from: name, target: target)
|
29
|
+
pr.open
|
28
30
|
end
|
29
31
|
|
30
|
-
def open_trello(
|
32
|
+
def open_trello(config)
|
31
33
|
if current_card
|
32
34
|
Cli.open_url current_card.url
|
33
35
|
else
|
@@ -36,11 +38,7 @@ module TrelloFlow
|
|
36
38
|
end
|
37
39
|
|
38
40
|
def target
|
39
|
-
|
40
|
-
name_parts.first
|
41
|
-
else
|
42
|
-
name_parts[-2] || name
|
43
|
-
end
|
41
|
+
name_parts[2] || name
|
44
42
|
end
|
45
43
|
|
46
44
|
private
|
@@ -52,11 +50,7 @@ module TrelloFlow
|
|
52
50
|
end
|
53
51
|
|
54
52
|
def card_short_link
|
55
|
-
|
56
|
-
end
|
57
|
-
|
58
|
-
def legacy_naming?
|
59
|
-
name_parts.size == 3
|
53
|
+
name_parts[3]
|
60
54
|
end
|
61
55
|
|
62
56
|
def name_parts
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module TrelloFlow
|
2
|
+
class BranchName
|
3
|
+
def initialize(user:, target:, card:)
|
4
|
+
@user = user
|
5
|
+
@target = target
|
6
|
+
@card = card
|
7
|
+
end
|
8
|
+
|
9
|
+
def to_s
|
10
|
+
parts.join(".")
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
attr_reader :user, :target, :card
|
16
|
+
|
17
|
+
def parts
|
18
|
+
parts = []
|
19
|
+
parts << user.initials.downcase
|
20
|
+
parts << title
|
21
|
+
parts << target
|
22
|
+
parts << card.short_link
|
23
|
+
parts
|
24
|
+
end
|
25
|
+
|
26
|
+
def title
|
27
|
+
card.name.parameterize[0..50]
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/lib/trello_flow/cli.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require "colored"
|
2
|
-
require "
|
2
|
+
require "active_support/core_ext/module/delegation"
|
3
3
|
require "highline"
|
4
4
|
require "hirb-colors"
|
5
5
|
require "hirb"
|
@@ -7,12 +7,11 @@ require "hirb"
|
|
7
7
|
module TrelloFlow
|
8
8
|
class Cli
|
9
9
|
class << self
|
10
|
-
|
11
|
-
def_delegators :client, :table, :open_url, :say, :success, :ask, :title, :error, :run, :read
|
10
|
+
delegate :table, :open_url, :say, :success, :ask, :title, :error, :run, :read, to: :client
|
12
11
|
attr_accessor :client
|
13
12
|
end
|
14
13
|
|
15
|
-
self.client =
|
14
|
+
self.client = new
|
16
15
|
|
17
16
|
def table(items)
|
18
17
|
puts Hirb::Helpers::AutoTable.render(items, unicode: true)
|
data/lib/trello_flow/main.rb
CHANGED
@@ -2,7 +2,7 @@ require "trello_flow/repo"
|
|
2
2
|
|
3
3
|
module TrelloFlow
|
4
4
|
class PullRequest
|
5
|
-
def initialize(
|
5
|
+
def initialize(from:, target:, card: nil, **options)
|
6
6
|
@card = card
|
7
7
|
@from = from
|
8
8
|
@target = target
|
@@ -22,6 +22,7 @@ module TrelloFlow
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def title
|
25
|
+
return unless card
|
25
26
|
card_name + " [Delivers ##{card.short_link}]"
|
26
27
|
end
|
27
28
|
|
@@ -30,6 +31,7 @@ module TrelloFlow
|
|
30
31
|
end
|
31
32
|
|
32
33
|
def body
|
34
|
+
return unless card
|
33
35
|
body = "Trello: #{card.short_url}"
|
34
36
|
body << release_note unless release_branch?
|
35
37
|
body
|
@@ -55,7 +57,7 @@ module TrelloFlow
|
|
55
57
|
end
|
56
58
|
|
57
59
|
def escape(text)
|
58
|
-
URI.escape text.strip
|
60
|
+
URI.escape text.to_s.strip
|
59
61
|
end
|
60
62
|
|
61
63
|
def repo
|
data/lib/trello_flow/version.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: 3.
|
4
|
+
version: 3.8.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: 2017-
|
11
|
+
date: 2017-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -281,6 +281,7 @@ files:
|
|
281
281
|
- lib/trello_flow/api/list.rb
|
282
282
|
- lib/trello_flow/api/member.rb
|
283
283
|
- lib/trello_flow/branch.rb
|
284
|
+
- lib/trello_flow/branch_name.rb
|
284
285
|
- lib/trello_flow/cleanup.rb
|
285
286
|
- lib/trello_flow/cli.rb
|
286
287
|
- lib/trello_flow/config_store.rb
|