bundler 2.7.2 → 4.0.0.beta1
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/CHANGELOG.md +990 -917
- data/README.md +4 -4
- data/bundler.gemspec +3 -3
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/capistrano.rb +1 -19
- data/lib/bundler/cli/cache.rb +1 -11
- data/lib/bundler/cli/common.rb +20 -3
- data/lib/bundler/cli/config.rb +1 -2
- data/lib/bundler/cli/console.rb +5 -0
- data/lib/bundler/cli/exec.rb +29 -4
- data/lib/bundler/cli/gem.rb +19 -33
- data/lib/bundler/cli/install.rb +7 -82
- data/lib/bundler/cli/issue.rb +2 -2
- data/lib/bundler/cli/list.rb +33 -2
- data/lib/bundler/cli/plugin.rb +5 -1
- data/lib/bundler/cli/show.rb +1 -1
- data/lib/bundler/cli/update.rb +3 -3
- data/lib/bundler/cli.rb +75 -83
- data/lib/bundler/compact_index_client.rb +0 -1
- data/lib/bundler/current_ruby.rb +3 -15
- data/lib/bundler/definition.rb +45 -35
- data/lib/bundler/deployment.rb +1 -64
- data/lib/bundler/digest.rb +1 -1
- data/lib/bundler/dsl.rb +13 -35
- data/lib/bundler/endpoint_specification.rb +0 -22
- data/lib/bundler/errors.rb +1 -5
- data/lib/bundler/feature_flag.rb +0 -33
- data/lib/bundler/fetcher/compact_index.rb +1 -1
- data/lib/bundler/friendly_errors.rb +2 -2
- data/lib/bundler/index.rb +0 -7
- data/lib/bundler/inline.rb +1 -1
- data/lib/bundler/installer/gem_installer.rb +0 -11
- data/lib/bundler/installer.rb +0 -6
- data/lib/bundler/lockfile_generator.rb +1 -1
- data/lib/bundler/lockfile_parser.rb +2 -12
- data/lib/bundler/man/bundle-add.1 +1 -1
- data/lib/bundler/man/bundle-binstubs.1 +3 -6
- data/lib/bundler/man/bundle-binstubs.1.ronn +4 -6
- data/lib/bundler/man/bundle-cache.1 +2 -14
- data/lib/bundler/man/bundle-cache.1.ronn +1 -14
- data/lib/bundler/man/bundle-check.1 +2 -5
- data/lib/bundler/man/bundle-check.1.ronn +0 -5
- data/lib/bundler/man/bundle-clean.1 +1 -1
- data/lib/bundler/man/bundle-config.1 +6 -33
- data/lib/bundler/man/bundle-config.1.ronn +20 -55
- data/lib/bundler/man/bundle-console.1 +1 -1
- data/lib/bundler/man/bundle-doctor.1 +1 -1
- data/lib/bundler/man/bundle-env.1 +1 -1
- data/lib/bundler/man/bundle-exec.1 +2 -5
- data/lib/bundler/man/bundle-exec.1.ronn +1 -5
- data/lib/bundler/man/bundle-fund.1 +1 -1
- data/lib/bundler/man/bundle-gem.1 +3 -6
- data/lib/bundler/man/bundle-gem.1.ronn +2 -5
- data/lib/bundler/man/bundle-help.1 +1 -1
- data/lib/bundler/man/bundle-info.1 +1 -1
- data/lib/bundler/man/bundle-init.1 +1 -1
- data/lib/bundler/man/bundle-install.1 +8 -59
- data/lib/bundler/man/bundle-install.1.ronn +12 -107
- data/lib/bundler/man/bundle-issue.1 +1 -1
- data/lib/bundler/man/bundle-licenses.1 +1 -1
- data/lib/bundler/man/bundle-list.1 +6 -1
- data/lib/bundler/man/bundle-list.1.ronn +5 -0
- data/lib/bundler/man/bundle-lock.1 +1 -1
- data/lib/bundler/man/bundle-open.1 +1 -1
- data/lib/bundler/man/bundle-outdated.1 +1 -1
- data/lib/bundler/man/bundle-platform.1 +1 -1
- data/lib/bundler/man/bundle-plugin.1 +2 -9
- data/lib/bundler/man/bundle-plugin.1.ronn +0 -8
- data/lib/bundler/man/bundle-pristine.1 +1 -1
- data/lib/bundler/man/bundle-remove.1 +2 -8
- data/lib/bundler/man/bundle-remove.1.ronn +1 -8
- data/lib/bundler/man/bundle-show.1 +2 -5
- data/lib/bundler/man/bundle-show.1.ronn +0 -4
- data/lib/bundler/man/bundle-update.1 +1 -1
- data/lib/bundler/man/bundle-version.1 +1 -1
- data/lib/bundler/man/bundle.1 +1 -10
- data/lib/bundler/man/bundle.1.ronn +0 -9
- data/lib/bundler/man/gemfile.5 +1 -1
- data/lib/bundler/man/index.txt +0 -2
- data/lib/bundler/materialization.rb +1 -1
- data/lib/bundler/plugin/installer.rb +0 -10
- data/lib/bundler/plugin/source_list.rb +1 -1
- data/lib/bundler/plugin.rb +1 -1
- data/lib/bundler/resolver.rb +1 -1
- data/lib/bundler/ruby_dsl.rb +2 -0
- data/lib/bundler/ruby_version.rb +1 -3
- data/lib/bundler/rubygems_ext.rb +1 -1
- data/lib/bundler/rubygems_gem_installer.rb +1 -1
- data/lib/bundler/rubygems_integration.rb +1 -5
- data/lib/bundler/self_manager.rb +1 -1
- data/lib/bundler/settings.rb +7 -26
- data/lib/bundler/shared_helpers.rb +8 -20
- data/lib/bundler/source/git/git_proxy.rb +3 -11
- data/lib/bundler/source/git.rb +2 -3
- data/lib/bundler/source/path.rb +3 -7
- data/lib/bundler/source/rubygems.rb +11 -17
- data/lib/bundler/source.rb +1 -1
- data/lib/bundler/source_list.rb +4 -45
- data/lib/bundler/source_map.rb +2 -5
- data/lib/bundler/spec_set.rb +6 -15
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +7 -129
- data/lib/bundler/templates/newgem/circleci/config.yml.tt +12 -0
- data/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +1 -1
- data/lib/bundler/templates/newgem/ext/newgem/extconf-go.rb.tt +11 -0
- data/lib/bundler/templates/newgem/ext/newgem/go.mod.tt +5 -0
- data/lib/bundler/templates/newgem/ext/newgem/newgem-go.c.tt +2 -0
- data/lib/bundler/templates/newgem/ext/newgem/newgem.go.tt +31 -0
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +6 -0
- data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +9 -0
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +4 -1
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +26 -23
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +50 -6
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +57 -52
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +5 -2
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/common.rb +57 -15
- data/lib/bundler/vendor/uri/lib/uri/file.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +34 -21
- data/lib/bundler/vendor/uri/lib/uri/http.rb +12 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +9 -8
- data/lib/bundler/vendor/uri/lib/uri/version.rb +2 -2
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/vlad.rb +1 -14
- data/lib/bundler.rb +6 -28
- metadata +9 -13
- data/lib/bundler/cli/inject.rb +0 -60
- data/lib/bundler/cli/viz.rb +0 -31
- data/lib/bundler/graph.rb +0 -152
- data/lib/bundler/man/bundle-inject.1 +0 -31
- data/lib/bundler/man/bundle-inject.1.ronn +0 -32
- data/lib/bundler/man/bundle-viz.1 +0 -30
- data/lib/bundler/man/bundle-viz.1.ronn +0 -36
- data/lib/bundler/similarity_detector.rb +0 -63
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bundler
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 4.0.0.beta1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- André Arko
|
|
@@ -62,7 +62,6 @@ files:
|
|
|
62
62
|
- lib/bundler/cli/gem.rb
|
|
63
63
|
- lib/bundler/cli/info.rb
|
|
64
64
|
- lib/bundler/cli/init.rb
|
|
65
|
-
- lib/bundler/cli/inject.rb
|
|
66
65
|
- lib/bundler/cli/install.rb
|
|
67
66
|
- lib/bundler/cli/issue.rb
|
|
68
67
|
- lib/bundler/cli/list.rb
|
|
@@ -75,7 +74,6 @@ files:
|
|
|
75
74
|
- lib/bundler/cli/remove.rb
|
|
76
75
|
- lib/bundler/cli/show.rb
|
|
77
76
|
- lib/bundler/cli/update.rb
|
|
78
|
-
- lib/bundler/cli/viz.rb
|
|
79
77
|
- lib/bundler/compact_index_client.rb
|
|
80
78
|
- lib/bundler/compact_index_client/cache.rb
|
|
81
79
|
- lib/bundler/compact_index_client/cache_file.rb
|
|
@@ -106,7 +104,6 @@ files:
|
|
|
106
104
|
- lib/bundler/gem_helper.rb
|
|
107
105
|
- lib/bundler/gem_tasks.rb
|
|
108
106
|
- lib/bundler/gem_version_promoter.rb
|
|
109
|
-
- lib/bundler/graph.rb
|
|
110
107
|
- lib/bundler/index.rb
|
|
111
108
|
- lib/bundler/injector.rb
|
|
112
109
|
- lib/bundler/inline.rb
|
|
@@ -148,8 +145,6 @@ files:
|
|
|
148
145
|
- lib/bundler/man/bundle-info.1.ronn
|
|
149
146
|
- lib/bundler/man/bundle-init.1
|
|
150
147
|
- lib/bundler/man/bundle-init.1.ronn
|
|
151
|
-
- lib/bundler/man/bundle-inject.1
|
|
152
|
-
- lib/bundler/man/bundle-inject.1.ronn
|
|
153
148
|
- lib/bundler/man/bundle-install.1
|
|
154
149
|
- lib/bundler/man/bundle-install.1.ronn
|
|
155
150
|
- lib/bundler/man/bundle-issue.1
|
|
@@ -178,8 +173,6 @@ files:
|
|
|
178
173
|
- lib/bundler/man/bundle-update.1.ronn
|
|
179
174
|
- lib/bundler/man/bundle-version.1
|
|
180
175
|
- lib/bundler/man/bundle-version.1.ronn
|
|
181
|
-
- lib/bundler/man/bundle-viz.1
|
|
182
|
-
- lib/bundler/man/bundle-viz.1.ronn
|
|
183
176
|
- lib/bundler/man/bundle.1
|
|
184
177
|
- lib/bundler/man/bundle.1.ronn
|
|
185
178
|
- lib/bundler/man/gemfile.5
|
|
@@ -224,7 +217,6 @@ files:
|
|
|
224
217
|
- lib/bundler/settings/validator.rb
|
|
225
218
|
- lib/bundler/setup.rb
|
|
226
219
|
- lib/bundler/shared_helpers.rb
|
|
227
|
-
- lib/bundler/similarity_detector.rb
|
|
228
220
|
- lib/bundler/source.rb
|
|
229
221
|
- lib/bundler/source/gemspec.rb
|
|
230
222
|
- lib/bundler/source/git.rb
|
|
@@ -256,8 +248,12 @@ files:
|
|
|
256
248
|
- lib/bundler/templates/newgem/exe/newgem.tt
|
|
257
249
|
- lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt
|
|
258
250
|
- lib/bundler/templates/newgem/ext/newgem/extconf-c.rb.tt
|
|
251
|
+
- lib/bundler/templates/newgem/ext/newgem/extconf-go.rb.tt
|
|
259
252
|
- lib/bundler/templates/newgem/ext/newgem/extconf-rust.rb.tt
|
|
253
|
+
- lib/bundler/templates/newgem/ext/newgem/go.mod.tt
|
|
254
|
+
- lib/bundler/templates/newgem/ext/newgem/newgem-go.c.tt
|
|
260
255
|
- lib/bundler/templates/newgem/ext/newgem/newgem.c.tt
|
|
256
|
+
- lib/bundler/templates/newgem/ext/newgem/newgem.go.tt
|
|
261
257
|
- lib/bundler/templates/newgem/ext/newgem/newgem.h.tt
|
|
262
258
|
- lib/bundler/templates/newgem/ext/newgem/src/lib.rs.tt
|
|
263
259
|
- lib/bundler/templates/newgem/github/workflows/main.yml.tt
|
|
@@ -386,10 +382,10 @@ homepage: https://bundler.io
|
|
|
386
382
|
licenses:
|
|
387
383
|
- MIT
|
|
388
384
|
metadata:
|
|
389
|
-
bug_tracker_uri: https://github.com/
|
|
390
|
-
changelog_uri: https://github.com/
|
|
385
|
+
bug_tracker_uri: https://github.com/ruby/rubygems/issues?q=is%3Aopen+is%3Aissue+label%3ABundler
|
|
386
|
+
changelog_uri: https://github.com/ruby/rubygems/blob/master/bundler/CHANGELOG.md
|
|
391
387
|
homepage_uri: https://bundler.io/
|
|
392
|
-
source_code_uri: https://github.com/
|
|
388
|
+
source_code_uri: https://github.com/ruby/rubygems/tree/master/bundler
|
|
393
389
|
rdoc_options: []
|
|
394
390
|
require_paths:
|
|
395
391
|
- lib
|
|
@@ -404,7 +400,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
404
400
|
- !ruby/object:Gem::Version
|
|
405
401
|
version: 3.4.1
|
|
406
402
|
requirements: []
|
|
407
|
-
rubygems_version: 3.
|
|
403
|
+
rubygems_version: 3.6.9
|
|
408
404
|
specification_version: 4
|
|
409
405
|
summary: The best way to manage your application's dependencies
|
|
410
406
|
test_files: []
|
data/lib/bundler/cli/inject.rb
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Bundler
|
|
4
|
-
class CLI::Inject
|
|
5
|
-
attr_reader :options, :name, :version, :group, :source, :gems
|
|
6
|
-
def initialize(options, name, version)
|
|
7
|
-
@options = options
|
|
8
|
-
@name = name
|
|
9
|
-
@version = version || last_version_number
|
|
10
|
-
@group = options[:group].split(",") unless options[:group].nil?
|
|
11
|
-
@source = options[:source]
|
|
12
|
-
@gems = []
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def run
|
|
16
|
-
# The required arguments allow Thor to give useful feedback when the arguments
|
|
17
|
-
# are incorrect. This adds those first two arguments onto the list as a whole.
|
|
18
|
-
gems.unshift(source).unshift(group).unshift(version).unshift(name)
|
|
19
|
-
|
|
20
|
-
# Build an array of Dependency objects out of the arguments
|
|
21
|
-
deps = []
|
|
22
|
-
# when `inject` support addition of more than one gem, then this loop will
|
|
23
|
-
# help. Currently this loop is running once.
|
|
24
|
-
gems.each_slice(4) do |gem_name, gem_version, gem_group, gem_source|
|
|
25
|
-
ops = Gem::Requirement::OPS.map {|key, _val| key }
|
|
26
|
-
has_op = ops.any? {|op| gem_version.start_with? op }
|
|
27
|
-
gem_version = "~> #{gem_version}" unless has_op
|
|
28
|
-
deps << Bundler::Dependency.new(gem_name, gem_version, "group" => gem_group, "source" => gem_source)
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
added = Injector.inject(deps, options)
|
|
32
|
-
|
|
33
|
-
if added.any?
|
|
34
|
-
Bundler.ui.confirm "Added to Gemfile:"
|
|
35
|
-
Bundler.ui.confirm(added.map do |d|
|
|
36
|
-
name = "'#{d.name}'"
|
|
37
|
-
requirement = ", '#{d.requirement}'"
|
|
38
|
-
group = ", group: #{d.groups.inspect}" if d.groups != Array(:default)
|
|
39
|
-
source = ", source: '#{d.source}'" unless d.source.nil?
|
|
40
|
-
%(gem #{name}#{requirement}#{group}#{source})
|
|
41
|
-
end.join("\n"))
|
|
42
|
-
else
|
|
43
|
-
Bundler.ui.confirm "All gems were already present in the Gemfile"
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
private
|
|
48
|
-
|
|
49
|
-
def last_version_number
|
|
50
|
-
definition = Bundler.definition(true)
|
|
51
|
-
definition.remotely!
|
|
52
|
-
specs = definition.index[name].sort_by(&:version)
|
|
53
|
-
unless options[:pre]
|
|
54
|
-
specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
|
|
55
|
-
end
|
|
56
|
-
spec = specs.last
|
|
57
|
-
spec.version.to_s
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
end
|
data/lib/bundler/cli/viz.rb
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Bundler
|
|
4
|
-
class CLI::Viz
|
|
5
|
-
attr_reader :options, :gem_name
|
|
6
|
-
def initialize(options)
|
|
7
|
-
@options = options
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
def run
|
|
11
|
-
# make sure we get the right `graphviz`. There is also a `graphviz`
|
|
12
|
-
# gem we're not built to support
|
|
13
|
-
gem "ruby-graphviz"
|
|
14
|
-
require "graphviz"
|
|
15
|
-
|
|
16
|
-
options[:without] = options[:without].join(":").tr(" ", ":").split(":")
|
|
17
|
-
output_file = File.expand_path(options[:file])
|
|
18
|
-
|
|
19
|
-
graph = Graph.new(Bundler.load, output_file, options[:version], options[:requirements], options[:format], options[:without])
|
|
20
|
-
graph.viz
|
|
21
|
-
rescue LoadError => e
|
|
22
|
-
Bundler.ui.error e.inspect
|
|
23
|
-
Bundler.ui.warn "Make sure you have the graphviz ruby gem. You can install it with:"
|
|
24
|
-
Bundler.ui.warn "`gem install ruby-graphviz`"
|
|
25
|
-
rescue StandardError => e
|
|
26
|
-
raise unless e.message.to_s.include?("GraphViz not installed or dot not in PATH")
|
|
27
|
-
Bundler.ui.error e.message
|
|
28
|
-
Bundler.ui.warn "Please install GraphViz. On a Mac with Homebrew, you can run `brew install graphviz`."
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
data/lib/bundler/graph.rb
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "set"
|
|
4
|
-
module Bundler
|
|
5
|
-
class Graph
|
|
6
|
-
GRAPH_NAME = :Gemfile
|
|
7
|
-
|
|
8
|
-
def initialize(env, output_file, show_version = false, show_requirements = false, output_format = "png", without = [])
|
|
9
|
-
@env = env
|
|
10
|
-
@output_file = output_file
|
|
11
|
-
@show_version = show_version
|
|
12
|
-
@show_requirements = show_requirements
|
|
13
|
-
@output_format = output_format
|
|
14
|
-
@without_groups = without.map(&:to_sym)
|
|
15
|
-
|
|
16
|
-
@groups = []
|
|
17
|
-
@relations = Hash.new {|h, k| h[k] = Set.new }
|
|
18
|
-
@node_options = {}
|
|
19
|
-
@edge_options = {}
|
|
20
|
-
|
|
21
|
-
_populate_relations
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
attr_reader :groups, :relations, :node_options, :edge_options, :output_file, :output_format
|
|
25
|
-
|
|
26
|
-
def viz
|
|
27
|
-
GraphVizClient.new(self).run
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
private
|
|
31
|
-
|
|
32
|
-
def _populate_relations
|
|
33
|
-
parent_dependencies = _groups.values.to_set.flatten
|
|
34
|
-
loop do
|
|
35
|
-
break if parent_dependencies.empty?
|
|
36
|
-
|
|
37
|
-
tmp = Set.new
|
|
38
|
-
parent_dependencies.each do |dependency|
|
|
39
|
-
child_dependencies = spec_for_dependency(dependency).runtime_dependencies.to_set
|
|
40
|
-
@relations[dependency.name] += child_dependencies.map(&:name).to_set
|
|
41
|
-
tmp += child_dependencies
|
|
42
|
-
|
|
43
|
-
@node_options[dependency.name] = _make_label(dependency, :node)
|
|
44
|
-
child_dependencies.each do |c_dependency|
|
|
45
|
-
@edge_options["#{dependency.name}_#{c_dependency.name}"] = _make_label(c_dependency, :edge)
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
parent_dependencies = tmp
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
def _groups
|
|
53
|
-
relations = Hash.new {|h, k| h[k] = Set.new }
|
|
54
|
-
@env.current_dependencies.each do |dependency|
|
|
55
|
-
dependency.groups.each do |group|
|
|
56
|
-
next if @without_groups.include?(group)
|
|
57
|
-
|
|
58
|
-
relations[group.to_s].add(dependency)
|
|
59
|
-
@relations[group.to_s].add(dependency.name)
|
|
60
|
-
|
|
61
|
-
@node_options[group.to_s] ||= _make_label(group, :node)
|
|
62
|
-
@edge_options["#{group}_#{dependency.name}"] = _make_label(dependency, :edge)
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
|
-
@groups = relations.keys
|
|
66
|
-
relations
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
def _make_label(symbol_or_string_or_dependency, element_type)
|
|
70
|
-
case element_type.to_sym
|
|
71
|
-
when :node
|
|
72
|
-
if symbol_or_string_or_dependency.is_a?(Gem::Dependency)
|
|
73
|
-
label = symbol_or_string_or_dependency.name.dup
|
|
74
|
-
label << "\n#{spec_for_dependency(symbol_or_string_or_dependency).version}" if @show_version
|
|
75
|
-
else
|
|
76
|
-
label = symbol_or_string_or_dependency.to_s
|
|
77
|
-
end
|
|
78
|
-
when :edge
|
|
79
|
-
label = nil
|
|
80
|
-
if symbol_or_string_or_dependency.respond_to?(:requirements_list) && @show_requirements
|
|
81
|
-
tmp = symbol_or_string_or_dependency.requirements_list.join(", ")
|
|
82
|
-
label = tmp if tmp != ">= 0"
|
|
83
|
-
end
|
|
84
|
-
else
|
|
85
|
-
raise ArgumentError, "2nd argument is invalid"
|
|
86
|
-
end
|
|
87
|
-
label.nil? ? {} : { label: label }
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
def spec_for_dependency(dependency)
|
|
91
|
-
@env.requested_specs.find {|s| s.name == dependency.name }
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
class GraphVizClient
|
|
95
|
-
def initialize(graph_instance)
|
|
96
|
-
@graph_name = graph_instance.class::GRAPH_NAME
|
|
97
|
-
@groups = graph_instance.groups
|
|
98
|
-
@relations = graph_instance.relations
|
|
99
|
-
@node_options = graph_instance.node_options
|
|
100
|
-
@edge_options = graph_instance.edge_options
|
|
101
|
-
@output_file = graph_instance.output_file
|
|
102
|
-
@output_format = graph_instance.output_format
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
def g
|
|
106
|
-
@g ||= ::GraphViz.digraph(@graph_name, concentrate: true, normalize: true, nodesep: 0.55) do |g|
|
|
107
|
-
g.edge[:weight] = 2
|
|
108
|
-
g.edge[:fontname] = g.node[:fontname] = "Arial, Helvetica, SansSerif"
|
|
109
|
-
g.edge[:fontsize] = 12
|
|
110
|
-
end
|
|
111
|
-
end
|
|
112
|
-
|
|
113
|
-
def run
|
|
114
|
-
@groups.each do |group|
|
|
115
|
-
g.add_nodes(
|
|
116
|
-
group, {
|
|
117
|
-
style: "filled",
|
|
118
|
-
fillcolor: "#B9B9D5",
|
|
119
|
-
shape: "box3d",
|
|
120
|
-
fontsize: 16,
|
|
121
|
-
}.merge(@node_options[group])
|
|
122
|
-
)
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
@relations.each do |parent, children|
|
|
126
|
-
children.each do |child|
|
|
127
|
-
if @groups.include?(parent)
|
|
128
|
-
g.add_nodes(child, { style: "filled", fillcolor: "#B9B9D5" }.merge(@node_options[child]))
|
|
129
|
-
g.add_edges(parent, child, { constraint: false }.merge(@edge_options["#{parent}_#{child}"]))
|
|
130
|
-
else
|
|
131
|
-
g.add_nodes(child, @node_options[child])
|
|
132
|
-
g.add_edges(parent, child, @edge_options["#{parent}_#{child}"])
|
|
133
|
-
end
|
|
134
|
-
end
|
|
135
|
-
end
|
|
136
|
-
|
|
137
|
-
if @output_format.to_s == "debug"
|
|
138
|
-
$stdout.puts g.output none: String
|
|
139
|
-
Bundler.ui.info "debugging bundle viz..."
|
|
140
|
-
else
|
|
141
|
-
begin
|
|
142
|
-
g.output @output_format.to_sym => "#{@output_file}.#{@output_format}"
|
|
143
|
-
Bundler.ui.info "#{@output_file}.#{@output_format}"
|
|
144
|
-
rescue ArgumentError => e
|
|
145
|
-
warn "Unsupported output format. See Ruby-Graphviz/lib/graphviz/constants.rb"
|
|
146
|
-
raise e
|
|
147
|
-
end
|
|
148
|
-
end
|
|
149
|
-
end
|
|
150
|
-
end
|
|
151
|
-
end
|
|
152
|
-
end
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
.\" generated with Ronn-NG/v0.10.1
|
|
2
|
-
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
|
|
3
|
-
.TH "BUNDLE\-INJECT" "1" "August 2025" ""
|
|
4
|
-
.SH "NAME"
|
|
5
|
-
\fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile
|
|
6
|
-
.SH "SYNOPSIS"
|
|
7
|
-
\fBbundle inject\fR [GEM] [VERSION] [\-\-source=SOURCE] [\-\-group=GROUP]
|
|
8
|
-
.SH "DESCRIPTION"
|
|
9
|
-
Adds the named gem(s) with their version requirements to the resolved [\fBGemfile(5)\fR][Gemfile(5)]\.
|
|
10
|
-
.P
|
|
11
|
-
This command will add the gem to both your [\fBGemfile(5)\fR][Gemfile(5)] and Gemfile\.lock if it isn't listed yet\.
|
|
12
|
-
.P
|
|
13
|
-
Example:
|
|
14
|
-
.IP "" 4
|
|
15
|
-
.nf
|
|
16
|
-
bundle install
|
|
17
|
-
bundle inject 'rack' '> 0'
|
|
18
|
-
.fi
|
|
19
|
-
.IP "" 0
|
|
20
|
-
.P
|
|
21
|
-
This will inject the 'rack' gem with a version greater than 0 in your [\fBGemfile(5)\fR][Gemfile(5)] and Gemfile\.lock\.
|
|
22
|
-
.P
|
|
23
|
-
The \fBbundle inject\fR command was deprecated in Bundler 2\.1 and will be removed in Bundler 4\.0\.
|
|
24
|
-
.SH "OPTIONS"
|
|
25
|
-
.TP
|
|
26
|
-
\fB\-\-source=SOURCE\fR
|
|
27
|
-
Install gem from the given source\.
|
|
28
|
-
.TP
|
|
29
|
-
\fB\-\-group=GROUP\fR
|
|
30
|
-
Install gem into a bundler group\.
|
|
31
|
-
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
bundle-inject(1) -- Add named gem(s) with version requirements to Gemfile
|
|
2
|
-
=========================================================================
|
|
3
|
-
|
|
4
|
-
## SYNOPSIS
|
|
5
|
-
|
|
6
|
-
`bundle inject` [GEM] [VERSION] [--source=SOURCE] [--group=GROUP]
|
|
7
|
-
|
|
8
|
-
## DESCRIPTION
|
|
9
|
-
|
|
10
|
-
Adds the named gem(s) with their version requirements to the resolved
|
|
11
|
-
[`Gemfile(5)`][Gemfile(5)].
|
|
12
|
-
|
|
13
|
-
This command will add the gem to both your [`Gemfile(5)`][Gemfile(5)] and Gemfile.lock if it
|
|
14
|
-
isn't listed yet.
|
|
15
|
-
|
|
16
|
-
Example:
|
|
17
|
-
|
|
18
|
-
bundle install
|
|
19
|
-
bundle inject 'rack' '> 0'
|
|
20
|
-
|
|
21
|
-
This will inject the 'rack' gem with a version greater than 0 in your
|
|
22
|
-
[`Gemfile(5)`][Gemfile(5)] and Gemfile.lock.
|
|
23
|
-
|
|
24
|
-
The `bundle inject` command was deprecated in Bundler 2.1 and will be removed in Bundler 4.0.
|
|
25
|
-
|
|
26
|
-
## OPTIONS
|
|
27
|
-
|
|
28
|
-
* `--source=SOURCE`:
|
|
29
|
-
Install gem from the given source.
|
|
30
|
-
|
|
31
|
-
* `--group=GROUP`:
|
|
32
|
-
Install gem into a bundler group.
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
.\" generated with Ronn-NG/v0.10.1
|
|
2
|
-
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
|
|
3
|
-
.TH "BUNDLE\-VIZ" "1" "August 2025" ""
|
|
4
|
-
.SH "NAME"
|
|
5
|
-
\fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile
|
|
6
|
-
.SH "SYNOPSIS"
|
|
7
|
-
\fBbundle viz\fR [\-\-file=FILE] [\-\-format=FORMAT] [\-\-requirements] [\-\-version] [\-\-without=GROUP GROUP]
|
|
8
|
-
.SH "DESCRIPTION"
|
|
9
|
-
\fBviz\fR generates a PNG file of the current \fBGemfile(5)\fR as a dependency graph\. \fBviz\fR requires the ruby\-graphviz gem (and its dependencies)\.
|
|
10
|
-
.P
|
|
11
|
-
The associated gems must also be installed via \fBbundle install(1)\fR \fIbundle\-install\.1\.html\fR\.
|
|
12
|
-
.P
|
|
13
|
-
\fBviz\fR command was deprecated in Bundler 2\.2\. Use bundler\-graph plugin \fIhttps://github\.com/rubygems/bundler\-graph\fR instead\.
|
|
14
|
-
.SH "OPTIONS"
|
|
15
|
-
.TP
|
|
16
|
-
\fB\-\-file=FILE\fR, \fB\-f=FILE\fR
|
|
17
|
-
The name to use for the generated file\. See \fB\-\-format\fR option
|
|
18
|
-
.TP
|
|
19
|
-
\fB\-\-format=FORMAT\fR, \fB\-F=FORMAT\fR
|
|
20
|
-
This is output format option\. Supported format is png, jpg, svg, dot \|\.\|\.\|\.
|
|
21
|
-
.TP
|
|
22
|
-
\fB\-\-requirements\fR, \fB\-R\fR
|
|
23
|
-
Set to show the version of each required dependency\.
|
|
24
|
-
.TP
|
|
25
|
-
\fB\-\-version\fR, \fB\-v\fR
|
|
26
|
-
Set to show each gem version\.
|
|
27
|
-
.TP
|
|
28
|
-
\fB\-\-without=<list>\fR, \fB\-W=<list>\fR
|
|
29
|
-
Exclude gems that are part of the specified named group\.
|
|
30
|
-
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
bundle-viz(1) -- Generates a visual dependency graph for your Gemfile
|
|
2
|
-
=====================================================================
|
|
3
|
-
|
|
4
|
-
## SYNOPSIS
|
|
5
|
-
|
|
6
|
-
`bundle viz` [--file=FILE]
|
|
7
|
-
[--format=FORMAT]
|
|
8
|
-
[--requirements]
|
|
9
|
-
[--version]
|
|
10
|
-
[--without=GROUP GROUP]
|
|
11
|
-
|
|
12
|
-
## DESCRIPTION
|
|
13
|
-
|
|
14
|
-
`viz` generates a PNG file of the current `Gemfile(5)` as a dependency graph.
|
|
15
|
-
`viz` requires the ruby-graphviz gem (and its dependencies).
|
|
16
|
-
|
|
17
|
-
The associated gems must also be installed via [`bundle install(1)`](bundle-install.1.html).
|
|
18
|
-
|
|
19
|
-
`viz` command was deprecated in Bundler 2.2. Use [bundler-graph plugin](https://github.com/rubygems/bundler-graph) instead.
|
|
20
|
-
|
|
21
|
-
## OPTIONS
|
|
22
|
-
|
|
23
|
-
* `--file=FILE`, `-f=FILE`:
|
|
24
|
-
The name to use for the generated file. See `--format` option
|
|
25
|
-
|
|
26
|
-
* `--format=FORMAT`, `-F=FORMAT`:
|
|
27
|
-
This is output format option. Supported format is png, jpg, svg, dot ...
|
|
28
|
-
|
|
29
|
-
* `--requirements`, `-R`:
|
|
30
|
-
Set to show the version of each required dependency.
|
|
31
|
-
|
|
32
|
-
* `--version`, `-v`:
|
|
33
|
-
Set to show each gem version.
|
|
34
|
-
|
|
35
|
-
* `--without=<list>`, `-W=<list>`:
|
|
36
|
-
Exclude gems that are part of the specified named group.
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Bundler
|
|
4
|
-
class SimilarityDetector
|
|
5
|
-
SimilarityScore = Struct.new(:string, :distance)
|
|
6
|
-
|
|
7
|
-
# initialize with an array of words to be matched against
|
|
8
|
-
def initialize(corpus)
|
|
9
|
-
@corpus = corpus
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
# return an array of words similar to 'word' from the corpus
|
|
13
|
-
def similar_words(word, limit = 3)
|
|
14
|
-
words_by_similarity = @corpus.map {|w| SimilarityScore.new(w, levenshtein_distance(word, w)) }
|
|
15
|
-
words_by_similarity.select {|s| s.distance <= limit }.sort_by(&:distance).map(&:string)
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
# return the result of 'similar_words', concatenated into a list
|
|
19
|
-
# (eg "a, b, or c")
|
|
20
|
-
def similar_word_list(word, limit = 3)
|
|
21
|
-
words = similar_words(word, limit)
|
|
22
|
-
if words.length == 1
|
|
23
|
-
words[0]
|
|
24
|
-
elsif words.length > 1
|
|
25
|
-
[words[0..-2].join(", "), words[-1]].join(" or ")
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
protected
|
|
30
|
-
|
|
31
|
-
# https://www.informit.com/articles/article.aspx?p=683059&seqNum=36
|
|
32
|
-
def levenshtein_distance(this, that, ins = 2, del = 2, sub = 1)
|
|
33
|
-
# ins, del, sub are weighted costs
|
|
34
|
-
return nil if this.nil?
|
|
35
|
-
return nil if that.nil?
|
|
36
|
-
dm = [] # distance matrix
|
|
37
|
-
|
|
38
|
-
# Initialize first row values
|
|
39
|
-
dm[0] = (0..this.length).collect {|i| i * ins }
|
|
40
|
-
fill = [0] * (this.length - 1)
|
|
41
|
-
|
|
42
|
-
# Initialize first column values
|
|
43
|
-
(1..that.length).each do |i|
|
|
44
|
-
dm[i] = [i * del, fill.flatten]
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
# populate matrix
|
|
48
|
-
(1..that.length).each do |i|
|
|
49
|
-
(1..this.length).each do |j|
|
|
50
|
-
# critical comparison
|
|
51
|
-
dm[i][j] = [
|
|
52
|
-
dm[i - 1][j - 1] + (this[j - 1] == that[i - 1] ? 0 : sub),
|
|
53
|
-
dm[i][j - 1] + ins,
|
|
54
|
-
dm[i - 1][j] + del,
|
|
55
|
-
].min
|
|
56
|
-
end
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
# The last value in matrix is the Levenshtein distance between the strings
|
|
60
|
-
dm[that.length][this.length]
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
|
-
end
|