fontist 3.0.19 → 3.0.21

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: 2892a051558c7fca54573398a4d81a65b24365a3a42c2aaedac27f38ed85a70f
4
- data.tar.gz: d24c202473b5a65e7c282d99802bf5f443d664ca5bceaa61349a912dea2c00bf
3
+ metadata.gz: 6e1f8b3f4a8dfaf67dc6c776c7364c21a1241218946f1f7557d51c96667a1c44
4
+ data.tar.gz: 685fbcfad963b38344972e9e8b56bb9a2daf4863ff14a829def85ebb805e2890
5
5
  SHA512:
6
- metadata.gz: e8833cb9fc107eaf9b3a3f8d470735d7c269c35a12ecaf69cba222553ec2bd2db20b19e8ee3d9482b0f92127dfbf11ff24808a81e942e471ad52b4e79dc4e032
7
- data.tar.gz: d72ce09d1cb402e2c35b16116fec1a562e67fb020fd217ce1289ca9784305d15da7fb55fd0e58b90f290b1217fed442b5e7f7aaa060256067d952248eea2c714
6
+ metadata.gz: affe57c0973ee61cc2b314cd3c8332b3d068fedb59b316b9a352eb387d71a4191f1a44b4e89534cde03091fe0ce3cd806a520f7804299c92140e97c2efb500f4
7
+ data.tar.gz: 8714f8daa816bc0c32b09cf6c68f35ae190ccf87933a10bf4bc96281bdfcb8eec76191fec5f25e1748c9d592c702bdea87def55f72d20b2b4a58e81946dc119c
data/lib/fontist/repo.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require "git"
2
+ require "open3"
2
3
  require "paint"
3
4
 
4
5
  module Fontist
@@ -26,7 +27,7 @@ module Fontist
26
27
  repo = Git.open(path)
27
28
 
28
29
  {
29
- url: repo.config["remote.origin.url"],
30
+ url: repo.config_get("remote.origin.url")&.value,
30
31
  revision: revision(repo),
31
32
  created: created(repo),
32
33
  updated: updated(repo),
@@ -42,19 +43,24 @@ module Fontist
42
43
  end
43
44
 
44
45
  def revision(repo)
45
- repo.log.first.sha[0..6]
46
+ repo.gcommit("HEAD").sha[0..6]
46
47
  end
47
48
 
48
49
  def created(repo)
49
- repo.gcommit(repo.log.last.sha).date
50
+ # The git 6.0 log builder (Git::Log) exposes no raw-argument
51
+ # escape hatch, so a root-commit query (--max-parents=0) cannot
52
+ # be expressed through it; the git binary serves the query
53
+ root, _err = Open3.capture2("git", "-C", repo.dir.to_s,
54
+ "rev-list", "--max-parents=0", "HEAD")
55
+ repo.gcommit(root.lines.first.strip).date
50
56
  end
51
57
 
52
58
  def updated(repo)
53
- repo.gcommit(repo.log.first.sha).date
59
+ repo.gcommit("HEAD").date
54
60
  end
55
61
 
56
62
  def dirty?(repo)
57
- !repo.status.changed.empty?
63
+ !repo.status_info.changed.empty?
58
64
  end
59
65
  end
60
66
 
@@ -122,7 +128,8 @@ module Fontist
122
128
  rescue StandardError => e
123
129
  # Catch all git-related errors
124
130
  if e.class.name.include?("Git") || e.message.match?(/git|pull|repository/i)
125
- handle_git_error(name, git.config["remote.origin.url"], e, :update)
131
+ url = git.config_get("remote.origin.url")&.value
132
+ handle_git_error(name, url, e, :update)
126
133
  else
127
134
  raise
128
135
  end
@@ -164,7 +171,7 @@ module Fontist
164
171
 
165
172
  begin
166
173
  git = Git.open(repo_path_obj)
167
- existing_url = git.config["remote.origin.url"]
174
+ existing_url = git.config_get("remote.origin.url")&.value
168
175
  return repo_name if normalize_git_url(existing_url) == normalized_target
169
176
  rescue StandardError
170
177
  # Skip repos that can't be opened
@@ -32,14 +32,14 @@ module Fontist
32
32
  Git.open(Fontist.formulas_repo_path)
33
33
  else
34
34
  Git.init(Fontist.formulas_repo_path.to_s).tap do |g|
35
- g.add_remote("origin", Fontist.formulas_repo_url)
35
+ g.remote_add("origin", Fontist.formulas_repo_url)
36
36
  end
37
37
  end
38
38
 
39
39
  return git.pull("origin", @branch) if git.current_branch == @branch
40
40
 
41
- git.config("remote.origin.fetch",
42
- "+refs/heads/#{@branch}:refs/remotes/origin/#{@branch}")
41
+ git.config_set("remote.origin.fetch",
42
+ "+refs/heads/#{@branch}:refs/remotes/origin/#{@branch}")
43
43
  git.fetch
44
44
  git.checkout(@branch)
45
45
  git.pull("origin", @branch)
@@ -1,3 +1,3 @@
1
1
  module Fontist
2
- VERSION = "3.0.19".freeze
2
+ VERSION = "3.0.21".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fontist
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.19
4
+ version: 3.0.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.