gurney_client 0.5.0 → 1.0.0
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/.ruby-version +1 -1
- data/CHANGELOG.md +16 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +26 -24
- data/README.md +1 -0
- data/gurney.gemspec +17 -14
- data/lib/gurney/cli/option_parser.rb +4 -0
- data/lib/gurney/cli.rb +3 -2
- data/lib/gurney/config.rb +3 -2
- data/lib/gurney/git_file_reader.rb +5 -3
- data/lib/gurney/version.rb +1 -1
- metadata +56 -14
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4fc57178800d940d42f63260c2744988fef2e09931b988ecbc6905dc54db2570
|
|
4
|
+
data.tar.gz: d39a991f813a5d5fff44b2eacc22628354f8a888f90dff2fbafcdabfe25eaa6d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 70db80f8ee5068f3d448d5f396e0aa7dfce9cc7c7ae63f5499880fa1e1809f559fad42ff2ecd0d260a1d65586d2c3e3b3800ca11b28ef50efe2e734fc340ad7b
|
|
7
|
+
data.tar.gz: '085ec2d96abfb720837eed6867ebe6231cfe02ee0b14df87380e0995920ee041bb695fc2bd174e260d6f697ac685d6bf624603b132d3f2b038b19dbd9354124e'
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2
|
|
1
|
+
3.2
|
data/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,22 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
|
|
|
10
10
|
### Breaking changes
|
|
11
11
|
|
|
12
12
|
|
|
13
|
+
## 1.0.0 2026-04-21
|
|
14
|
+
|
|
15
|
+
### Compatible changes
|
|
16
|
+
* Add support for Ruby 4.0
|
|
17
|
+
|
|
18
|
+
### Breaking changes
|
|
19
|
+
* Drop support for Ruby < 3.2
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## 0.6.0 2025-06-16
|
|
23
|
+
|
|
24
|
+
### Compatible changes
|
|
25
|
+
* Added: New option `--prefix` to specify the location of the dependency files
|
|
26
|
+
in case they are not on root level of your git repository.
|
|
27
|
+
|
|
28
|
+
|
|
13
29
|
## 0.5.0 2025-03-26
|
|
14
30
|
|
|
15
31
|
### Compatible changes
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
gurney_client (0.
|
|
5
|
-
bundler (<
|
|
4
|
+
gurney_client (1.0.0)
|
|
5
|
+
bundler (< 4)
|
|
6
6
|
colorize (~> 0.8)
|
|
7
7
|
git (~> 1.5)
|
|
8
|
-
httparty (
|
|
8
|
+
httparty (>= 0.24, < 1.0)
|
|
9
|
+
logger (>= 1.6, < 2.0)
|
|
10
|
+
ostruct (>= 0.6, < 1.0)
|
|
9
11
|
|
|
10
12
|
GEM
|
|
11
13
|
remote: https://rubygems.org/
|
|
@@ -14,35 +16,35 @@ GEM
|
|
|
14
16
|
public_suffix (>= 2.0.2, < 7.0)
|
|
15
17
|
byebug (11.0.1)
|
|
16
18
|
colorize (0.8.1)
|
|
17
|
-
|
|
19
|
+
csv (3.3.5)
|
|
20
|
+
diff-lcs (1.6.2)
|
|
18
21
|
git (1.19.1)
|
|
19
22
|
addressable (~> 2.8)
|
|
20
23
|
rchardet (~> 1.8)
|
|
21
|
-
httparty (0.
|
|
22
|
-
|
|
24
|
+
httparty (0.24.2)
|
|
25
|
+
csv
|
|
26
|
+
mini_mime (>= 1.0.0)
|
|
23
27
|
multi_xml (>= 0.5.2)
|
|
24
28
|
logger (1.6.1)
|
|
25
|
-
|
|
26
|
-
logger
|
|
27
|
-
mime-types-data (~> 3.2015)
|
|
28
|
-
mime-types-data (3.2024.1105)
|
|
29
|
+
mini_mime (1.1.5)
|
|
29
30
|
multi_xml (0.6.0)
|
|
31
|
+
ostruct (0.6.3)
|
|
30
32
|
public_suffix (5.1.1)
|
|
31
|
-
rake (13.
|
|
33
|
+
rake (13.4.2)
|
|
32
34
|
rchardet (1.8.0)
|
|
33
|
-
rspec (3.
|
|
34
|
-
rspec-core (~> 3.
|
|
35
|
-
rspec-expectations (~> 3.
|
|
36
|
-
rspec-mocks (~> 3.
|
|
37
|
-
rspec-core (3.
|
|
38
|
-
rspec-support (~> 3.
|
|
39
|
-
rspec-expectations (3.
|
|
35
|
+
rspec (3.10.0)
|
|
36
|
+
rspec-core (~> 3.10.0)
|
|
37
|
+
rspec-expectations (~> 3.10.0)
|
|
38
|
+
rspec-mocks (~> 3.10.0)
|
|
39
|
+
rspec-core (3.10.2)
|
|
40
|
+
rspec-support (~> 3.10.0)
|
|
41
|
+
rspec-expectations (3.10.2)
|
|
40
42
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
41
|
-
rspec-support (~> 3.
|
|
42
|
-
rspec-mocks (3.
|
|
43
|
+
rspec-support (~> 3.10.0)
|
|
44
|
+
rspec-mocks (3.10.3)
|
|
43
45
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
44
|
-
rspec-support (~> 3.
|
|
45
|
-
rspec-support (3.
|
|
46
|
+
rspec-support (~> 3.10.0)
|
|
47
|
+
rspec-support (3.10.3)
|
|
46
48
|
|
|
47
49
|
PLATFORMS
|
|
48
50
|
ruby
|
|
@@ -51,7 +53,7 @@ DEPENDENCIES
|
|
|
51
53
|
byebug
|
|
52
54
|
gurney_client!
|
|
53
55
|
rake
|
|
54
|
-
rspec
|
|
56
|
+
rspec (~> 3.10.0)
|
|
55
57
|
|
|
56
58
|
BUNDLED WITH
|
|
57
|
-
2.
|
|
59
|
+
2.7.2
|
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
|
|
data/gurney.gemspec
CHANGED
|
@@ -3,24 +3,27 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
3
3
|
require "gurney/version"
|
|
4
4
|
|
|
5
5
|
Gem::Specification.new do |spec|
|
|
6
|
-
spec.name
|
|
7
|
-
spec.version
|
|
8
|
-
spec.authors
|
|
9
|
-
spec.email
|
|
6
|
+
spec.name = "gurney_client"
|
|
7
|
+
spec.version = Gurney::VERSION
|
|
8
|
+
spec.authors = ["Martin Schaflitzl"]
|
|
9
|
+
spec.email = ["martin.schaflitzl@makandra.de"]
|
|
10
10
|
|
|
11
|
-
spec.summary
|
|
12
|
-
spec.homepage
|
|
13
|
-
spec.license
|
|
14
|
-
spec.metadata
|
|
11
|
+
spec.summary = 'Gurney is a small tool to extract yarn and RubyGems dependencies from project files and report them to a web api.'
|
|
12
|
+
spec.homepage = "https://github.com/makandra/gurney"
|
|
13
|
+
spec.license = "MIT"
|
|
14
|
+
spec.metadata = { 'rubygems_mfa_required' => 'true' }
|
|
15
|
+
spec.required_ruby_version = '>= 3.2'
|
|
15
16
|
|
|
16
|
-
spec.files
|
|
17
|
-
spec.test_files
|
|
18
|
-
spec.bindir
|
|
19
|
-
spec.executables
|
|
17
|
+
spec.files = `git ls-files`.split("\n").reject { |f| f.match(%r{^(test|spec|features|bin)/}) }
|
|
18
|
+
spec.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
19
|
+
spec.bindir = 'exe'
|
|
20
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
20
21
|
spec.require_paths = ["lib"]
|
|
21
22
|
|
|
22
23
|
spec.add_runtime_dependency 'colorize', '~> 0.8'
|
|
23
|
-
spec.add_runtime_dependency 'httparty', '
|
|
24
|
-
spec.add_runtime_dependency 'bundler', '<
|
|
24
|
+
spec.add_runtime_dependency 'httparty', '>= 0.24', '< 1.0'
|
|
25
|
+
spec.add_runtime_dependency 'bundler', '< 4'
|
|
25
26
|
spec.add_runtime_dependency 'git', '~> 1.5'
|
|
27
|
+
spec.add_runtime_dependency 'logger', '>= 1.6', '< 2.0'
|
|
28
|
+
spec.add_runtime_dependency 'ostruct', '>= 0.6', '< 1.0'
|
|
26
29
|
end
|
|
@@ -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 = File.join(@prefix, filename)
|
|
11
13
|
if @read_from_git
|
|
12
14
|
begin
|
|
13
|
-
@git.show("#{@branch}:#{
|
|
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(
|
|
20
|
+
File.read(prefixed_filename) if File.exist?(prefixed_filename)
|
|
19
21
|
end
|
|
20
22
|
end
|
|
21
23
|
|
data/lib/gurney/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gurney_client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Martin Schaflitzl
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 2026-04-21 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: colorize
|
|
@@ -28,30 +27,36 @@ dependencies:
|
|
|
28
27
|
name: httparty
|
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
|
30
29
|
requirements:
|
|
31
|
-
- - "
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '0.24'
|
|
33
|
+
- - "<"
|
|
32
34
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: 0
|
|
35
|
+
version: '1.0'
|
|
34
36
|
type: :runtime
|
|
35
37
|
prerelease: false
|
|
36
38
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
39
|
requirements:
|
|
38
|
-
- - "
|
|
40
|
+
- - ">="
|
|
39
41
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: 0.
|
|
42
|
+
version: '0.24'
|
|
43
|
+
- - "<"
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
version: '1.0'
|
|
41
46
|
- !ruby/object:Gem::Dependency
|
|
42
47
|
name: bundler
|
|
43
48
|
requirement: !ruby/object:Gem::Requirement
|
|
44
49
|
requirements:
|
|
45
50
|
- - "<"
|
|
46
51
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '
|
|
52
|
+
version: '4'
|
|
48
53
|
type: :runtime
|
|
49
54
|
prerelease: false
|
|
50
55
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
56
|
requirements:
|
|
52
57
|
- - "<"
|
|
53
58
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: '
|
|
59
|
+
version: '4'
|
|
55
60
|
- !ruby/object:Gem::Dependency
|
|
56
61
|
name: git
|
|
57
62
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -66,7 +71,46 @@ dependencies:
|
|
|
66
71
|
- - "~>"
|
|
67
72
|
- !ruby/object:Gem::Version
|
|
68
73
|
version: '1.5'
|
|
69
|
-
|
|
74
|
+
- !ruby/object:Gem::Dependency
|
|
75
|
+
name: logger
|
|
76
|
+
requirement: !ruby/object:Gem::Requirement
|
|
77
|
+
requirements:
|
|
78
|
+
- - ">="
|
|
79
|
+
- !ruby/object:Gem::Version
|
|
80
|
+
version: '1.6'
|
|
81
|
+
- - "<"
|
|
82
|
+
- !ruby/object:Gem::Version
|
|
83
|
+
version: '2.0'
|
|
84
|
+
type: :runtime
|
|
85
|
+
prerelease: false
|
|
86
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
87
|
+
requirements:
|
|
88
|
+
- - ">="
|
|
89
|
+
- !ruby/object:Gem::Version
|
|
90
|
+
version: '1.6'
|
|
91
|
+
- - "<"
|
|
92
|
+
- !ruby/object:Gem::Version
|
|
93
|
+
version: '2.0'
|
|
94
|
+
- !ruby/object:Gem::Dependency
|
|
95
|
+
name: ostruct
|
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
|
97
|
+
requirements:
|
|
98
|
+
- - ">="
|
|
99
|
+
- !ruby/object:Gem::Version
|
|
100
|
+
version: '0.6'
|
|
101
|
+
- - "<"
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: '1.0'
|
|
104
|
+
type: :runtime
|
|
105
|
+
prerelease: false
|
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - ">="
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: '0.6'
|
|
111
|
+
- - "<"
|
|
112
|
+
- !ruby/object:Gem::Version
|
|
113
|
+
version: '1.0'
|
|
70
114
|
email:
|
|
71
115
|
- martin.schaflitzl@makandra.de
|
|
72
116
|
executables:
|
|
@@ -107,7 +151,6 @@ licenses:
|
|
|
107
151
|
- MIT
|
|
108
152
|
metadata:
|
|
109
153
|
rubygems_mfa_required: 'true'
|
|
110
|
-
post_install_message:
|
|
111
154
|
rdoc_options: []
|
|
112
155
|
require_paths:
|
|
113
156
|
- lib
|
|
@@ -115,15 +158,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
115
158
|
requirements:
|
|
116
159
|
- - ">="
|
|
117
160
|
- !ruby/object:Gem::Version
|
|
118
|
-
version: '
|
|
161
|
+
version: '3.2'
|
|
119
162
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
163
|
requirements:
|
|
121
164
|
- - ">="
|
|
122
165
|
- !ruby/object:Gem::Version
|
|
123
166
|
version: '0'
|
|
124
167
|
requirements: []
|
|
125
|
-
rubygems_version: 3.
|
|
126
|
-
signing_key:
|
|
168
|
+
rubygems_version: 3.6.5
|
|
127
169
|
specification_version: 4
|
|
128
170
|
summary: Gurney is a small tool to extract yarn and RubyGems dependencies from project
|
|
129
171
|
files and report them to a web api.
|