gitarro 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gitarro/backend.rb +18 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e97e8143aeaa4f46f345b4f4b8bdd0f6f96ff678
4
- data.tar.gz: cfefb556f4e12c71ed59c0bb4ae5348413aac8c2
3
+ metadata.gz: 859b3feea91e36029b92c7cdbaf639cbcb370952
4
+ data.tar.gz: fcb4a18b402ec2934c1661d4f3e1a3204daffba7
5
5
  SHA512:
6
- metadata.gz: 900c16bda6d9c65c8bb7098a984546a8cd699747152edab67bb893e94f283c242d257b7248a8094e583d94a4dfe249023fa8f06f0c9ea5abbb692407cf33f03b
7
- data.tar.gz: f04932ba29a8c41bc177c6405cc71b6b311deee27306bbb376d6fd0ee8d04d72da5be4d86a127e8aa6299cae8c7122ff9ed7b6f99a4227856d32968265355688
6
+ metadata.gz: 56237f9e270268ff8cb9c0b6894d8783e7f1d17c4a741e2c5d0fb36e9be7d4bf8ee8e0654aa6451d71ca492314a7096b6566d30610c8803c24a3304199aef110
7
+ data.tar.gz: 5ab12186520ce1bbd706a9edf285c186402c242bc66c808fe906ce697b386008b3bd03587c6d733f8fd8d466b9e503b082db84b0a441e949d94a6065f7c4a761
@@ -85,7 +85,7 @@ module CachingOctokit
85
85
 
86
86
  def generate_cache(httpcache_path)
87
87
  # changed_since cannot work with cache
88
- return false if @changed_since > 0
88
+ return false if dont_generate_cache?
89
89
  stack = Faraday::RackBuilder.new do |builder|
90
90
  builder.use Faraday::HttpCache,
91
91
  store: create_dir_store(httpcache_path),
@@ -96,6 +96,15 @@ module CachingOctokit
96
96
  end
97
97
  Octokit.middleware = stack
98
98
  end
99
+
100
+ # if true we dont need the cache
101
+ def dont_generate_cache?
102
+ return false unless @changed_since > 0
103
+ puts '###############################'
104
+ puts 'NO HTTP Faraday Cache generated!'
105
+ puts '###############################'
106
+ true
107
+ end
99
108
  end
100
109
 
101
110
  # this module have helper methods for changelog tests
@@ -142,6 +151,8 @@ class TestExecutor
142
151
  git = GitOp.new(@git_dir, pr, @options)
143
152
  # merge PR-branch to upstream branch
144
153
  git.merge_pr_totarget(pr.base.ref, pr.head.ref)
154
+ # export variables
155
+ export_pr_variables(pr)
145
156
  # do valid tests and store the result
146
157
  test_status = run_script
147
158
  # del branch
@@ -158,6 +169,12 @@ class TestExecutor
158
169
 
159
170
  private
160
171
 
172
+ def export_pr_variables(pr)
173
+ ENV['GITARRO_PR_AUTHOR'] = pr.head.user.login.to_s
174
+ ENV['GITARRO_PR_TITLE'] = pr.title.to_s
175
+ ENV['GITARRO_PR_NUMBER'] = pr.number.to_s
176
+ end
177
+
161
178
  def script_exists?(script)
162
179
  n_exist = "\'#{script}\' doesn't exists.Enter valid file, -t option"
163
180
  raise n_exist if File.file?(script) == false
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitarro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dario Maiocchi