prima-twig 0.0.16 → 0.0.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/twig-review +8 -0
  3. data/lib/prima_twig.rb +4 -2
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 400d2fcdf0d888653ba38a82edca974a888f277f
4
- data.tar.gz: ceefb12a8a8844da1d9766af3dc10c8812d32c3e
3
+ metadata.gz: b54ddbfa69c4447a11b5b3bd32a5327cb1b451d2
4
+ data.tar.gz: 20b911cff578da7693492636dea089ea376969dd
5
5
  SHA512:
6
- metadata.gz: a533d35bbba2c58ff1e7a45dd396031240bfd36d02af155c2c3febf937b7075f3ffdfb7c14c31b14c1201d1730489c7a89ced4fc512099c54853ef01ba984980
7
- data.tar.gz: 94cfa05b2f6a41e2c964bd17cf3cc0226d1aa4b7bae4678f34c0cd1ed17c53f79cc201522349d1b6c3b9987ee7aa502ac3215f301b4a9bf13cf08722fe4a2155
6
+ metadata.gz: 86e41dc61ef18443bc3964d8008b252a043109a1ef3050a6b96bb7e5319060154f8173af474fc50413dc5e6179b4712542caabc4fc6958dba63011e59ef2a21a
7
+ data.tar.gz: 037016ea2f273898b914b395a7e154f204b8031166e040a77e9588268a903229e0143f60a25a8ede7d24b4709851548488f654fbee2bbdad4e6ab5dc847049a2
data/bin/twig-review CHANGED
@@ -48,11 +48,19 @@ class Review
48
48
  exit 1
49
49
  end
50
50
 
51
+ unless @prima.has_property?('pr')
52
+ puts 'Il branch attuale non ha la proprietà PR'.red
53
+ exit 1
54
+ end
55
+
51
56
  unless @prima.is_already_a_pr?
52
57
  puts 'Il branch attuale non è una pull request'.red
53
58
  exit 1
54
59
  end
55
60
 
61
+ puts "Pull request ##{@prima.get_property('pr')}".cyan
62
+ puts "Issue ##{@prima.get_property('issue')}".cyan if @prima.has_property?('issue')
63
+
56
64
  @prima.update_issue_with_label(@prima.get_property('pr'), Prima::REVIEW_LABEL)
57
65
  puts "La pull request #{ @prima.get_property('pr') } è ora in review".green
58
66
 
data/lib/prima_twig.rb CHANGED
@@ -68,10 +68,12 @@ class Prima
68
68
  end
69
69
 
70
70
  def repo_name
71
+ return 'primait/prima'
71
72
  `git config --get remote.origin.url`.split(':').last.chomp.chomp('.git')
72
73
  end
73
74
 
74
75
  def current_branch_ref
76
+ return 'prezzi_riepilogo_garanzie-923'
75
77
  "primait:#{ current_branch_name }"
76
78
  end
77
79
 
@@ -117,7 +119,7 @@ class Prima
117
119
  end
118
120
 
119
121
  def issue_has_label?(issue, label)
120
- labels = @gh.labels_for_issue repo_name, issue
122
+ labels = @gh.labels_for_issue repo_name, issue.to_i
121
123
  not labels.find_index{ |l| l.name == label }.nil?
122
124
  end
123
125
 
@@ -126,7 +128,7 @@ class Prima
126
128
  end
127
129
 
128
130
  def has_property?(name)
129
- @twig.get_branch_property(current_branch_name, name).nil?
131
+ not @twig.get_branch_property(current_branch_name, name).nil?
130
132
  end
131
133
 
132
134
  def update_issue_with_label(issue, label)
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.16
4
+ version: 0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matteo Giachino