gitarro 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gitarro/backend.rb +18 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 859b3feea91e36029b92c7cdbaf639cbcb370952
|
4
|
+
data.tar.gz: fcb4a18b402ec2934c1661d4f3e1a3204daffba7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56237f9e270268ff8cb9c0b6894d8783e7f1d17c4a741e2c5d0fb36e9be7d4bf8ee8e0654aa6451d71ca492314a7096b6566d30610c8803c24a3304199aef110
|
7
|
+
data.tar.gz: 5ab12186520ce1bbd706a9edf285c186402c242bc66c808fe906ce697b386008b3bd03587c6d733f8fd8d466b9e503b082db84b0a441e949d94a6065f7c4a761
|
data/lib/gitarro/backend.rb
CHANGED
@@ -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
|
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
|