gitarro 0.1.53 → 0.1.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/gitarro/backend.rb +0 -35
- data/lib/gitarro/opt_parser.rb +0 -13
- metadata +8 -36
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ea196155b60e599328efe518da225836b264f0fd
|
|
4
|
+
data.tar.gz: 74cef83a6730617b66c2e71b4191bd7f7563a214
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: de2965fe6377e68a1677e21f88c82c10c85165f009fae1b1c0506cb27e938fa555feece15a0bf970363a17bc0d14f7d262cef86461e7963e7fa3eafd2d866826
|
|
7
|
+
data.tar.gz: 0ce1d7d7380317c34dc6fb3b98c13048bb4d496975ba8fd1bfeeb1ef5f8a8ebd8a00683eeaebe090a035681cabf4143347ad0a8014c0711ed17910fc5d0bfa44
|
data/lib/gitarro/backend.rb
CHANGED
|
@@ -4,10 +4,8 @@ require 'octokit'
|
|
|
4
4
|
require 'optparse'
|
|
5
5
|
require 'time'
|
|
6
6
|
require 'English'
|
|
7
|
-
require 'faraday-http-cache'
|
|
8
7
|
require_relative 'opt_parser'
|
|
9
8
|
require_relative 'git_op'
|
|
10
|
-
require 'active_support'
|
|
11
9
|
|
|
12
10
|
# this module perform basic operations
|
|
13
11
|
# on prs and contain helper functions
|
|
@@ -73,36 +71,6 @@ module GitHubPrOperations
|
|
|
73
71
|
end
|
|
74
72
|
end
|
|
75
73
|
|
|
76
|
-
# by default enabled (faraday_cache in memory, will be deleted
|
|
77
|
-
# after gitarro run 2nd time. usefull for -C check option
|
|
78
|
-
# and performance, since we cache)
|
|
79
|
-
module CachingOctokit
|
|
80
|
-
def create_dir_store(cache_path)
|
|
81
|
-
cache_name = 'httpcache'
|
|
82
|
-
full_cache_dir = "#{cache_path}/#{cache_name}"
|
|
83
|
-
ActiveSupport::Cache::FileStore.new(full_cache_dir)
|
|
84
|
-
end
|
|
85
|
-
|
|
86
|
-
def generate_cache(httpcache_path)
|
|
87
|
-
# changed_since cannot work with cache
|
|
88
|
-
return false unless generate_cache?
|
|
89
|
-
stack = Faraday::RackBuilder.new do |builder|
|
|
90
|
-
builder.use Faraday::HttpCache,
|
|
91
|
-
store: create_dir_store(httpcache_path),
|
|
92
|
-
serializer: Marshal,
|
|
93
|
-
shared_cache: false
|
|
94
|
-
builder.use Octokit::Response::RaiseError
|
|
95
|
-
builder.adapter Faraday.default_adapter
|
|
96
|
-
end
|
|
97
|
-
Octokit.middleware = stack
|
|
98
|
-
end
|
|
99
|
-
|
|
100
|
-
# if true we dont need the cache
|
|
101
|
-
def generate_cache?
|
|
102
|
-
@cachehttp
|
|
103
|
-
end
|
|
104
|
-
end
|
|
105
|
-
|
|
106
74
|
# This is a private class, which has the task to execute/run tests
|
|
107
75
|
# called by Backend
|
|
108
76
|
class TestExecutor
|
|
@@ -154,7 +122,6 @@ end
|
|
|
154
122
|
# were we execute the tests and so on
|
|
155
123
|
class Backend
|
|
156
124
|
attr_accessor :options, :client, :gbexec
|
|
157
|
-
include CachingOctokit
|
|
158
125
|
include GitHubPrOperations
|
|
159
126
|
|
|
160
127
|
# public method of backend
|
|
@@ -165,8 +132,6 @@ class Backend
|
|
|
165
132
|
instance_variable_set("@#{key}", value)
|
|
166
133
|
self.class.send(:attr_accessor, key)
|
|
167
134
|
end
|
|
168
|
-
# if changed_since option on, dont generate cache.
|
|
169
|
-
generate_cache(@cachehttp)
|
|
170
135
|
Octokit.auto_paginate = true
|
|
171
136
|
@client = Octokit::Client.new(netrc: true)
|
|
172
137
|
@gbexec = TestExecutor.new(@options)
|
data/lib/gitarro/opt_parser.rb
CHANGED
|
@@ -73,14 +73,6 @@ module OptionalOptions
|
|
|
73
73
|
opt.on('--https', https_desc) { |https| @options[:https] = https }
|
|
74
74
|
end
|
|
75
75
|
|
|
76
|
-
def cachehttp_opt(opt)
|
|
77
|
-
desc = 'Custom path where http cache for gitarro is stored' \
|
|
78
|
-
'by default is set to /tmp/gitarro/httpcache'
|
|
79
|
-
opt.on('-k', "--cachepath 'CACHEPATH'", desc) do |cache_http|
|
|
80
|
-
@options[:cachehttp] = cache_http
|
|
81
|
-
end
|
|
82
|
-
end
|
|
83
|
-
|
|
84
76
|
def pr_number(opt)
|
|
85
77
|
desc = 'Specify the PR number instead of checking all of them. ' \
|
|
86
78
|
'Force to rerun against a specific PR number,' \
|
|
@@ -107,7 +99,6 @@ module OptionalOptions
|
|
|
107
99
|
url_opt(opt)
|
|
108
100
|
pr_number(opt)
|
|
109
101
|
https_opt(opt)
|
|
110
|
-
cachehttp_opt(opt)
|
|
111
102
|
changed_since(opt)
|
|
112
103
|
end
|
|
113
104
|
end
|
|
@@ -138,9 +129,6 @@ class OptParserInternal
|
|
|
138
129
|
parse_options(opt_parser)
|
|
139
130
|
mandatory_options = %w[repo context test_file git_dir]
|
|
140
131
|
mandatory_options.each { |opt| ck_mandatory_option(opt) }
|
|
141
|
-
if @options[:test_file].nil? && @options[:changelog_test].nil?
|
|
142
|
-
raise_incorrect_syntax('Incorrect syntax (use -h for help)')
|
|
143
|
-
end
|
|
144
132
|
defaults_false
|
|
145
133
|
defaults_to_text
|
|
146
134
|
end
|
|
@@ -172,7 +160,6 @@ class OptParserInternal
|
|
|
172
160
|
@options[:target_url] = '' if @options[:target_url].nil?
|
|
173
161
|
@options[:https] = false if @options[:https].nil?
|
|
174
162
|
@options[:changed_since] = -1 if @options[:changed_since].nil?
|
|
175
|
-
@options[:cachehttp] = false if @options[:cachehttp].nil?
|
|
176
163
|
end
|
|
177
164
|
|
|
178
165
|
def defaults_to_text
|
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.
|
|
4
|
+
version: 0.1.54
|
|
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-10-
|
|
11
|
+
date: 2017-10-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: english
|
|
@@ -52,34 +52,6 @@ dependencies:
|
|
|
52
52
|
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: '4.7'
|
|
55
|
-
- !ruby/object:Gem::Dependency
|
|
56
|
-
name: activesupport
|
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
|
58
|
-
requirements:
|
|
59
|
-
- - "~>"
|
|
60
|
-
- !ruby/object:Gem::Version
|
|
61
|
-
version: '5.1'
|
|
62
|
-
type: :runtime
|
|
63
|
-
prerelease: false
|
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
-
requirements:
|
|
66
|
-
- - "~>"
|
|
67
|
-
- !ruby/object:Gem::Version
|
|
68
|
-
version: '5.1'
|
|
69
|
-
- !ruby/object:Gem::Dependency
|
|
70
|
-
name: faraday-http-cache
|
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
|
72
|
-
requirements:
|
|
73
|
-
- - "~>"
|
|
74
|
-
- !ruby/object:Gem::Version
|
|
75
|
-
version: '2.0'
|
|
76
|
-
type: :runtime
|
|
77
|
-
prerelease: false
|
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
-
requirements:
|
|
80
|
-
- - "~>"
|
|
81
|
-
- !ruby/object:Gem::Version
|
|
82
|
-
version: '2.0'
|
|
83
55
|
- !ruby/object:Gem::Dependency
|
|
84
56
|
name: minitest
|
|
85
57
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -123,33 +95,33 @@ dependencies:
|
|
|
123
95
|
- !ruby/object:Gem::Version
|
|
124
96
|
version: '10.5'
|
|
125
97
|
- !ruby/object:Gem::Dependency
|
|
126
|
-
name:
|
|
98
|
+
name: rspec
|
|
127
99
|
requirement: !ruby/object:Gem::Requirement
|
|
128
100
|
requirements:
|
|
129
101
|
- - "~>"
|
|
130
102
|
- !ruby/object:Gem::Version
|
|
131
|
-
version: '
|
|
103
|
+
version: '3.6'
|
|
132
104
|
type: :development
|
|
133
105
|
prerelease: false
|
|
134
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
135
107
|
requirements:
|
|
136
108
|
- - "~>"
|
|
137
109
|
- !ruby/object:Gem::Version
|
|
138
|
-
version: '
|
|
110
|
+
version: '3.6'
|
|
139
111
|
- !ruby/object:Gem::Dependency
|
|
140
|
-
name:
|
|
112
|
+
name: rubocop
|
|
141
113
|
requirement: !ruby/object:Gem::Requirement
|
|
142
114
|
requirements:
|
|
143
115
|
- - "~>"
|
|
144
116
|
- !ruby/object:Gem::Version
|
|
145
|
-
version: '
|
|
117
|
+
version: '0.49'
|
|
146
118
|
type: :development
|
|
147
119
|
prerelease: false
|
|
148
120
|
version_requirements: !ruby/object:Gem::Requirement
|
|
149
121
|
requirements:
|
|
150
122
|
- - "~>"
|
|
151
123
|
- !ruby/object:Gem::Version
|
|
152
|
-
version: '
|
|
124
|
+
version: '0.49'
|
|
153
125
|
description: gitarro run tests on GitHub PRs using almost any script,language or binary,
|
|
154
126
|
it integrate easy with other tools.
|
|
155
127
|
email: dmaiocchi@suse.com
|