prima-twig 0.0.22 → 0.0.24
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/bin/twig-open-pr +3 -1
- data/bin/twig-pick-issue +4 -0
- data/bin/twig-review +2 -2
- data/lib/prima_twig.rb +12 -2
- 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: b59316c981a8b9233508729b4b3b2a8e58e604dd
|
4
|
+
data.tar.gz: 2148fbd89415411addf7ef513f9dabee78884a81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d3308d9ec9ce97cfa893976b8542e20d9f23a29ed8ec5da66fd5ccc5676895c5455eac963b0453f608efe9fea9f45fb85981f52e1cfcaee5f21c16252d83bf3
|
7
|
+
data.tar.gz: 5d1a64a8025be12ccb3eba25561de2f887ce50d0037046e7f4611c2ef88dcc35ed61b254d96faaa50a2f8bd1106f2feb1dff95f20e46407e551fb373effdda5a
|
data/bin/twig-open-pr
CHANGED
@@ -80,9 +80,11 @@ class OpenPR
|
|
80
80
|
end
|
81
81
|
|
82
82
|
pr = create_pull_request
|
83
|
-
puts "Pull Request ##{ pr.number }
|
83
|
+
puts "Pull Request ##{ pr.number } creata".green
|
84
84
|
cmd = %{ twig pr "#{ pr.number }"}
|
85
85
|
exec(cmd)
|
86
|
+
@prima.update_issue_with_label(@prima.get_property('pr'), Prima::LABEL_WIP)
|
87
|
+
puts "Aggiunta label \"#{ Prima::LABEL_WIP }\" sulla pull request ##{ pr.number }".green
|
86
88
|
puts pr.html_url
|
87
89
|
exit 0
|
88
90
|
end
|
data/bin/twig-pick-issue
CHANGED
@@ -59,6 +59,10 @@ class PickIssue
|
|
59
59
|
@prima.rugged.branches.create(branch_name, base_branch)
|
60
60
|
@prima.twig.set_branch_property(branch_name, 'issue', issue_number)
|
61
61
|
@prima.rugged.checkout(branch_name)
|
62
|
+
@prima.update_issue_with_label(issue_number, Prima::LABEL_WIP)
|
63
|
+
puts "Aggiunta label \"#{ Prima::LABEL_WIP }\" sulla issue ##{ issue_number }".green
|
64
|
+
@prima.assign_issue_to_me(issue_number)
|
65
|
+
puts "Issue ##{ issue_number } assegnata a #{ @prima.user_login }".green
|
62
66
|
end
|
63
67
|
|
64
68
|
def choose_issue(issues)
|
data/bin/twig-review
CHANGED
@@ -61,11 +61,11 @@ class Review
|
|
61
61
|
puts "Pull request ##{@prima.get_property('pr')}".cyan
|
62
62
|
puts "Issue ##{@prima.get_property('issue')}".cyan if @prima.has_property?('issue')
|
63
63
|
|
64
|
-
@prima.update_issue_with_label(@prima.get_property('pr'), Prima::
|
64
|
+
@prima.update_issue_with_label(@prima.get_property('pr'), Prima::LABEL_REVIEW)
|
65
65
|
puts "La pull request #{ @prima.get_property('pr') } è ora in review".green
|
66
66
|
|
67
67
|
if @prima.has_property?('issue')
|
68
|
-
@prima.update_issue_with_label(@prima.get_property('issue'), Prima::
|
68
|
+
@prima.update_issue_with_label(@prima.get_property('issue'), Prima::LABEL_REVIEW)
|
69
69
|
puts "La issue #{ @prima.get_property('issue') } è ora in review".green
|
70
70
|
end
|
71
71
|
|
data/lib/prima_twig.rb
CHANGED
@@ -5,7 +5,8 @@ require 'yaml'
|
|
5
5
|
require 'rugged'
|
6
6
|
|
7
7
|
class Prima
|
8
|
-
|
8
|
+
LABEL_REVIEW='review'
|
9
|
+
LABEL_WIP='wip'
|
9
10
|
GITHUB='github'
|
10
11
|
TRELLO='trello'
|
11
12
|
attr_reader :gh, :twig, :config, :rugged
|
@@ -113,7 +114,7 @@ class Prima
|
|
113
114
|
end
|
114
115
|
|
115
116
|
def is_issue_in_review?(issue)
|
116
|
-
issue_has_label?(issue, Prima::
|
117
|
+
issue_has_label?(issue, Prima::LABEL_REVIEW)
|
117
118
|
end
|
118
119
|
|
119
120
|
def issue_has_label?(issue, label)
|
@@ -135,6 +136,15 @@ class Prima
|
|
135
136
|
end
|
136
137
|
end
|
137
138
|
|
139
|
+
def user_login
|
140
|
+
user = @gh.user
|
141
|
+
user.login
|
142
|
+
end
|
143
|
+
|
144
|
+
def assign_issue_to_me(issue)
|
145
|
+
@gh.update_issue(repo_name, issue, :assignee => user_login)
|
146
|
+
end
|
147
|
+
|
138
148
|
def yesno(prompt = 'Continue?', default = true)
|
139
149
|
a = ''
|
140
150
|
s = default ? '[Y/n]' : '[y/N]'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prima-twig
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matteo Giachino
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-
|
13
|
+
date: 2015-07-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: twig
|