cleanup_vendor 0.2.0.pre.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 +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.rubocop.yml +30 -0
- data/.travis.yml +20 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +74 -0
- data/LICENSE.txt +21 -0
- data/README.md +49 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/cleanup_vendor.gemspec +33 -0
- data/exe/cleanup_vendor +61 -0
- data/lib/cleanup_vendor.rb +125 -0
- data/lib/cleanup_vendor/version.rb +5 -0
- metadata +156 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: cb781c69ce55d187d0da2a212783dcef2910c8b181334651b6c95691db5fce7f
|
|
4
|
+
data.tar.gz: a0649cfb8c5a8b6d2c447ff5ae8d0de9c1e48f3b436f6a5dbb27b97ffc74c1ba
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 39741ff65557e145d2d453366a5c84f72ddc7942b47a793cdb491006e74cc6fd09cd4e21ea77391431742b1203b503b4511e21a5c1593ef41925c244dd90f401
|
|
7
|
+
data.tar.gz: 299f334c5b4e124497850edb6a86a4f5edf0a8a365a75f13b5a112bfdf65aeadb01599579c25429179676d88e297554c7f1bbf8d47871d7d338a97431633cb96
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
AllCops:
|
|
2
|
+
TargetRubyVersion: 2.5
|
|
3
|
+
Exclude:
|
|
4
|
+
- 'bin/**/*'
|
|
5
|
+
- 'vendor/**/*'
|
|
6
|
+
- 'vendor.test/**/*'
|
|
7
|
+
|
|
8
|
+
Layout/LineLength:
|
|
9
|
+
Exclude:
|
|
10
|
+
- 'exe/cleanup_vendor'
|
|
11
|
+
Max: 128
|
|
12
|
+
|
|
13
|
+
Metrics/BlockLength:
|
|
14
|
+
Exclude:
|
|
15
|
+
- 'exe/cleanup_vendor'
|
|
16
|
+
- 'spec/**/*'
|
|
17
|
+
|
|
18
|
+
Style/AccessModifierDeclarations:
|
|
19
|
+
Enabled: false
|
|
20
|
+
Style/Documentation:
|
|
21
|
+
Enabled: false
|
|
22
|
+
Style/HashEachMethods:
|
|
23
|
+
Enabled: true
|
|
24
|
+
Style/HashTransformKeys:
|
|
25
|
+
Enabled: true
|
|
26
|
+
Style/HashTransformValues:
|
|
27
|
+
Enabled: true
|
|
28
|
+
Style/StderrPuts:
|
|
29
|
+
Exclude:
|
|
30
|
+
- 'lib/cleanup_vendor.rb'
|
data/.travis.yml
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
env:
|
|
2
|
+
global:
|
|
3
|
+
- CC_TEST_REPORTER_ID=223eccd52e0685221f32d788a5847a98d00c00688c3eebfa714ee95887d40f20
|
|
4
|
+
- COVERAGE=on
|
|
5
|
+
language: ruby
|
|
6
|
+
rvm:
|
|
7
|
+
- 2.5.0
|
|
8
|
+
- 2.6.0
|
|
9
|
+
before_install:
|
|
10
|
+
- gem update --system
|
|
11
|
+
- bundle update --bundler
|
|
12
|
+
before_script:
|
|
13
|
+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
|
14
|
+
- chmod +x ./cc-test-reporter
|
|
15
|
+
- ./cc-test-reporter before-build
|
|
16
|
+
script:
|
|
17
|
+
- bundle exec rspec
|
|
18
|
+
- bundle exec rubocop
|
|
19
|
+
after_script:
|
|
20
|
+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
cleanup_vendor (0.1.0)
|
|
5
|
+
|
|
6
|
+
GEM
|
|
7
|
+
remote: https://rubygems.org/
|
|
8
|
+
specs:
|
|
9
|
+
ast (2.4.0)
|
|
10
|
+
byebug (11.1.1)
|
|
11
|
+
coderay (1.1.2)
|
|
12
|
+
diff-lcs (1.3)
|
|
13
|
+
docile (1.3.2)
|
|
14
|
+
gem-release (2.1.1)
|
|
15
|
+
jaro_winkler (1.5.4)
|
|
16
|
+
method_source (0.9.2)
|
|
17
|
+
parallel (1.19.1)
|
|
18
|
+
parser (2.7.0.4)
|
|
19
|
+
ast (~> 2.4.0)
|
|
20
|
+
pry (0.12.2)
|
|
21
|
+
coderay (~> 1.1.0)
|
|
22
|
+
method_source (~> 0.9.0)
|
|
23
|
+
pry-byebug (3.8.0)
|
|
24
|
+
byebug (~> 11.0)
|
|
25
|
+
pry (~> 0.10)
|
|
26
|
+
pry-doc (1.0.0)
|
|
27
|
+
pry (~> 0.11)
|
|
28
|
+
yard (~> 0.9.11)
|
|
29
|
+
rainbow (3.0.0)
|
|
30
|
+
rexml (3.2.4)
|
|
31
|
+
rspec (3.9.0)
|
|
32
|
+
rspec-core (~> 3.9.0)
|
|
33
|
+
rspec-expectations (~> 3.9.0)
|
|
34
|
+
rspec-mocks (~> 3.9.0)
|
|
35
|
+
rspec-core (3.9.1)
|
|
36
|
+
rspec-support (~> 3.9.1)
|
|
37
|
+
rspec-expectations (3.9.0)
|
|
38
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
39
|
+
rspec-support (~> 3.9.0)
|
|
40
|
+
rspec-mocks (3.9.1)
|
|
41
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
42
|
+
rspec-support (~> 3.9.0)
|
|
43
|
+
rspec-support (3.9.2)
|
|
44
|
+
rubocop (0.80.1)
|
|
45
|
+
jaro_winkler (~> 1.5.1)
|
|
46
|
+
parallel (~> 1.10)
|
|
47
|
+
parser (>= 2.7.0.1)
|
|
48
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
49
|
+
rexml
|
|
50
|
+
ruby-progressbar (~> 1.7)
|
|
51
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
|
52
|
+
ruby-progressbar (1.10.1)
|
|
53
|
+
simplecov (0.18.5)
|
|
54
|
+
docile (~> 1.1)
|
|
55
|
+
simplecov-html (~> 0.11)
|
|
56
|
+
simplecov-html (0.12.2)
|
|
57
|
+
unicode-display_width (1.6.1)
|
|
58
|
+
yard (0.9.24)
|
|
59
|
+
|
|
60
|
+
PLATFORMS
|
|
61
|
+
ruby
|
|
62
|
+
|
|
63
|
+
DEPENDENCIES
|
|
64
|
+
bundler (~> 1.17)
|
|
65
|
+
cleanup_vendor!
|
|
66
|
+
gem-release (~> 2.1)
|
|
67
|
+
pry-byebug (~> 3.8)
|
|
68
|
+
pry-doc (~> 1.0)
|
|
69
|
+
rspec (~> 3.0)
|
|
70
|
+
rubocop (~> 0.80.1)
|
|
71
|
+
simplecov (~> 0.18.5)
|
|
72
|
+
|
|
73
|
+
BUNDLED WITH
|
|
74
|
+
1.17.3
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 István Karaszi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# CleanupVendor
|
|
2
|
+
|
|
3
|
+
[](https://travis-ci.org/raszi/cleanup_vendor)
|
|
4
|
+
[](https://codeclimate.com/github/raszi/cleanup_vendor)
|
|
5
|
+
[](https://codeclimate.com/github/raszi/cleanup_vendor)
|
|
6
|
+
[](https://badge.fury.io/rb/cleanup_vendor)
|
|
7
|
+
|
|
8
|
+
This gem was created to help minimizing the size of your docker images.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
Add this line to your application's Gemfile:
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
gem 'cleanup_vendor'
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
And then execute:
|
|
19
|
+
|
|
20
|
+
$ bundle
|
|
21
|
+
|
|
22
|
+
Or install it yourself as:
|
|
23
|
+
|
|
24
|
+
$ gem install cleanup_vendor
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
After installing all your gems in your `Dockerfile` with bundler, run the `cleanup_vendor` executable in the same `RUN` instruction to cut back the size of the docker image.
|
|
29
|
+
|
|
30
|
+
Something like:
|
|
31
|
+
|
|
32
|
+
```Dockerfile
|
|
33
|
+
RUN bundle install --deployment --frozen --jobs 4 --no-cache --retry 5 --without development test && \
|
|
34
|
+
bundle exec cleanup_vendor --summary
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Development
|
|
38
|
+
|
|
39
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
40
|
+
|
|
41
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
42
|
+
|
|
43
|
+
## Contributing
|
|
44
|
+
|
|
45
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/raszi/cleanup_vendor.
|
|
46
|
+
|
|
47
|
+
## License
|
|
48
|
+
|
|
49
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/bin/console
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "cleanup_vendor"
|
|
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,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
|
+
require 'cleanup_vendor/version'
|
|
6
|
+
|
|
7
|
+
Gem::Specification.new do |spec|
|
|
8
|
+
spec.name = 'cleanup_vendor'
|
|
9
|
+
spec.version = CleanupVendor::VERSION
|
|
10
|
+
spec.authors = ['KARASZI István']
|
|
11
|
+
spec.email = ['github@spam.raszi.hu']
|
|
12
|
+
|
|
13
|
+
spec.summary = 'This gem helps to cleanup vendor directory'
|
|
14
|
+
spec.description = 'Removes unnecessary files which are not required in production environment.'
|
|
15
|
+
spec.homepage = 'https://github.com/raszi/cleanup_vendor'
|
|
16
|
+
spec.license = 'MIT'
|
|
17
|
+
|
|
18
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
|
19
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
spec.bindir = 'exe'
|
|
23
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
24
|
+
spec.require_paths = ['lib']
|
|
25
|
+
|
|
26
|
+
spec.add_development_dependency 'bundler', '~> 1.17'
|
|
27
|
+
spec.add_development_dependency 'gem-release', '~> 2.1'
|
|
28
|
+
spec.add_development_dependency 'pry-byebug', '~> 3.8'
|
|
29
|
+
spec.add_development_dependency 'pry-doc', '~> 1.0'
|
|
30
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
|
31
|
+
spec.add_development_dependency 'rubocop', '~> 0.80.1'
|
|
32
|
+
spec.add_development_dependency 'simplecov', '~> 0.18.5'
|
|
33
|
+
end
|
data/exe/cleanup_vendor
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
require 'cleanup_vendor'
|
|
5
|
+
require 'optparse'
|
|
6
|
+
|
|
7
|
+
options = {}
|
|
8
|
+
|
|
9
|
+
opt_parser = OptionParser.new do |opts|
|
|
10
|
+
name = File.basename(__FILE__)
|
|
11
|
+
opts.banner = "Usage: #{name} [options]"
|
|
12
|
+
|
|
13
|
+
opts.separator ''
|
|
14
|
+
opts.separator 'Specific options:'
|
|
15
|
+
|
|
16
|
+
opts.on('-v', '--[no-]verbose', 'Run verbosely') do |v|
|
|
17
|
+
options[:verbose] = v
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
opts.on('-0', '--null', 'Print the pathname of the removed file to standard output, followed by an ASCII NUL character (character code 0).') do |d|
|
|
21
|
+
options[:print0] = d
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
opts.on('--dry-run', 'Do not delete files') do |d|
|
|
25
|
+
options[:dry_run] = d
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
opts.on('-s', '--summary', 'Display a summary after execution') do |s|
|
|
29
|
+
options[:summary] = s
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
opts.on('-d', '--directory DIR', 'Match on this directory') do |dir|
|
|
33
|
+
options[:directories] ||= []
|
|
34
|
+
options[:directories] << dir
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
opts.on('-x', '--extension EXT', 'Match on extension') do |ext|
|
|
38
|
+
options[:extensions] ||= []
|
|
39
|
+
options[:extensions] << ext
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
opts.on('-f', '--file FILE', 'Match on these filenames') do |file|
|
|
43
|
+
options[:filenames] ||= []
|
|
44
|
+
options[:filenames] << file
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
opts.on_tail('-h', '--help', 'Show this message') do
|
|
48
|
+
puts opts
|
|
49
|
+
exit
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
opts.on_tail('-V', '--version', 'Show version') do
|
|
53
|
+
puts CleanupVendor::VERSION
|
|
54
|
+
exit
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
args = opt_parser.parse!(ARGV)
|
|
59
|
+
dir = args.shift || 'vendor/bundle/ruby'
|
|
60
|
+
|
|
61
|
+
CleanupVendor.run(dir, options)
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'cleanup_vendor/version'
|
|
4
|
+
|
|
5
|
+
module CleanupVendor
|
|
6
|
+
class Error < StandardError; end
|
|
7
|
+
|
|
8
|
+
DEFAULTS = {
|
|
9
|
+
extensions: %w[c cpp gem h hpp java log md mk o rdoc txt],
|
|
10
|
+
filenames: %w[
|
|
11
|
+
README Makefile LICENSE CHANGELOG .codeclimate.yml .dockerignore
|
|
12
|
+
.gitignore .rubocop.yml .ruby-version .ruby-gemset .rspec .rspec_status
|
|
13
|
+
.travis.yml .yardopts
|
|
14
|
+
],
|
|
15
|
+
top_level_directories: %w[spec],
|
|
16
|
+
directories: %w[.git .github]
|
|
17
|
+
}.freeze
|
|
18
|
+
|
|
19
|
+
class << self
|
|
20
|
+
def run(dir, opts = {})
|
|
21
|
+
summary = []
|
|
22
|
+
|
|
23
|
+
filter(dir, DEFAULTS.merge(opts)) do |p|
|
|
24
|
+
summary << collect_summary(p) if opts[:summary]
|
|
25
|
+
|
|
26
|
+
print_verbose(p) if opts[:verbose]
|
|
27
|
+
print_path(p) if opts[:print0]
|
|
28
|
+
|
|
29
|
+
FileUtils.remove_entry(p) unless opts[:dry_run]
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
print_summary(summary) if opts[:summary]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def filter(dir, opts = {})
|
|
36
|
+
raise Error, 'Not a directory' unless File.directory?(dir.to_s)
|
|
37
|
+
return to_enum(:filter, dir, opts) unless block_given?
|
|
38
|
+
|
|
39
|
+
file_opts, dir_opts = get_options(opts)
|
|
40
|
+
filtered = Set.new
|
|
41
|
+
|
|
42
|
+
dir_entries(dir) do |path|
|
|
43
|
+
next if skip_path?(path, filtered)
|
|
44
|
+
next unless match_file?(path, file_opts) || match_directory?(path, dir_opts)
|
|
45
|
+
|
|
46
|
+
filtered << path
|
|
47
|
+
yield(path)
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def skip_path?(path, filtered)
|
|
52
|
+
path.basename.to_s == '.' || path.descend.any? { |p| filtered.include?(p) }
|
|
53
|
+
end
|
|
54
|
+
private :skip_path?
|
|
55
|
+
|
|
56
|
+
def match_file?(path, filenames: [], extensions: [])
|
|
57
|
+
return unless path.file?
|
|
58
|
+
|
|
59
|
+
filenames.include?(path.basename.to_s) || extensions.include?(path.extname.delete('.'))
|
|
60
|
+
end
|
|
61
|
+
private :match_file?
|
|
62
|
+
|
|
63
|
+
def match_directory?(path, directories: [], top_level_directories: [])
|
|
64
|
+
return unless path.directory?
|
|
65
|
+
|
|
66
|
+
basename = path.basename.to_s
|
|
67
|
+
directories.include?(basename) || top_level_directories.include?(basename) && path.parent.glob('*.gemspec').any?
|
|
68
|
+
end
|
|
69
|
+
private :match_directory?
|
|
70
|
+
|
|
71
|
+
def get_options(options)
|
|
72
|
+
file_opts = transform_options(options, :filenames, :extensions)
|
|
73
|
+
dir_opts = transform_options(options, :directories, :top_level_directories)
|
|
74
|
+
[file_opts, dir_opts]
|
|
75
|
+
end
|
|
76
|
+
private :get_options
|
|
77
|
+
|
|
78
|
+
def transform_options(options, *keys)
|
|
79
|
+
options.slice(*keys).transform_values do |v|
|
|
80
|
+
(v || []).to_set
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
private :transform_options
|
|
84
|
+
|
|
85
|
+
def dir_entries(dir, &block)
|
|
86
|
+
Pathname.new(dir).glob('**/*', File::FNM_DOTMATCH, &block)
|
|
87
|
+
end
|
|
88
|
+
private :dir_entries
|
|
89
|
+
|
|
90
|
+
def format_summary(prefix, number)
|
|
91
|
+
"\t#{prefix}\t#{number.to_s.rjust(20)}"
|
|
92
|
+
end
|
|
93
|
+
private :format_summary
|
|
94
|
+
|
|
95
|
+
def collect_summary(path)
|
|
96
|
+
files = path.file? ? [path] : dir_entries(path).reject { |p| p.basename.to_s == '.' }
|
|
97
|
+
files.map(&:stat)
|
|
98
|
+
end
|
|
99
|
+
private :collect_summary
|
|
100
|
+
|
|
101
|
+
def print_verbose(path)
|
|
102
|
+
$stderr.puts "Removing #{path}..."
|
|
103
|
+
end
|
|
104
|
+
private :print_verbose
|
|
105
|
+
|
|
106
|
+
def print_path(path)
|
|
107
|
+
$stdout.write path
|
|
108
|
+
$stdout.putc 0
|
|
109
|
+
end
|
|
110
|
+
private :print_path
|
|
111
|
+
|
|
112
|
+
def print_summary(summary)
|
|
113
|
+
all_files = summary.flatten
|
|
114
|
+
count = all_files.count
|
|
115
|
+
blocks = all_files.map(&:blocks).sum
|
|
116
|
+
bytes = all_files.map(&:size).sum
|
|
117
|
+
|
|
118
|
+
$stderr.puts 'Summary:'
|
|
119
|
+
$stderr.puts format_summary('Removed files:', count)
|
|
120
|
+
$stderr.puts format_summary('Total blocks:', blocks)
|
|
121
|
+
$stderr.puts format_summary('Total bytes:', bytes)
|
|
122
|
+
end
|
|
123
|
+
private :print_summary
|
|
124
|
+
end
|
|
125
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: cleanup_vendor
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.2.0.pre.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- KARASZI István
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: exe
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2020-03-14 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: bundler
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.17'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.17'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: gem-release
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '2.1'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '2.1'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: pry-byebug
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '3.8'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '3.8'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: pry-doc
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - "~>"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '1.0'
|
|
62
|
+
type: :development
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - "~>"
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '1.0'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: rspec
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - "~>"
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '3.0'
|
|
76
|
+
type: :development
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - "~>"
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '3.0'
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: rubocop
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - "~>"
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: 0.80.1
|
|
90
|
+
type: :development
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - "~>"
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: 0.80.1
|
|
97
|
+
- !ruby/object:Gem::Dependency
|
|
98
|
+
name: simplecov
|
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
|
100
|
+
requirements:
|
|
101
|
+
- - "~>"
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: 0.18.5
|
|
104
|
+
type: :development
|
|
105
|
+
prerelease: false
|
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - "~>"
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: 0.18.5
|
|
111
|
+
description: Removes unnecessary files which are not required in production environment.
|
|
112
|
+
email:
|
|
113
|
+
- github@spam.raszi.hu
|
|
114
|
+
executables:
|
|
115
|
+
- cleanup_vendor
|
|
116
|
+
extensions: []
|
|
117
|
+
extra_rdoc_files: []
|
|
118
|
+
files:
|
|
119
|
+
- ".gitignore"
|
|
120
|
+
- ".rspec"
|
|
121
|
+
- ".rubocop.yml"
|
|
122
|
+
- ".travis.yml"
|
|
123
|
+
- Gemfile
|
|
124
|
+
- Gemfile.lock
|
|
125
|
+
- LICENSE.txt
|
|
126
|
+
- README.md
|
|
127
|
+
- bin/console
|
|
128
|
+
- bin/setup
|
|
129
|
+
- cleanup_vendor.gemspec
|
|
130
|
+
- exe/cleanup_vendor
|
|
131
|
+
- lib/cleanup_vendor.rb
|
|
132
|
+
- lib/cleanup_vendor/version.rb
|
|
133
|
+
homepage: https://github.com/raszi/cleanup_vendor
|
|
134
|
+
licenses:
|
|
135
|
+
- MIT
|
|
136
|
+
metadata: {}
|
|
137
|
+
post_install_message:
|
|
138
|
+
rdoc_options: []
|
|
139
|
+
require_paths:
|
|
140
|
+
- lib
|
|
141
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
142
|
+
requirements:
|
|
143
|
+
- - ">="
|
|
144
|
+
- !ruby/object:Gem::Version
|
|
145
|
+
version: '0'
|
|
146
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
|
+
requirements:
|
|
148
|
+
- - ">"
|
|
149
|
+
- !ruby/object:Gem::Version
|
|
150
|
+
version: 1.3.1
|
|
151
|
+
requirements: []
|
|
152
|
+
rubygems_version: 3.0.8
|
|
153
|
+
signing_key:
|
|
154
|
+
specification_version: 4
|
|
155
|
+
summary: This gem helps to cleanup vendor directory
|
|
156
|
+
test_files: []
|