gurney_client 0.5.0 → 0.6.1

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: 1097c1c98d3799765d40e6a5263a1fe58baa6a4df542570f91654247218b7d64
4
- data.tar.gz: 953fe191235e0c338cb71a690284ff5beed7e36f26a511fe1cb3f6311493ef82
3
+ metadata.gz: b72bef8d42506b12da002db40d798e384658d1aac5b4250ea613d5896724b608
4
+ data.tar.gz: b813be622b78ae92073b8696b1aa8f25525685700a3d182b5e196039b32e6b45
5
5
  SHA512:
6
- metadata.gz: 41cd13cf0b65dca7b568cd00f2a3dc95045ae3a6cdb8e896b24e9dcc755efc21fd24d3a328388604d3e783ce2a64f1dfe864d17f745df6ae957f032a4a1131b5
7
- data.tar.gz: b00a53d0aa50995c7be657090d50c906e5914cf5ee1dd5d3b14c74679400f356b49ded4fc653c525ca962d1a2755ceba12be27f32c0361b358c6011d19477cad
6
+ metadata.gz: 42bd484430f96d586240e3c6c66bc1803cd818f5023ab3a80fecf746c4edeb5bc16236714043cc50df351ce6a9a2428cb4e18a0536e89b1cd17bc892ae81f8e8
7
+ data.tar.gz: 03b308fb498c8df86703996ead1e16981606dabbbfbdb101fc7e4f787b766e54ac0442d7054972aa9fc7ab3b41bc33c01d92f778a040d38ee6b997c9416f0f0b
data/CHANGELOG.md CHANGED
@@ -9,6 +9,15 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
9
9
 
10
10
  ### Breaking changes
11
11
 
12
+ ## 0.6.1 2026-05-21
13
+ * Fixes hook mode.
14
+
15
+ ## 0.6.0 2025-06-16
16
+
17
+ ### Compatible changes
18
+ * Added: New option `--prefix` to specify the location of the dependency files
19
+ in case they are not on root level of your git repository.
20
+
12
21
 
13
22
  ## 0.5.0 2025-03-26
14
23
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gurney_client (0.5.0)
4
+ gurney_client (0.6.1)
5
5
  bundler (< 3)
6
6
  colorize (~> 0.8)
7
7
  git (~> 1.5)
@@ -10,8 +10,8 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- addressable (2.8.7)
14
- public_suffix (>= 2.0.2, < 7.0)
13
+ addressable (2.9.0)
14
+ public_suffix (>= 2.0.2, < 8.0)
15
15
  byebug (11.0.1)
16
16
  colorize (0.8.1)
17
17
  diff-lcs (1.3)
@@ -21,11 +21,11 @@ GEM
21
21
  httparty (0.17.3)
22
22
  mime-types (~> 3.0)
23
23
  multi_xml (>= 0.5.2)
24
- logger (1.6.1)
25
- mime-types (3.6.0)
24
+ logger (1.7.0)
25
+ mime-types (3.7.0)
26
26
  logger
27
- mime-types-data (~> 3.2015)
28
- mime-types-data (3.2024.1105)
27
+ mime-types-data (~> 3.2025, >= 3.2025.0507)
28
+ mime-types-data (3.2026.0414)
29
29
  multi_xml (0.6.0)
30
30
  public_suffix (5.1.1)
31
31
  rake (13.0.1)
data/README.md CHANGED
@@ -22,6 +22,7 @@ Usage: gurney [options]
22
22
  -h, --hook Run as a Git post-receive hook
23
23
  --client-hook Run as a Git pre-push hook
24
24
  -p, --project-id [PROJECT ID] Specify project id for API
25
+ --prefix [PATH] Specify the prefix of dependency paths
25
26
  --help Print this help
