prima-twig 0.0.14 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/twig-review +7 -6
- data/lib/prima_twig.rb +18 -4
- 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: 868604e7fb98bc4a7cc9ff7b87a4f39d104a0059
|
4
|
+
data.tar.gz: 8a4a482409530785d8cfe160257c1995b6ed800a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e799d1d717ea2f519280167e16d2b18e9598a78f489159e46565bc64aea08ba6bd1911286559022ba61af49b0b2cc0920b1d76997661cbb5bd267040f8a66035
|
7
|
+
data.tar.gz: e989585953566038e3c72b86ed01943ee53a115b60d6dae1610158221c8f887bca1cd739d45fb395340c67c6bd7bd02c6356fdf7c3ef54b23ecfb4b68c2b48d9
|
data/bin/twig-review
CHANGED
@@ -49,17 +49,18 @@ class Review
|
|
49
49
|
end
|
50
50
|
|
51
51
|
unless @prima.is_already_a_pr?
|
52
|
-
puts 'Il branch attuale non è una pull request'
|
52
|
+
puts 'Il branch attuale non è una pull request'.red
|
53
53
|
exit 1
|
54
54
|
end
|
55
55
|
|
56
|
-
|
57
|
-
|
58
|
-
|
56
|
+
@prima.update_issue_with_label(pr, Prima::REVIEW_LABEL)
|
57
|
+
puts "La pull request #{ @prima.get_property('pr') } è ora in review".green
|
58
|
+
|
59
|
+
if @prima.has_property?('issue')
|
60
|
+
@prima.update_issue_with_label(@prima.get_property('issue'), Prima::REVIEW_LABEL)
|
61
|
+
puts "La issue #{ @prima.get_property('issue') } è ora in review".green
|
59
62
|
end
|
60
63
|
|
61
|
-
@prima.gh.add_labels_to_an_issue @prima.repo_name, @prima.get_property('pr'), [ Prima::REVIEW_LABEL ]
|
62
|
-
puts "Il branch #{ @prima.current_branch_name } è ora in review".green
|
63
64
|
exit 0
|
64
65
|
end
|
65
66
|
end
|
data/lib/prima_twig.rb
CHANGED
@@ -112,15 +112,29 @@ class Prima
|
|
112
112
|
not get_pr_url.nil?
|
113
113
|
end
|
114
114
|
|
115
|
-
def
|
116
|
-
|
117
|
-
not labels.find_index{ |l| l.name == REVIEW_LABEL }.nil?
|
115
|
+
def is_issue_in_review?(issue)
|
116
|
+
issue_has_label?(issue, Prima::REVIEW_LABEL)
|
118
117
|
end
|
119
118
|
|
120
|
-
def
|
119
|
+
def issue_has_label?(issue, label)
|
120
|
+
labels = @gh.labels_for_issue repo_name, issue
|
121
|
+
not labels.find_index{ |l| l.name == label }.nil?
|
122
|
+
end
|
123
|
+
|
124
|
+
def get_property(name)
|
121
125
|
@twig.get_branch_property current_branch_name, name
|
122
126
|
end
|
123
127
|
|
128
|
+
def has_property?(name)
|
129
|
+
@twig.get_branch_property(current_branch_name, name).nil?
|
130
|
+
end
|
131
|
+
|
132
|
+
def update_issue_with_label(issue, label)
|
133
|
+
unless issue_has_label?(issue, label)
|
134
|
+
gh.add_labels_to_an_issue repo_name, issue, [ label ]
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
124
138
|
def yesno(prompt = 'Continue?', default = true)
|
125
139
|
a = ''
|
126
140
|
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.15
|
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-06-
|
13
|
+
date: 2015-06-04 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: twig
|