judgelint 0.1.10-aarch64-linux → 0.2.0-aarch64-linux

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cc554a7131b467805b95687aa2d2a04cd73bcb3e21247dcc5665ffa5f7ec0d51
4
- data.tar.gz: 4b8cea730dfd3caffb623453a9ad341731cc091e61dbc5fbe90e0f5279f19d3b
3
+ metadata.gz: a895a6451b78deec50a2627fe2e83d51ec59e2e1a4ab269195ac74dd16098e2e
4
+ data.tar.gz: a828ad2b29f10928f508bad87acbf432004958c661dcdc62a3df0a416af8b99b
5
5
  SHA512:
6
- metadata.gz: e22d29b6da0ebd8a9b89cb4388b89f6463112feadc419036ef7009f3d145a4480e97d31b2c881b168e147211881ecaa286c1aa3147d5674770320e618cf06f0c
7
- data.tar.gz: 459895a2b29b2b5301dab40a26fb32f6e23d20e8091adfe6ce0619c21fdc3801992e7ccf55eeb2ac39f9f0da4b23f72c2dec0fefbbb9189968c0a7ef9afd3abc
6
+ metadata.gz: 5cef13f72b84602be04d29028380cf0129b7905489fa1107f306eeb24621c918752b7d0bf6b799b9e7a9f9b32ccdd72b094beeda88cb3685ab583c81850a3a89
7
+ data.tar.gz: b03da4b05e2088236f161eae401cafe573e86271d96a48df7e09b3f67c27f2736c6f2f1ee87d625607e6ec2ccf923b13b3c7ab043e28cedfa92023f3b9f3592a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.0 (2026-10-28)
4
+
5
+ - judgelint is written in Rust now. The gem carries the binary for macOS and
6
+ Linux on arm64 and x86_64. On any other platform the gem says how to build
7
+ it with Cargo; it no longer runs as plain Ruby. There's no Ruby API.
8
+ - It's much faster and smaller than 0.1.10's native binary. On a Mac mini:
9
+
10
+ | Run | 0.1.10 | 0.2.0 |
11
+ |---|---|---|
12
+ | Plan 50,000 files | 9.0 s, 140 MB | 1.2 s, 54 MB |
13
+ | Check 5,000 files, nothing cached | 3.4 s, 82 MB | 0.7 s, 19 MB |
14
+ | Check 5,000 files, all cached | 1.5 s, 56 MB | 0.16 s, 16 MB |
15
+ | Check 50,000 files, nothing cached | 23.8 s, 487 MB | 6.4 s, 75 MB |
16
+
17
+ - Answers are cached in `.judgelint/cache.bin`. The old `cache.json` isn't
18
+ read, so the first run asks again; delete it afterward. The new cache is
19
+ about a quarter of the size.
20
+ - Commands, options, specs, config and output formats are the same. Error
21
+ messages are worded differently.
22
+
3
23
  ## 0.1.10 (2026-10-27)
4
24
 
5
25
  - `check` and `test` use far less memory and run faster. Against 0.1.9 on
data/README.md CHANGED
@@ -16,9 +16,10 @@ curl -fsSL https://raw.githubusercontent.com/jpcamara/judgelint/main/install.sh
16
16
 
17
17
  The script installs to `~/.local/bin`, or to `$JUDGELINT_INSTALL_DIR`. The