26
27
  ```
27
28
 
@@ -41,6 +41,10 @@ module Gurney
41
41
  options.project_id = project_id
42
42
  end
43
43
 
44
+ opts.on('', '--prefix [PATH]', 'Specify the prefix of dependency paths') do |prefix|
45
+ options.prefix = prefix
46
+ end
47
+
44
48
  opts.on_tail('', '--help', 'Prints this help') do
45
49
  puts opts
46
50
  exit
data/lib/gurney/cli.rb CHANGED
@@ -56,8 +56,9 @@ module Gurney
56
56
  options.api_token ||= config&.api_token
57
57
  options.api_url ||= config&.api_url
58
58
  options.project_id ||= config&.project_id
59
+ options.prefix ||= config&.prefix
59
60
 
60
- missing_options = [:project_id, :branches, :api_url, :api_token].select { |option| options.send(option).nil? }
61
+ missing_options = [:project_id, :branches, :api_url, :api_token, :prefix].select { |option| options.send(option).nil? }
61
62
  # Use the line below in development
62
63
  # missing_options = [:project_id, :branches, :api_token].select { |option| options.send(option).nil? }
63
64
  raise Gurney::Error.new("Incomplete config - missing #{missing_options.map(&:inspect).join(', ')}.") unless missing_options.empty?
@@ -65,7 +66,7 @@ module Gurney
65
66
 
66
67
  def run
67
68
  reporting_branches.each do |branch|
68
- git_file_reader = GitFileReader.new(git, branch, read_from_git: options.hook || options.client_hook)
69
+ git_file_reader = GitFileReader.new(git, branch, read_from_git: options.hook || options.client_hook, prefix: options.prefix)
69
70
  dependencies = DependencyCollector.new(git_file_reader).collect_all
70
71
 
71
72
  api = Gurney::Api.new(base_url: options.api_url, token: options.api_token)
data/lib/gurney/config.rb CHANGED
@@ -3,13 +3,14 @@ require 'yaml'
3
3
  module Gurney
4
4
  class Config
5
5
 
6
- attr_accessor :branches, :api_url, :api_token, :project_id
6
+ attr_accessor :branches, :api_url, :api_token, :project_id, :prefix
7
7
 
8
- def initialize(branches: nil, api_url: nil, api_token: nil, project_id: nil)
8
+ def initialize(branches: nil, api_url: nil, api_token: nil, project_id: nil, prefix: '.')
9
9
  @branches = branches
10
10
  @api_url = api_url
11
11
  @api_token = api_token&.to_s
12
12
  @project_id = project_id&.to_s
13
+ @prefix = prefix&.to_s
13
14
  end
14
15
 
15
16
  def self.from_yaml(yaml)
@@ -1,21 +1,23 @@
1
1
  module Gurney
2
2
  class GitFileReader
3
3
 
4
- def initialize(git, branch, read_from_git:)
4
+ def initialize(git, branch, read_from_git:, prefix: '.')
5
5
  @git = git
6
6
  @branch = branch
7
7
  @read_from_git = read_from_git
8
+ @prefix = prefix
8
9
  end
9
10
 
10
11
  def read(filename)
12
+ prefixed_filename = @prefix == '.' ? filename : File.join(@prefix, filename)
11
13
  if @read_from_git
12
14
  begin
13
- @git.show("#{@branch}:#{filename}")
15
+ @git.show("#{@branch}:#{prefixed_filename}")
14
16
  rescue Git::GitExecuteError
15
17
  # happens if branch does not exist
16
18
  end
17
19
  else
18
- File.read(filename) if File.exist?(filename)
20
+ File.read(prefixed_filename) if File.exist?(prefixed_filename)
19
21
  end
20
22
  end
21
23
 
@@ -1,3 +1,3 @@
1
1
  module Gurney
2
- VERSION = '0.5.0'
2
+ VERSION = '0.6.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gurney_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Schaflitzl
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-03-26 00:00:00.000000000 Z
11
+ date: 2026-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  - !ruby/object:Gem::Version
123
123
  version: '0'
124
124
  requirements: []
125
- rubygems_version: 3.1.0
125
+ rubygems_version: 3.0.1
126
126
  signing_key:
127
127
  specification_version: 4
128
128
  summary: Gurney is a small tool to extract yarn and RubyGems dependencies from project