gitarro 0.1.71 → 0.1.72

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9733a05342c74d61f73e6df87b39a98265210aca
4
- data.tar.gz: 53afa4031a1dd1ebc43ae7bf6f52f27e8139bfbb
3
+ metadata.gz: df668789d444148092fe85a0ec354a210c8bf07d
4
+ data.tar.gz: 946e22c1f04311db87a7a7e68c758e8db8af2044
5
5
  SHA512:
6
- metadata.gz: 4215750b2f25bc6f8794f511fcda36536f35a4737f53ddc619c64b6310a54963608e44942fd10ebb63561e0934d811e4901a0326b0a16c5e51bce4ff5fa42ff6
7
- data.tar.gz: aa1e985187efc288ae8aef8f778541a47e56e327bc04b9a8458efe4eed39f6adc0b99c34d020df734f12c76f3af1a85b77ba40cc1d553f1a6e7a6f28b592ba15
6
+ metadata.gz: ccd9fdd3a9b7a6cbf3295f61554c3742db607393805e5c3bccd98e13b1a4637bae89d3078ca53cbed3249b1664186c6eb1202ca2f46b405829d5a225fb448f96
7
+ data.tar.gz: 35307631c827d2009c6c1bd9a5477949636b7d6345999d996794594cbc3a0e89bf576208e4660f1fd8c0f06f9807a3d99f8970adda2aead8b5c383b1b33ec4d2
data/bin/gitarro CHANGED
@@ -13,6 +13,8 @@ exit 0 if prs.empty?
13
13
 
14
14
  prs.each do |pr|
15
15
  puts '=' * 30 + "\n" + "TITLE_PR: #{pr.title}, NR: #{pr.number}\n" + '=' * 30
16
+ # check if prs contains the branch given otherwise just break
17
+ break unless b.pr_equal_spefic_branch?(pr)
16
18
  # this check the last commit state, catch for review or not reviewd status.
17
19
  comm_st = b.client.status(b.repo, pr.head.sha)
18
20
  # pr number trigger.
@@ -151,6 +151,17 @@ class Backend
151
151
  @gbexec = TestExecutor.new(@options)
152
152
  end
153
153
 
154
+ # public method for check if pr belong to user specified branch
155
+ # if the pr belong to the branch continue tests
156
+ # otherwise just skip tests without setting any status
157
+ def pr_equal_spefic_branch?(pr)
158
+ return true if @branch.nil?
159
+ return true if @branch == pr.base.ref
160
+ puts "branch \"#{pr.base.ref}\" should match github-branch \"#{@branch}\" (given) !!!"
161
+ puts "skipping tests !!!"
162
+ false
163
+ end
164
+
154
165
  # public method for get prs opened and matching the changed_since
155
166
  # condition
156
167
  def open_newer_prs
@@ -5,7 +5,7 @@ require 'fileutils'
5
5
  require 'timeout'
6
6
  require 'tmpdir'
7
7
 
8
- # handle shallow clone
8
+ # handle shallow clone by default
9
9
  class GitShallowClone
10
10
  attr_reader :git_dir, :pr, :options, :repo_protocol
11
11
  def initialize(git_dir, pr, options)
@@ -48,6 +48,12 @@ module OptionalOptions
48
48
  end
49
49
  end
50
50
 
51
+ def branch_opt(opt)
52
+ opt.on('-b', "--branch 'GITHUB BRANCH'", 'GitHub Branch') do |b|
53
+ @options[:branch] = b
54
+ end
55
+ end
56
+
51
57
  def git_opt(opt)
52
58
  desc = 'Specify a location where gitarro will clone the GitHub project. '\
53
59
  'If the dir does not exists, gitarro will create one. '\
@@ -99,6 +105,7 @@ module OptionalOptions
99
105
  opt.separator "\n Optional options:"
100
106
  desc_opt(opt)
101
107
  check_opt(opt)
108
+ branch_opt(opt)
102
109
  no_shallow(opt)
103
110
  file_opt(opt)
104
111
  url_opt(opt)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitarro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.71
4
+ version: 0.1.72
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dario Maiocchi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-06 00:00:00.000000000 Z
11
+ date: 2018-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: english
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  version: '0'
169
169
  requirements: []
170
170
  rubyforge_project:
171
- rubygems_version: 2.5.1
171
+ rubygems_version: 2.5.2.1
172
172
  signing_key:
173
173
  specification_version: 4
174
174
  summary: gitarro gem