18
18
  binaries are on the [releases page](https://github.com/jpcamara/judgelint/releases)
19
- for macOS and Linux, on arm64 and x86_64. Linux needs glibc 2.35 or newer
20
- (Ubuntu 22.04, Debian 12). `gem install judgelint` works too, and runs as
21
- plain Ruby on Windows.
19
+ for macOS and Linux, on arm64 and x86_64. Linux needs glibc 2.34 or newer
20
+ (Ubuntu 22.04, Debian 12, RHEL 9). `gem install judgelint` installs the same
21
+ binary. Anywhere else, build it with Rust:
22
+ `cargo install --git https://github.com/jpcamara/judgelint`.
22
23
 
23
24
  ## Getting started
24
25
 
@@ -247,7 +248,7 @@ ignore: ["vendor/**"] # files no rule checks, and READMEs that aren't specs
247
248
  max_cost_usd: 1.00 # refuse a run estimated to cost more, unless --yes
248
249
  ```
249
250
 
250
- Every run prints what it cost. Answers are cached in `.judgelint/cache.json`,
251
+ Every run prints what it cost. Answers are cached in `.judgelint/cache.bin`,
251
252
  so a file that hasn't changed costs nothing. Commit the cache to share it.
252
253
  `judgelint --help` lists the flags.
253
254
 
@@ -276,16 +277,13 @@ models:
276
277
 
277
278
  ## Building from source
278
279
 
279
- judgelint is written in Ruby and compiled with
280
- [Spinel](https://github.com/matz/spinel).
280
+ judgelint is written in Rust. The end-to-end tests are in Ruby.
281
281
 
282
282
  ```sh
283
+ cargo build --release # builds target/release/judgelint
283
284
  bundle install
284
- bundle exec rake test
285
- git clone https://github.com/matz/spinel ../spinel && (cd ../spinel && make deps && make)
286
- SPINEL=../spinel/bin/spinel bundle exec rake spinel # builds build/judgelint
287
- SPINEL=../spinel/bin/spinel bundle exec rake test:spinel # runs the tests against the binary
288
- bundle exec rake example # asks Jev about the demo app again
285
+ bundle exec rake test # runs the Rust tests, then the end-to-end tests against the binary
286
+ bundle exec rake example # asks Jev about the demo app again
289
287
  ```
290
288
 
291
289
  ## Credits
data/exe/judgelint CHANGED
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- # A platform gem (judgelint-*-arm64-darwin and so on) carries the Spinel-built
5
- # binary in libexec/; run it when it's there. Spinel compiles this file too,
6
- # and drops this branch.
7
- if RUBY_ENGINE != "spinel"
8
- native = File.expand_path("../libexec/judgelint", __dir__)
9
- exec(native, *ARGV) if File.executable?(native)
10
- end
4
+ # The platform gems (judgelint-*-arm64-darwin and so on) carry the binary in
5
+ # libexec/. The plain gem, for every other platform, has none.
6
+ native = File.expand_path("../libexec/judgelint", __dir__)
7
+ exec(native, *ARGV) if File.executable?(native)
11
8
 
12
- require "judgelint"
9
+ abort <<~TEXT
10
+ This judgelint gem has no binary for #{RUBY_PLATFORM}. The binaries are for
11
+ macOS and Linux on arm64 and x86_64. With Rust installed, build it instead:
13
12
 
14
- exit Judgelint::CLI.new(ARGV).run
13
+ cargo install --git https://github.com/jpcamara/judgelint
14
+ TEXT
data/libexec/judgelint CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: judgelint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.2.0
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - JP Camara
@@ -12,8 +12,8 @@ dependencies: []
12
12
  description: |
13
13
  judgelint checks code against conventions you write as bullets in a README.
14
14
  It asks a decision model, such as TypeSafe's Jev, whether each file breaks
15
- each bullet, and reports violations with line numbers. On macOS and Linux
16
- the gem includes a native binary.
15
+ each bullet, and reports violations with line numbers. The gem carries
16
+ its native binary for macOS and Linux.
17
17
  email:
18
18
  - johnpcamara@gmail.com
19
19
  executables:
@@ -25,28 +25,6 @@ files:
25
25
  - LICENSE
26
26
  - README.md
27
27
  - exe/judgelint
28
- - lib/judgelint.rb
29
- - lib/judgelint/cache.rb
30
- - lib/judgelint/changes.rb
31
- - lib/judgelint/cli.rb
32
- - lib/judgelint/client.rb
33
- - lib/judgelint/config.rb
34
- - lib/judgelint/errors.rb
35
- - lib/judgelint/glob.rb
36
- - lib/judgelint/paint.rb
37
- - lib/judgelint/pool.rb
38
- - lib/judgelint/protocol.rb
39
- - lib/judgelint/providers.rb
40
- - lib/judgelint/question.rb
41
- - lib/judgelint/reporter.rb
42
- - lib/judgelint/rule.rb
43
- - lib/judgelint/runner.rb
44
- - lib/judgelint/scaffold.rb
45
- - lib/judgelint/source.rb
46
- - lib/judgelint/spec.rb
47
- - lib/judgelint/usage.rb
48
- - lib/judgelint/verdict.rb
49
- - lib/judgelint/version.rb
50
28
  - lib/rubygems_plugin.rb
51
29
  - libexec/judgelint
52
30
  homepage: https://github.com/jpcamara/judgelint
@@ -1,344 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Judgelint
4
- # Stores each answer under a hash of everything that produced it: the state
5
- # the model saw (path and numbered contents), the question asked of it, and
6
- # the model. Changing any of them is a miss. Safe to share across threads.
7
- #
8
- # A cache file in the form #save writes stays on disk: loading it checks
9
- # every entry and keeps its key and where it is, and a lookup finds the
10
- # key by binary search and reads that entry back. Any other JSON object is
11
- # read whole. New answers wait for #save in a scratch file beside the
12
- # cache, already in the form it writes. A cache used again after it's saved
13
- # reads its new file first.
14
- class Cache
15
- # A line that starts an entry, without its line ending: its key, then
16
- # its value or the value's first line.
17
- ENTRY = /\A "([0-9a-f]{64})": (.*)\z/
18
- # Values in the plain form #save writes, which parse without being
19
- # parsed: a number or literal, or a line of a hash of them with an ASCII
20
- # name. Anything else is parsed to check it.
21
- SCALAR = /\A(?:-?(?:0|[1-9][0-9]*)(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?|null|true|false)\z/
22
- # Spinel's JSON parser outruns its regexps, where CRuby's parser makes
23
- # more garbage than its regexps do, so only CRuby checks by pattern.
24
- BY_PATTERN = RUBY_ENGINE != "spinel"
25
- MEMBER = %r{\A "(?:[\x20\x21\x23-\x5b\x5d-\x7e]|\\["\\/bfnrt])*": (?:-?(?:0|[1-9][0-9]*)(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?|null|true|false),?\r?\n\z}
26
- KEY_SIZE = 64
27
- # Where a value starts in its entry's first line.
28
- VALUE_AT = 70
29
- # A value's place in a file is kept as one Integer: its offset, shifted
30
- # past its length.
31
- SPAN_BITS = 32
32
-
33
- def initialize(path)
34
- @path = path
35
- @keys = +"" # the file's keys in order, end to end
36
- @places = [] # the place of each key's value in the file
37
- @entries = {} # every answer from a file read whole, or stored without a file
38
- @stored_keys = +"" # the keys of answers stored this run, end to end, in the order stored
39
- @stored_places = [] # the place of each in the scratch file
40
- @dirty = false
41
- @saved = false
42
- @lock = Mutex.new
43
- load_entries
44
- end
45
-
46
- def self.key(question_digest, state_digest, model_label)
47
- Digest::SHA256.hexdigest([question_digest, state_digest, model_label].join(":"))
48
- end
49
-
50
- def fetch(key)
51
- @lock.synchronize do
52
- reload if @saved
53
- if (stored = stored(key))
54
- read(@scratch, @stored_places[stored])
55
- elsif (found = find(key))
56
- read(@file, @places[found])
57
- else
58
- @entries[key]
59
- end
60
- end
61
- end
62
-
63
- # Makes room for about +count+ answers to be stored, so their keys don't
64
- # grow a piece at a time.
65
- def reserve(count)
66
- @lock.synchronize do
67
- return unless @path
68
-
69
- reload if @saved
70
- @stored_keys = String.new(capacity: count * KEY_SIZE) << @stored_keys if @stored_keys.bytesize < count * KEY_SIZE
71
- end
72
- end
73
-
74
- def store(key, yes_probability)
75
- @lock.synchronize do
76
- reload if @saved
77
- @dirty = true
78
- if @path
79
- text = indented(yes_probability)
80
- @scratch ||= scratch
81
- @stored_keys << key
82
- @stored_places << place(@scratch_size, text.bytesize)
83
- @scratch.write(text)
84
- @scratch.flush
85
- @scratch_size += text.bytesize
86
- else
87
- @entries[key] = yes_probability
88
- end
89
- end
90
- end
91
-
92
- # Writes every entry in key order, as JSON.pretty_generate does, one at a
93
- # time into a new file that then replaces the old one.
94
- def save
95
- @lock.synchronize do
96
- return unless @path && @dirty
97
-
98
- FileUtils.mkdir_p(File.dirname(@path))
99
- temp = "#{@path}.#{Process.pid}.tmp"
100
- File.open(temp, "w") { |out| write(out) }
101
- close
102
- File.rename(temp, @path)
103
- @dirty = false
104
- @saved = true
105
- end
106
- end
107
-
108
- private
109
-
110
- # The index of +key+ among the file's keys, or nil.
111
- def find(key)
112
- low = 0
113
- high = @places.size - 1
114
- while low <= high
115
- middle = (low + high) / 2
116
- other = @keys.byteslice(middle * KEY_SIZE, KEY_SIZE)
117
- return middle if other == key
118
-
119
- other < key ? low = middle + 1 : high = middle - 1
120
- end
121
- nil
122
- end
123
-
124
- # The latest answer stored this run under +key+, or nil. A run looks its
125
- # answers up before it stores any, so there are rarely any to look at.
126
- def stored(key)
127
- index = @stored_places.size - 1
128
- while index >= 0
129
- return index if @stored_keys.byteslice(index * KEY_SIZE, KEY_SIZE) == key
130
-
131
- index -= 1
132
- end
133
- nil
134
- end
135
-
136
- def read(file, at)
137
- JSON.parse(raw(file, at))
138
- end
139
-
140
- def raw(file, at)
141
- file.pread(at & ((1 << SPAN_BITS) - 1), at >> SPAN_BITS)
142
- end
143
-
144
- def place(offset, length)
145
- (offset << SPAN_BITS) | length
146
- end
147
-
148
- # Deleted as soon as it's open where the system allows that, so it goes
149
- # away with the process; elsewhere, once the cache is saved.
150
- def scratch
151
- FileUtils.mkdir_p(File.dirname(@path))
152
- path = "#{@path}.#{Process.pid}.answers"
153
- file = File.open(path, "w+b")
154
- begin
155
- File.delete(path)
156
- rescue SystemCallError
157
- @scratch_path = path
158
- end
159
- @scratch_size = 0
160
- file
161
- end
162
-
163
- def reload
164
- @saved = false
165
- @keys = +""
166
- @places = []
167
- @entries = {}
168
- @stored_keys = +""
169
- @stored_places = []
170
- @scratch = nil
171
- @scratch_path = nil
172
- load_entries
173
- end
174
-
175
- # The file can't be replaced while it's open everywhere.
176
- def close
177
- @file&.close
178
- @scratch&.close
179
- File.delete(@scratch_path) if @scratch_path
180
- end
181
-
182
- # Merges the file's entries, or those read whole, with the answers stored
183
- # this run, which replace any with the same key.
184
- def write(out)
185
- whole = @entries.keys.sort
186
- kept = whole.empty? ? @places.size : whole.size
187
- count = 0
188
- i = 0
189
- stored_buckets.each do |bucket|
190
- keys = bucket.map { |index| @stored_keys.byteslice(index * KEY_SIZE, KEY_SIZE) }
191
- latest(keys).each do |n|
192
- key = keys[n]
193
- while i < kept && (mine = kept_key(whole, i)) < key
194
- count = entry(out, count, mine, kept_text(whole, i))
195
- i += 1
196
- end
197
- i += 1 if i < kept && kept_key(whole, i) == key
198
- count = entry(out, count, key, raw(@scratch, @stored_places[bucket[n]]))
199
- end
200
- end
201
- while i < kept
202
- count = entry(out, count, kept_key(whole, i), kept_text(whole, i))
203
- i += 1
204
- end
205
- out.write(count.zero? ? "{}\n" : "\n}\n")
206
- end
207
-
208
- # +text+ is the value, indented to sit in the file's object.
209
- def entry(out, count, key, text)
210
- out.write(count.zero? ? "{\n " : ",\n ")
211
- out.write(JSON.generate(key))
212
- out.write(": ")
213
- out.write(text)
214
- count + 1
215
- end
216
-
217
- def indented(value)
218
- JSON.pretty_generate(value).gsub("\n", "\n ")
219
- end
220
-
221
- def kept_key(whole, index)
222
- whole.empty? ? @keys.byteslice(index * KEY_SIZE, KEY_SIZE) : whole[index]
223
- end
224
-
225
- def kept_text(whole, index)
226
- indented(whole.empty? ? read(@file, @places[index]) : @entries[whole[index]])
227
- end
228
-
229
- # The answers stored this run, by the first two hex digits of their keys:
230
- # in key order a bucket at a time, so only one bucket's keys are out at
231
- # once.
232
- def stored_buckets
233
- buckets = Array.new(256) { [] }
234
- @stored_places.size.times do |index|
235
- at = index * KEY_SIZE
236
- buckets[(digit(@stored_keys.getbyte(at)) << 4) | digit(@stored_keys.getbyte(at + 1))] << index
237
- end
238
- buckets
239
- end
240
-
241
- def digit(byte)
242
- byte < 97 ? byte - 48 : byte - 87
243
- end
244
-
245
- # The indexes of +keys+ in key order, keeping the latest of any stored twice.
246
- def latest(keys)
247
- found = []
248
- (0...keys.size).sort_by { |index| keys[index] }.each do |index|
249
- if !found.empty? && keys[found.last] == keys[index]
250
- found[-1] = index if index > found.last
251
- else
252
- found << index
253
- end
254
- end
255
- found
256
- end
257
-
258
- def load_entries
259
- return unless @path && File.exist?(@path)
260
-
261
- @file = File.open(@path, "rb")
262
- return if index
263
-
264
- @keys = +""
265
- @places = []
266
- data = JSON.parse(File.read(@path))
267
- raise ConfigError, "#{@path} isn't a judgelint cache; delete it to start over" unless data.is_a?(Hash)
268
-
269
- @entries = data
270
- rescue JSON::ParserError
271
- raise ConfigError, "#{@path} isn't valid JSON; delete it to start over"
272
- end
273
-
274
- # Indexes a file in the form #save writes, with its keys in order,
275
- # checking that each value parses. Lines may end in CRLF, as #save writes
276
- # them on Windows. False for anything else.
277
- def index
278
- offset = 0
279
- last = nil # the latest key
280
- open = false # inside a value that spans lines
281
- start = 0
282
- plain = false # the open value's lines are all plain so far
283
- comma = true # the open value's last line ended in a comma
284
- ended = false # read the entry without a comma
285
- closed = false # read the final brace
286
- @file.each_line do |line|
287
- return false if closed
288
-
289
- if open && line.start_with?(" ")
290
- plain &&= BY_PATTERN && comma && line.match?(MEMBER)
291
- comma = line.end_with?(",\n", ",\r\n")
292
- offset += line.bytesize
293
- next
294
- end
295
-
296
- bare = line.chomp
297
- if offset.zero?
298
- return false unless bare == "{" || bare == "{}"
299
-
300
- closed = bare == "{}"
301
- elsif open
302
- return false unless bare == " }" || bare == " },"
303
- return false unless indexed(last, start, offset + 3 - start, plain && !comma)
304
-
305
- open = false
306
- ended = bare == " }"
307
- elsif ended
308
- return false unless bare == "}"
309
-
310
- closed = true
311
- else
312
- match = ENTRY.match(bare)
313
- return false unless match && (last.nil? || last < match[1])
314
-
315
- last = match[1]
316
- rest = match[2]
317
- start = offset + VALUE_AT
318
- if rest == "{"
319
- open = true
320
- plain = true
321
- comma = true
322
- else
323
- ended = !rest.end_with?(",")
324
- value = ended ? rest : rest.delete_suffix(",")
325
- return false unless indexed(last, start, value.bytesize, BY_PATTERN && value.match?(SCALAR), value)
326
- end
327
- end
328
- offset += line.bytesize
329
- end
330
- closed
331
- end
332
-
333
- # Keeps +key+'s place, once its value is known to parse. +text+ is the
334
- # value when it's at hand.
335
- def indexed(key, start, length, plain, text = nil)
336
- JSON.parse(text || @file.pread(length, start)) unless plain
337
- @keys << key
338
- @places << place(start, length)
339
- true
340
- rescue JSON::ParserError
341
- false
342
- end
343
- end
344
- end
@@ -1,87 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Judgelint
4
- # The lines a change touched, from git: everything since the merge base with
5
- # a ref, uncommitted work included. Old code outside the change isn't asked
6
- # about, so it can't block new work.
7
- module Changes
8
- # A branch, tag, or commit (HEAD~1 too), and nothing git could read as an
9
- # option or a range.
10
- REF = %r{\A[A-Za-z0-9][A-Za-z0-9._/~^-]*\z}
11
- HUNK = /\A@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@/
12
-
13
- # Returns {path => [changed line numbers]}, or :all for a new file.
14
- def self.since(ref)
15
- check_ref(ref)
16
- base = git("merge-base", ref, "HEAD").strip
17
- changed = parse_diff(git("-c", "core.quotePath=false", "diff", "-U0", "--no-color", "--no-ext-diff",
18
- "--relative", "--diff-filter=d", base))
19
- git("ls-files", "--others", "--exclude-standard").lines.each { |path| changed[path.chomp] = :all }
20
- changed
21
- end
22
-
23
- # CI variables that name a pull request's base branch.
24
- BASE_BRANCH_VARIABLES = %w[
25
- JUDGELINT_BASE_BRANCH GITHUB_BASE_REF CI_MERGE_REQUEST_TARGET_BRANCH_NAME
26
- BUILDKITE_PULL_REQUEST_BASE_BRANCH BITBUCKET_PR_DESTINATION_BRANCH SYSTEM_PULLREQUEST_TARGETBRANCH
27
- ].freeze
28
-
29
- # The pull request's base branch, fetched, as origin/<branch>: from
30
- # JUDGELINT_BASE_BRANCH, then GitHub Actions, GitLab, Buildkite, Bitbucket,
31
- # or Azure Pipelines, then the gh CLI.
32
- def self.pr_base
33
- branch = pr_branch
34
- raise ConfigError, "Couldn't find the pull request's base branch" if branch.empty?
35
-
36
- check_ref(branch)
37
- git("fetch", "--no-tags", "--quiet", "origin", branch)
38
- "origin/#{branch}"
39
- end
40
-
41
- def self.pr_branch
42
- BASE_BRANCH_VARIABLES.each do |name|
43
- # Buildkite sets "false" outside a pull request; Azure names a full ref.
44
- branch = ENV.fetch(name, "").delete_prefix("refs/heads/")
45
- return branch unless branch.empty? || branch == "false"
46
- end
47
- command("gh", "pr", "view", "--json", "baseRefName", "-q", ".baseRefName").strip
48
- end
49
-
50
- def self.parse_diff(diff)
51
- changed = {}
52
- path = nil
53
- diff.each_line do |line|
54
- if line.start_with?("+++ ")
55
- target = line.chomp.delete_prefix("+++ ").delete_suffix("\t")
56
- path = target == "/dev/null" ? nil : target.delete_prefix("b/")
57
- elsif path && (hunk = HUNK.match(line))
58
- start = hunk[1].to_i
59
- count = hunk[2] ? hunk[2].to_i : 1
60
- # A pure deletion marks the line above the gap, so it's still judged.
61
- lines = count.zero? ? [[start, 1].max] : (start...(start + count)).to_a
62
- (changed[path] ||= []).concat(lines)
63
- end
64
- end
65
- changed
66
- end
67
-
68
- def self.check_ref(ref)
69
- return if REF.match?(ref) && !ref.include?("..")
70
-
71
- raise ConfigError, "Not a usable git ref: #{ref}"
72
- end
73
-
74
- def self.git(*args)
75
- command("git", *args)
76
- end
77
-
78
- def self.command(*args)
79
- out, err, status = Open3.capture3(*args)
80
- raise ConfigError, "#{args.first(3).join(' ')} failed: #{err.strip.lines.first.to_s.strip}" unless status.success?
81
-
82
- out
83
- rescue SystemCallError => e
84
- raise ConfigError, "Couldn't run #{args.first}: #{e.message}"
85
- end
86
- end
87
- end