bundle_filter 0.1.0 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 412499166f103f8273e09aed2e8d1c238ad71a9dd4e3184f3b299d0a236dee5f
4
- data.tar.gz: f0e44c5a8e4422726b2eaf4cb8fe251d0b7ab2371a0cfc4891185aeb696f9da5
3
+ metadata.gz: 23973febc234a75f39b20f397dbe1ca8a839c85937a98111e9091a9dee7282b8
4
+ data.tar.gz: aa4fb1509bf7e58d4edd2ac53d054631588ca88a112cf7005d0c6ddcbc84d5d7
5
5
  SHA512:
6
- metadata.gz: 5de48543cd8c0835588ad897bc2d8cc326eac833915b450e6bc275a433631efb1cf460789c1b1ba258c778146ccb5fa0060b08b804a9e7c481ac4545b5942b9a
7
- data.tar.gz: 0f58a9e494a9fbff59f2cad25ee4395b500cdf1e6cc19a8c9aa4475e1fe62068af75704c90184816664fcb80a1859f578ba2cfea1aec7d2ff92083478fbf95ee
6
+ metadata.gz: 736ec554fea256457ac95f38c77ebda38eb31dd257883168eef2f503c18376d3bb41c5439355c6c6ed00c4c23d91cc1b280a40b273dffaee085b213dc247b2bc
7
+ data.tar.gz: 3f6c05ded3d18391a733e8ccade3fef9d147947be66383600d02c6e64a51195091c8979b8f0bd89483b0a3703fe3a09814c311243a2c0f71cee05d3ab7c7210c
@@ -0,0 +1,11 @@
1
+ ## Description
2
+
3
+ Describe what suggestion/feature/bug/fix you pretend to talk about.
4
+
5
+ ## Expected
6
+
7
+ Explain what you expected to see.
8
+
9
+ ## Actual
10
+
11
+ Explain how it differs from actual code.
@@ -0,0 +1,19 @@
1
+ ## New Features
2
+
3
+ Write here your new features.
4
+
5
+ ## Fixes
6
+
7
+ Write here your fixes.
8
+
9
+ ## Changes
10
+
11
+ Changes proposed in this pull request:
12
+ * Replace
13
+ * With your
14
+ * Changes
15
+
16
+ ## Make sure your PR attent this requeriments
17
+
18
+ - [X] Write your code for new features and bug fixes.
19
+ - [X] Make sure that your pull request includes entry in the [CHANGELOG](CHANGELOG.md).
@@ -0,0 +1,26 @@
1
+ name: Rubocop and RSpec
2
+ on:
3
+ push:
4
+ branches: [ "main" ]
5
+ pull_request:
6
+ branches: [ "main" ]
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ test:
13
+ runs-on: ubuntu-latest
14
+ strategy:
15
+ matrix:
16
+ ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2']
17
+
18
+ steps:
19
+ - uses: actions/checkout@v3
20
+ - name: Set up Ruby
21
+ uses: ruby/setup-ruby@v1
22
+ with:
23
+ ruby-version: ${{ matrix.ruby-version }}
24
+ bundler-cache: true
25
+ - name: Run tests
26
+ run: bundle exec rake
data/.gitignore ADDED
@@ -0,0 +1,16 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ bundle_filter-*.gem
11
+
12
+ # rspec failure tracking
13
+ .rspec_status
14
+
15
+ .ruby-version
16
+ .ruby-gemset
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --require spec_helper
2
+ --color
3
+ --order random
data/.rubocop.yml ADDED
@@ -0,0 +1,52 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6
3
+ NewCops: enable
4
+
5
+ require:
6
+ - rubocop-rake
7
+ - rubocop-rspec
8
+
9
+ Metrics/ClassLength:
10
+ Enabled: false
11
+
12
+ Metrics/MethodLength:
13
+ Enabled: false
14
+
15
+ Metrics/PerceivedComplexity:
16
+ Enabled: false
17
+
18
+ Metrics/CyclomaticComplexity:
19
+ Enabled: false
20
+
21
+ Metrics/AbcSize:
22
+ Enabled: false
23
+
24
+ Style/ClassAndModuleChildren:
25
+ Enabled: false
26
+
27
+ Style/HashSyntax:
28
+ Enabled: false
29
+
30
+ Style/IfUnlessModifier:
31
+ Enabled: false
32
+
33
+ Style/OptionalBooleanParameter:
34
+ Enabled: false
35
+
36
+ Layout/LineLength:
37
+ Enabled: false
38
+
39
+ Layout/ArgumentAlignment:
40
+ Enabled: false
41
+
42
+ Style/Documentation:
43
+ Enabled: false
44
+
45
+ Style/FrozenStringLiteralComment:
46
+ Enabled: false
47
+
48
+ RSpec/ExampleLength:
49
+ Enabled: false
50
+
51
+ RSpec/MultipleExpectations:
52
+ Enabled: false
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ ---
2
+ language: ruby
3
+ cache: bundler
4
+ rvm:
5
+ - 2.7.2
6
+ before_install: gem install bundler -v 2.1.4
data/CHANGELOG.md ADDED
@@ -0,0 +1,41 @@
1
+ # Change Log
2
+
3
+ ## [Next](https://github.com/dfop02/bundle_filter/tree/HEAD)
4
+ [Full Changelog](https://github.com/dfop02/bundle_filter/compare/0.3.0...HEAD)
5
+
6
+ ## [0.3.0](https://github.com/dfop02/bundle_filter/releases/tag/0.3.0)
7
+ 02 May 2023 - [Full Changelog](https://github.com/dfop02/bundle_filter/compare/0.2.0...0.3.0)
8
+
9
+ #### New features
10
+
11
+ * Update Readme for better understand.
12
+ * Add Rubocop to gem.
13
+ * Add Github Workflows and Templates.
14
+ * Add few tests, but they're still incomplete.
15
+ * Update Rakefile to run Rubocop and RSpec.
16
+
17
+ #### Bug fixes
18
+
19
+ * Fix RSpec.
20
+
21
+ ## [0.2.0](https://github.com/dfop02/bundle_filter/releases/tag/0.2.0)
22
+ 19 April 2023 - [Full Changelog](https://github.com/dfop02/bundle_filter/compare/0.1.0...0.2.0)
23
+
24
+ #### New features
25
+
26
+ * None
27
+
28
+ #### Bug fixes
29
+
30
+ * Fix 'Failed to install plugin'
31
+
32
+ ## [0.1.0](https://github.com/dfop02/bundle_filter/releases/tag/0.1.0)
33
+ 19 April 2023
34
+
35
+ #### New features
36
+
37
+ * Remove useless information from bundle install to make it more clean.
38
+
39
+ #### Bug fixes
40
+
41
+ * None
data/Gemfile ADDED
@@ -0,0 +1,15 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in bundler-filter.gemspec
4
+ gemspec
5
+
6
+ group :development do
7
+ gem 'rake', '~> 12.0'
8
+ gem 'rspec', '~> 3.0'
9
+ end
10
+
11
+ group :rubocop do
12
+ gem 'rubocop', require: false
13
+ gem 'rubocop-rake', require: false
14
+ gem 'rubocop-rspec', require: false
15
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,66 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ bundle_filter (0.3.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ ast (2.4.2)
10
+ diff-lcs (1.5.0)
11
+ json (2.6.3)
12
+ parallel (1.23.0)
13
+ parser (3.2.2.1)
14
+ ast (~> 2.4.1)
15
+ rainbow (3.1.1)
16
+ rake (12.3.3)
17
+ regexp_parser (2.8.0)
18
+ rexml (3.2.5)
19
+ rspec (3.12.0)
20
+ rspec-core (~> 3.12.0)
21
+ rspec-expectations (~> 3.12.0)
22
+ rspec-mocks (~> 3.12.0)
23
+ rspec-core (3.12.1)
24
+ rspec-support (~> 3.12.0)
25
+ rspec-expectations (3.12.2)
26
+ diff-lcs (>= 1.2.0, < 2.0)
27
+ rspec-support (~> 3.12.0)
28
+ rspec-mocks (3.12.5)
29
+ diff-lcs (>= 1.2.0, < 2.0)
30
+ rspec-support (~> 3.12.0)
31
+ rspec-support (3.12.0)
32
+ rubocop (1.50.2)
33
+ json (~> 2.3)
34
+ parallel (~> 1.10)
35
+ parser (>= 3.2.0.0)
36
+ rainbow (>= 2.2.2, < 4.0)
37
+ regexp_parser (>= 1.8, < 3.0)
38
+ rexml (>= 3.2.5, < 4.0)
39
+ rubocop-ast (>= 1.28.0, < 2.0)
40
+ ruby-progressbar (~> 1.7)
41
+ unicode-display_width (>= 2.4.0, < 3.0)
42
+ rubocop-ast (1.28.1)
43
+ parser (>= 3.2.1.0)
44
+ rubocop-capybara (2.18.0)
45
+ rubocop (~> 1.41)
46
+ rubocop-rake (0.6.0)
47
+ rubocop (~> 1.0)
48
+ rubocop-rspec (2.20.0)
49
+ rubocop (~> 1.33)
50
+ rubocop-capybara (~> 2.17)
51
+ ruby-progressbar (1.13.0)
52
+ unicode-display_width (2.4.2)
53
+
54
+ PLATFORMS
55
+ ruby
56
+
57
+ DEPENDENCIES
58
+ bundle_filter!
59
+ rake (~> 12.0)
60
+ rspec (~> 3.0)
61
+ rubocop
62
+ rubocop-rake
63
+ rubocop-rspec
64
+
65
+ BUNDLED WITH
66
+ 2.1.4
data/README.md CHANGED
@@ -4,7 +4,11 @@ A filter for bundle that removes useless info when run bundle
4
4
 
5
5
  ## Installation
6
6
 
7
- Add this line to your application's Gemfile:
7
+ You can install by command line using
8
+
9
+ $ bundler plugin install bundle_filter
10
+
11
+ or add this line to your application's Gemfile:
8
12
 
9
13
  ```ruby
10
14
  plugin 'bundle_filter'
@@ -18,11 +22,21 @@ After install, every time you execute:
18
22
 
19
23
  this plugin will remove useless info from bundle install like unchanged gems "Using gem x.y.z"
20
24
 
25
+ ## Uninstall
26
+
27
+ For uninstall the plugin from your application, you must run code above even if you install from Gemfile (only available on Bundler >= 2.2.0)
28
+
29
+ $ bundler plugin uninstall bundle_filter
30
+
31
+ If your Bundler < 2.2.0, you should instead go to root of your project and delete de `.bundle/plugin/` folder, will work as well.
32
+
21
33
  ## To-do
22
34
 
23
- New features that can be interesting to add
35
+ New features ideas that may be interesting to add if more users want too
24
36
  - Set config file to give freedom to user select which show up
25
37
  - Remove or simplify "Complete" final mensage
38
+ - Add a "pretty" bundle install?
39
+ - Add progress-bar to bundle install gem?
26
40
 
27
41
  ## Contributing
28
42
 
data/Rakefile ADDED
@@ -0,0 +1,11 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+ require 'rubocop/rake_task'
4
+
5
+ RuboCop::RakeTask.new(:rubocop) do |t|
6
+ t.options = ['--display-cop-names']
7
+ end
8
+
9
+ RSpec::Core::RakeTask.new(:spec)
10
+
11
+ task default: %i[rubocop spec]
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/setup'
4
+ require 'bundler/filter'
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require 'irb'
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,36 @@
1
+ require_relative 'lib/bundle_filter/version'
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = 'bundle_filter'
5
+ spec.version = BundleFilter::VERSION
6
+ spec.authors = ['Diogo Fernandes']
7
+ spec.email = ['diogofernandesop@gmail.com']
8
+ spec.summary = 'Filter bundle install output.'
9
+ spec.description = 'A filter for bundle that removes useless info when run bundle.'
10
+ spec.homepage = 'https://github.com/dfop02/bundle_filter'
11
+ spec.license = 'MIT'
12
+
13
+ spec.metadata = {
14
+ 'allowed_push_host' => 'https://rubygems.org',
15
+ 'bug_tracker_uri' => "#{spec.homepage}/issues",
16
+ 'changelog_uri' => "#{spec.homepage}/blob/#{spec.version}/Changelog.md",
17
+ 'homepage_uri' => spec.homepage,
18
+ 'documentation_uri' => spec.homepage,
19
+ 'source_code_uri' => spec.homepage,
20
+ 'rubygems_mfa_required' => 'true'
21
+ }
22
+
23
+ # Specify which files should be added to the gem when it is released.
24
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
26
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
27
+ end
28
+ spec.rdoc_options = ['--charset=UTF-8']
29
+ spec.extra_rdoc_files = Dir['README.md', 'CHANGELOG.md', 'LICENSE']
30
+ spec.require_path = 'lib'
31
+ spec.bindir = 'exe'
32
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
33
+ spec.require_paths = ['lib']
34
+
35
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.6.0')
36
+ end
@@ -1,9 +1,43 @@
1
1
  class Bundler::Source
2
- def print_using_message(message)
3
- if !message.include?("(was ") && Bundler.feature_flag.suppress_install_using_messages?
4
- Bundler.ui.debug message
2
+ def version_message(spec, locked_spec = nil)
3
+ message = spec.name.to_s
4
+
5
+ if locked_spec
6
+ locked_spec_version = locked_spec.version
7
+ if locked_spec_version && spec.version != locked_spec_version
8
+ message += Bundler.ui.add_color(' [', :white)
9
+ message += Bundler.ui.add_color(locked_spec_version.to_s, version_color(locked_spec_version, spec.version))
10
+ message += Bundler.ui.add_color(' => ', :white)
11
+ message += Bundler.ui.add_color(spec.version.to_s, version_color(spec.version, locked_spec_version))
12
+ message += Bundler.ui.add_color(']', :white)
13
+ end
14
+ end
15
+ message += " #{spec.version}" unless message.include?('=>')
16
+ message += " (#{spec.platform})" if spec.platform != Gem::Platform::RUBY && !spec.platform.nil?
17
+
18
+ message
19
+ end
20
+
21
+ private
22
+
23
+ def version_color(spec_version, locked_spec_version)
24
+ if Gem::Version.correct?(spec_version) && Gem::Version.correct?(locked_spec_version)
25
+ # display yellow if there appears to be a regression
26
+ earlier_version?(spec_version, locked_spec_version) ? :yellow : :green
5
27
  else
6
- Bundler.ui.info message
28
+ # default to green if the versions cannot be directly compared
29
+ :green
7
30
  end
8
31
  end
32
+
33
+ def earlier_version?(spec_version, locked_spec_version)
34
+ Gem::Version.new(spec_version) < Gem::Version.new(locked_spec_version)
35
+ end
36
+
37
+ def print_using_message(message)
38
+ # suppress_install_using_messages
39
+ # ignore 'suppress_install_using_messages' flag because was
40
+ # introduced on bundler > 3
41
+ message.include?('=>') ? Bundler.ui.info(message) : Bundler.ui.debug(message)
42
+ end
9
43
  end
@@ -9,13 +9,11 @@ class Bundler::Source::Rubygems
9
9
  end
10
10
 
11
11
  if installed?(spec) && !force
12
- # Hide message when gem already installed and not changed
13
- print_using_message "Using #{version_message(spec, options[:previous_spec])}" unless BundleFilter::Configuration.pretty
14
- return nil # no post-install message
12
+ print_using_message("Using #{version_message(spec, options[:previous_spec])}")
13
+ return nil
15
14
  end
16
15
 
17
16
  if spec.remote
18
- # Check for this spec from other sources
19
17
  uris = [spec.remote, *remotes_for_spec(spec)].map(&:anonymized_uri).uniq
20
18
  Installer.ambiguous_gems << [spec.name, *uris] if uris.length > 1
21
19
  end
@@ -28,11 +26,11 @@ class Bundler::Source::Rubygems
28
26
  install_path = rubygems_dir
29
27
  bin_path = Bundler.system_bindir
30
28
 
31
- require_relative "../rubygems_gem_installer"
29
+ require 'bundler/rubygems_gem_installer'
32
30
 
33
31
  installer = Bundler::RubyGemsGemInstaller.at(
34
32
  path,
35
- :security_policy => Bundler.rubygems.security_policies[Bundler.settings["trust-policy"]],
33
+ :security_policy => Bundler.rubygems.security_policies[Bundler.settings['trust-policy']],
36
34
  :install_dir => install_path.to_s,
37
35
  :bin_dir => bin_path.to_s,
38
36
  :ignore_dependencies => true,
@@ -51,7 +49,7 @@ class Bundler::Source::Rubygems
51
49
  raise
52
50
  rescue Gem::Security::Exception => e
53
51
  raise SecurityError,
54
- "The gem #{File.basename(path, ".gem")} can't be installed because " \
52
+ "The gem #{File.basename(path, '.gem')} can't be installed because " \
55
53
  "the security policy didn't allow it, with the message: #{e.message}"
56
54
  end
57
55
 
@@ -59,8 +57,8 @@ class Bundler::Source::Rubygems
59
57
  end
60
58
 
61
59
  message = "Installing #{version_message(spec, options[:previous_spec])}"
62
- message += " with native extensions" if spec.extensions.any?
63
- Bundler.ui.confirm message
60
+ message += ' with native extensions' if spec.extensions.any?
61
+ Bundler.ui.confirm(message)
64
62
 
65
63
  installed_spec = installer.install
66
64
 
@@ -69,4 +67,12 @@ class Bundler::Source::Rubygems
69
67
 
70
68
  spec.post_install_message
71
69
  end
70
+
71
+ private
72
+
73
+ def download_gem(spec, download_cache_path, _previous_spec = nil)
74
+ uri = spec.remote.uri
75
+ Bundler.ui.confirm("Fetching #{version_message(spec, nil)}")
76
+ Bundler.rubygems.download_gem(spec, uri, download_cache_path)
77
+ end
72
78
  end
@@ -1,3 +1,3 @@
1
1
  module BundleFilter
2
- VERSION = "0.1.0"
2
+ VERSION = '0.3.0'.freeze
3
3
  end
data/lib/bundle_filter.rb CHANGED
@@ -1,11 +1,7 @@
1
+ # require 'progressbar'
1
2
  require 'bundler'
2
- require 'bundle_filter/configuration'
3
- require 'bundle_filter/cli'
4
3
  require 'bundle_filter/source'
5
- require 'bundle_filter/rubygems'
6
- require 'bundle_filter/metadata'
7
- require 'bundle_filter/git'
8
- require 'bundle_filter/path'
4
+ require 'bundle_filter/source_rubygems'
9
5
 
10
6
  module BundleFilter
11
7
  Bundler::Plugin.add_hook('before-install-all') do |dependencies|
data/plugins.rb ADDED
@@ -0,0 +1 @@
1
+ require 'bundle_filter'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundle_filter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diogo Fernandes
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-19 00:00:00.000000000 Z
11
+ date: 2023-05-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A filter for bundle that removes useless info when run bundle.
14
14
  email:
@@ -17,30 +17,41 @@ executables: []
17
17
  extensions: []
18
18
  extra_rdoc_files:
19
19
  - README.md
20
+ - CHANGELOG.md
20
21
  - LICENSE
21
22
  files:
23
+ - ".github/issue_template.md"
24
+ - ".github/pull_request_template.md"
25
+ - ".github/workflows/rubocop_and_rspec.yml"
26
+ - ".gitignore"
27
+ - ".rspec"
28
+ - ".rubocop.yml"
29
+ - ".travis.yml"
30
+ - CHANGELOG.md
31
+ - Gemfile
32
+ - Gemfile.lock
22
33
  - LICENSE
23
34
  - README.md
35
+ - Rakefile
36
+ - bin/console
37
+ - bin/setup
38
+ - bundle_filter.gemspec
24
39
  - lib/bundle_filter.rb
25
- - lib/bundle_filter/cli.rb
26
- - lib/bundle_filter/configuration.rb
27
- - lib/bundle_filter/git.rb
28
- - lib/bundle_filter/install.rb
29
- - lib/bundle_filter/metadata.rb
30
- - lib/bundle_filter/path.rb
31
- - lib/bundle_filter/rubygems.rb
32
40
  - lib/bundle_filter/source.rb
41
+ - lib/bundle_filter/source_rubygems.rb
33
42
  - lib/bundle_filter/version.rb
43
+ - plugins.rb
34
44
  homepage: https://github.com/dfop02/bundle_filter
35
45
  licenses:
36
46
  - MIT
37
47
  metadata:
38
48
  allowed_push_host: https://rubygems.org
39
49
  bug_tracker_uri: https://github.com/dfop02/bundle_filter/issues
40
- changelog_uri: https://github.com/dfop02/bundle_filter/blob/0.1.0/Changelog.md
50
+ changelog_uri: https://github.com/dfop02/bundle_filter/blob/0.3.0/Changelog.md
41
51
  homepage_uri: https://github.com/dfop02/bundle_filter
42
- documentation_uri: https://rspec.info/documentation/
52
+ documentation_uri: https://github.com/dfop02/bundle_filter
43
53
  source_code_uri: https://github.com/dfop02/bundle_filter
54
+ rubygems_mfa_required: 'true'
44
55
  post_install_message:
45
56
  rdoc_options:
46
57
  - "--charset=UTF-8"
@@ -50,14 +61,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
50
61
  requirements:
51
62
  - - ">="
52
63
  - !ruby/object:Gem::Version
53
- version: 2.3.0
64
+ version: 2.6.0
54
65
  required_rubygems_version: !ruby/object:Gem::Requirement
55
66
  requirements:
56
67
  - - ">="
57
68
  - !ruby/object:Gem::Version
58
69
  version: '0'
59
70
  requirements: []
60
- rubygems_version: 3.1.4
71
+ rubygems_version: 3.4.12
61
72
  signing_key:
62
73
  specification_version: 4
63
74
  summary: Filter bundle install output.
@@ -1,14 +0,0 @@
1
- class Bundler::CLI
2
- def install
3
- SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
4
-
5
- %w[clean deployment frozen no-cache no-prune path shebang system without with].each do |option|
6
- remembered_flag_deprecation(option)
7
- end
8
-
9
- require_relative "install"
10
- Bundler.settings.temporary(no_install: false) do
11
- Install.new(options.dup).run
12
- end
13
- end
14
- end
@@ -1,24 +0,0 @@
1
- module BundleFilter
2
- class Configuration
3
- PRETTY = true
4
- STYLE = 'boxes'
5
-
6
- class << self
7
- def pretty
8
- PRETTY
9
- end
10
-
11
- def style
12
- STYLE
13
- end
14
-
15
- def default_style?
16
- STYLE == 'default'
17
- end
18
-
19
- def boxes_style?
20
- STYLE == 'boxes'
21
- end
22
- end
23
- end
24
- end
@@ -1,19 +0,0 @@
1
- class Bundler::Source::Git
2
- def install(spec, options = {})
3
- force = options[:force]
4
-
5
- print_using_message "Using #{version_message(spec, options[:previous_spec])} from #{self}" unless BundleFilter::Configuration.pretty
6
-
7
- if (requires_checkout? && !@copied) || force
8
- Bundler.ui.debug " * Checking out revision: #{ref}"
9
- git_proxy.copy_to(install_path, submodules)
10
- serialize_gemspecs_in(install_path)
11
- @copied = true
12
- end
13
-
14
- generate_bin_options = { :disable_extensions => !Bundler.rubygems.spec_missing_extensions?(spec), :build_args => options[:build_args] }
15
- generate_bin(spec, generate_bin_options)
16
-
17
- requires_checkout? ? spec.post_install_message : nil
18
- end
19
- end
@@ -1,96 +0,0 @@
1
- class Bundler::CLI::Install
2
- def run
3
- Bundler.ui.level = "warn" if options[:quiet]
4
-
5
- warn_if_root
6
-
7
- Bundler.self_manager.install_locked_bundler_and_restart_with_it_if_needed
8
-
9
- Bundler::SharedHelpers.set_env "RB_USER_INSTALL", "1" if Bundler::FREEBSD
10
-
11
- # Disable color in deployment mode
12
- Bundler.ui.shell = Thor::Shell::Basic.new if options[:deployment]
13
-
14
- check_for_options_conflicts
15
-
16
- check_trust_policy
17
-
18
- if options[:deployment] || options[:frozen] || Bundler.frozen_bundle?
19
- unless Bundler.default_lockfile.exist?
20
- flag = "--deployment flag" if options[:deployment]
21
- flag ||= "--frozen flag" if options[:frozen]
22
- flag ||= "deployment setting"
23
- raise ProductionError, "The #{flag} requires a #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}. Please make " \
24
- "sure you have checked your #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} into version control " \
25
- "before deploying."
26
- end
27
-
28
- options[:local] = true if Bundler.app_cache.exist?
29
-
30
- Bundler.settings.set_command_option :deployment, true if options[:deployment]
31
- Bundler.settings.set_command_option :frozen, true if options[:frozen]
32
- end
33
-
34
- # When install is called with --no-deployment, disable deployment mode
35
- if options[:deployment] == false
36
- Bundler.settings.set_command_option :frozen, nil
37
- options[:system] = true
38
- end
39
-
40
- normalize_settings
41
-
42
- Bundler::Fetcher.disable_endpoint = options["full-index"]
43
-
44
- if options["binstubs"]
45
- Bundler::SharedHelpers.major_deprecation 2,
46
- "The --binstubs option will be removed in favor of `bundle binstubs --all`"
47
- end
48
-
49
- Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins?
50
-
51
- definition = Bundler.definition
52
- definition.validate_runtime!
53
-
54
- installer = Installer.install(Bundler.root, definition, options)
55
-
56
- Bundler.settings.temporary(cache_all_platforms: options[:local] ? false : Bundler.settings[:cache_all_platforms]) do
57
- Bundler.load.cache(nil, options[:local]) if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.frozen_bundle?
58
- end
59
-
60
- complete_msg = "Bundle complete! #{dependencies_count_for(definition)}, #{gems_installed_for(definition)}."
61
-
62
- puts BundleFilter::Configuration.style
63
- if BundleFilter::Configuration.default_style?
64
- Bundler.ui.confirm complete_msg
65
- elsif BundleFilter::Configuration.boxes_style?
66
- box_style = ("-" * complete_msg.length).insert(0, '|').insert(-1, '|')
67
- Bundler.ui.confirm box_style
68
- Bundler.ui.confirm complete_msg.insert(0, '|').insert(-1, '|')
69
- Bundler.ui.confirm box_style
70
- end
71
-
72
- Bundler::CLI::Common.output_without_groups_message(:install)
73
-
74
- # disable final message
75
- # if Bundler.use_system_gems?
76
- # Bundler.ui.confirm "Use `bundle info [gemname]` to see where a bundled gem is installed."
77
- # else
78
- # relative_path = Bundler.configured_bundle_path.base_path_relative_to_pwd
79
- # Bundler.ui.confirm "Bundled gems are installed into `#{relative_path}`"
80
- # end
81
-
82
- Bundler::CLI::Common.output_post_install_messages installer.post_install_messages
83
-
84
- warn_ambiguous_gems
85
-
86
- if CLI::Common.clean_after_install?
87
- require_relative "clean"
88
- Bundler::CLI::Clean.new(options).run
89
- end
90
-
91
- Bundler::CLI::Common.output_fund_metadata_summary
92
- rescue Gem::InvalidSpecificationException
93
- Bundler.ui.warn "You have one or more invalid gemspecs that need to be fixed."
94
- raise
95
- end
96
- end
@@ -1,6 +0,0 @@
1
- class Bundler::Source::Metadata
2
- def install(spec, _opts = {})
3
- print_using_message "Using #{version_message(spec)}" unless BundleFilter::Configuration.pretty
4
- nil
5
- end
6
- end
@@ -1,9 +0,0 @@
1
- class Bundler::Source::Path
2
- def install(spec, options = {})
3
- using_message = "Using #{version_message(spec, options[:previous_spec])} from #{self}"
4
- using_message += " and installing its executables" unless spec.executables.empty?
5
- print_using_message using_message unless BundleFilter::Configuration.pretty
6
- generate_bin(spec, :disable_extensions => true)
7
- nil # no post-install message
8
- end
9
- end