bundler-download 1.2.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f64d8149b156977c05751eaecef7826a3ee378ebdb5d529f0875597b11d4a5d9
4
- data.tar.gz: 41bb7ad2e11cd1bcd47f0557c0d512ae5312a6193f2a518cfb7de7e1c0f7639d
3
+ metadata.gz: d04b4c772b433e696f88a13fbcce416028a19d832f9a8948aa902d05136d9d8d
4
+ data.tar.gz: f9f6e2c44bee77c11161d84729d6f974e98edf3f24e553306b17ebc14a657621
5
5
  SHA512:
6
- metadata.gz: 1c8ff5f7452e4c1e4e0a2a118ce0e899f0334a0695a0ffa31c9f6458d12e7ca46c119af843dade3c27812f65cec7c1fa3b4ef31ae4dcfbb3553acec471329c22
7
- data.tar.gz: a8f98b7bd09a75514558b09a22f5a9026c72214d7eefcb408c8e267feca121a828fa2651ef82c67cba4e9f203cc0bedfd8334f8222c0f1ec296bdee2cc6389c2
6
+ metadata.gz: b8e39265e156c16b7cbf9c1c9be4289c870d5ced259e604a1d9d22118d62eb7f10f826d66218037e77cc6461a0f78b2c3b6090a99cff7a4448a7c6314d6511ba
7
+ data.tar.gz: e90f2dea3ac622f036c5c2637c2b2ea1a2d1f139439c852ac41a9db30a5d5f6148b7059df16b7cd87f3ea27912a6546bcc128626f9bf4f1f0607575e893a63e6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Change Log
2
2
 
3
+ ## 1.4.0
4
+
5
+ - Support `Downloadfile` at the root of the app (not just gems)
6
+
7
+ ## 1.3.1
8
+
9
+ - Improve instructions to help ensure correct and successful usage
10
+
11
+ ## 1.3.0
12
+
13
+ - Setup Bundler default group only when using as an API to avoid loading :development/:test group gems into a production app
14
+ - Announce that download files are missing for `bundler download show` when a Downloadfile exists but downloads have not been made
15
+ - Document options (e.g. --keep-existing and --all-operating-systems) in `bundle download help`
16
+
3
17
  ## 1.2.0
4
18
 
5
19
  - Get rid of httparty
data/README.md CHANGED
@@ -1,33 +1,37 @@
1
- # bundler-download - Bundler Plugin
1
+ # bundler-download - Bundler Plugin - v1.4.0
2
2
  [![Gem Version](https://badge.fury.io/rb/bundler-download.svg)](http://badge.fury.io/rb/bundler-download)
3
3
 
4
- Bundler plugin for auto-downloading extra gem files (e.g. large file downloads) specified in [`Downloadfile`](#downloadfile) after `bundle install`.
4
+ Bundler plugin for auto-downloading extra gem files (e.g. large file downloads) specified in [`Downloadfile`](#downloadfile) after `bundle install`
5
5
 
6
6
  ## Background
7
7
 
8
- The RubyGem ecosystem, famous for gems like Rails for web development, Devise for authentication, and Pundit for authorization, enables productivity via code reuse. As such, it is great for quickly adding libraries to your project to automate part of the work or reuse other people's solutions to solved problems.
8
+ The Ruby Gem ecosystem, famous for gems like Rails for web development, Devise for authentication, and Pundit for authorization, enables productivity via code reuse. As such, it is great for quickly adding libraries to your project to automate part of the work or reuse other people's solutions to solved problems.
9
9
 
10
- That said, you would not want to package extremely large files, like the OpenAI GPT-3 175 billion parameter models, in a RubyGem.
10
+ That said, you would not want to package extremely large files, like the OpenAI GPT-3 175 billion parameter models, in a Ruby Gem.
11
11
 
12
- Enter [bundler-download](https://rubygems.org/gems/bundler-download), a Bundler Plugin that enables downloading extra gem files after installing with with `bundle install` by declaring gem downloads in a [Downloadfile](#downloadfile)
12
+ Enter [bundler-download](https://rubygems.org/gems/bundler-download), a Bundler Plugin that enables downloading extra gem files after installing with `bundle` by declaring gem downloads in a [Downloadfile](#downloadfile)
13
13
 
14
14
  ## How It Works
15
15
 
16
- Gems can add a [`Downloadfile`](#downloadfile) at the root to declare the need for extra downloads upon install by Bundler.
16
+ Apps and gems can add a [`Downloadfile`](#downloadfile) at the root to declare the need for extra downloads upon install by Bundler.
17
17
 
18
- Apps can add those gems to Bundler `Gemfile` the standard way in addition to installing the [bundler-download](https://rubygems.org/gems/bundler-download) Bundler plugin. Afterwards, when running `bundle install`, bundle-download will automatically download extra files at the end.
18
+ Apps can then `bundle` in addition to installing the [bundler-download](https://rubygems.org/gems/bundler-download) Bundler plugin as per instructions below. Afterwards, when running `bundle` again, bundle-download will automatically download extra files mentioned in [Downloadfile](#downloadfile), whether it is in the app directly or in a gem dependency.
19
19
 
20
- If a Ruby Gem needs to depend on one of those gems, it can declare as a standard dependency in .gemspec
20
+ If a Ruby Gem needs to depend on gems that have a [Downloadfile](#downloadfile), it can declare dependency in `.gemspec` just as usual.
21
+
22
+ ## App Instructions
23
+
24
+ App must declare a [`Downloadfile`](#downloadfile) at the root `'.'` path and then follow [App Bundler Plugin Instructions](#app-bundler-plugin-instructions)
21
25
 
22
26
  ## Gem Instructions
23
27
 
24
- Add [bundler-download](https://rubygems.org/gems/bundler-download) as a standard .gemspec dependency:
28
+ Add [bundler-download](https://rubygems.org/gems/bundler-download) as a standard `.gemspec` dependency:
25
29
 
26
30
  ```ruby
27
- s.add_dependency('bundler-download', [">= 1.1.0"])
31
+ s.add_dependency('bundler-download', ["~> 1.4"])
28
32
  ```
29
33
 
30
- Afterwards, ensure there is a [`Downloadfile`](#downloadfile) at the root directory of the gem, including in .gemspec `files`:
34
+ Afterwards, ensure there is a [`Downloadfile`](#downloadfile) at the root directory of the gem, including in `.gemspec` `files`:
31
35
 
32
36
  ```ruby
33
37
  s.files = [
@@ -43,7 +47,7 @@ Finally, follow one of two options for having applications obtain downloads:
43
47
 
44
48
  ### Downloadfile
45
49
 
46
- A gem `Downloadfile` contains `download` links for files that need to be downloaded relative to the gem directory after `bundle install`.
50
+ An app or gem `Downloadfile` contains `download` links for files that need to be downloaded relative to the gem directory after `bundle install`.
47
51
 
48
52
  Downloadfile entries follow this format (keyword args are optional):
49
53
 
@@ -55,7 +59,7 @@ Example `Downloadfile`:
55
59
 
56
60
  ```
57
61
  download 'http://dl.maketechnology.io/chromium-cef/rls/repository/plugins/com.make.chromium.cef.gtk.linux.x86_64_0.4.0.202005172227.jar' # downloads into gem root directory
58
- download 'http://dl.maketechnology.io/chromium-cef/rls/repository/plugins/com.make.chromium.cef.cocoa.macosx.x86_64_0.4.0.202005172227.jar',
62
+ download 'http://dl.maketechnology.io/chromium-cef/rls/repository/plugins/com.make.chromium.cef.cocoa.macosx.x86_64_0.4.0.202005172227.jar',
59
63
  to: 'cef' # downloads into 'cef' directory under the gem installation directory
60
64
  download 'http://dl.maketechnology.io/chromium-cef/rls/repository/plugins/com.make.chromium.cef.win32.win32.x86_64_0.4.0.202005172227.jar',
61
65
  to: 'cef/windows', os: 'windows' # downloads into 'cef/windows' directory under the gem installation directory in Windows OS only
@@ -68,21 +72,29 @@ The keyword `download` declares a file to download and takes the following argum
68
72
 
69
73
  ## App Bundler Plugin Instructions
70
74
 
71
- An app can depend on a gem that has a `Downloadfile` by adding the `bundler-download` plugin first (or manually installing via `bundle plugin install bundler-download`) and then including the gem in `Gemfile` like it normally would:
75
+ In plugin mode, all gems declared in `Gemfile` are inspected for presence of `Downloadfile` regardless of what group they belong to.
72
76
 
73
- ```
74
- plugin 'bundler-download'
77
+ Additionally, the app `'.'` path is insepected for `Downloadfile` at the root of the app.
78
+
79
+ An app can depend on a gem that has a `Downloadfile` by including in `Gemfile`
80
+
81
+ Whether `Downloadfile` lives in app directly or one of its gems, start by running `bundle` in the app root directory:
75
82
 
76
- gem 'some_gem_with_downloadfile'
83
+ ```
84
+ bundle
77
85
  ```
78
86
 
79
- Afterwards, run:
87
+ Afterwards install the `bundler-download` plugin via:
80
88
 
81
89
  ```
82
- bundle install
90
+ bundle plugin install bundler-download
83
91
  ```
84
92
 
85
- (run one extra time if you don't have the `bundler-download` plugin installed yet since the first run would just install the plugin and subsequent runs would activate it)
93
+ Finally, `bundle` one extra time to activate the `bundler-download` plugin:
94
+
95
+ ```
96
+ bundle
97
+ ```
86
98
 
87
99
  You should see something like this:
88
100
 
@@ -100,7 +112,7 @@ Using tty-cursor 0.7.1
100
112
  Using tty-screen 0.8.1
101
113
  Using unicode-display_width 1.7.0
102
114
  Using tty-progressbar 0.17.0
103
- Using bundler-download 1.1.0
115
+ Using bundler-download 1.4.0
104
116
  Using facets 3.1.0
105
117
  Using glimmer 1.0.0
106
118
  bundle-download plugin gem-after-install-all hook:
@@ -115,7 +127,7 @@ Download path: /Users/User/.rvm/gems/ruby-2.7.1@tmp/gems/glimmer-1.0.0/cef/com.m
115
127
  Downloading 26% ( 59s ) [============== ]
116
128
  ```
117
129
 
118
- After the initial download of files, running `bundle install` again will keep existing downloads without overwriting them unless you use the [`bundle-download`](#bundler-download-command) command to manually redownload files again.
130
+ After the initial download of files, running `bundle` again will keep existing downloads without overwriting them unless you use the [`bundle-download`](#bundler-download-command) command to manually redownload files again.
119
131
 
120
132
  ### Bundler Download Command
121
133
 
@@ -158,21 +170,24 @@ Run the `help` subcommand (or usage) to bring up usage instructions:
158
170
 
159
171
  ```
160
172
  bundle download help
161
- ```
173
+ ```
162
174
 
163
175
  Prints:
164
176
 
165
177
  ```
166
- == bundler-download - Bundler Plugin - v1.1.0 ==
167
- Commands/Subcommands:
168
- bundle download help # Provide help by printing usage instructions
169
- bundle download usage # (alias for help)
170
- bundle download start # Start download
171
- bundle download # (alias for start)
172
- bundle download clear # Clear downloads by deleting them under all gems
173
- bundle download clean # (alias for clear)
174
- bundle download list # List downloads by printing Downloadfile content for all gems
175
- bundle download show # Show downloaded files for all gems
178
+ == bundler-download - Bundler Plugin - v1.4.0 ==
179
+
180
+ Commands/Subcommands/Options:
181
+ bundle download help # Provide help by printing usage instructions
182
+ bundle download usage # (alias for help)
183
+ bundle download start # Start downloads for current operating system
184
+ bundle download # (alias for start)
185
+ bundle download --all-operating-systems # Download files for all operating systems
186
+ bundle download --keep-existing # Do not redownload already downloaded files
187
+ bundle download clear # Clear downloads by deleting them under all gems
188
+ bundle download clean # (alias for clear)
189
+ bundle download list # List downloads by printing Downloadfile content for all gems
190
+ bundle download show # Show downloaded files for all gems
176
191
  ```
177
192
 
178
193
  ##### clear (alias: clean)
@@ -181,7 +196,7 @@ Run the `clear` subcommand to clear downloads by deleting them under all gems:
181
196
 
182
197
  ```
183
198
  bundle download clear
184
- ```
199
+ ```
185
200
 
186
201
  Example printout:
187
202
 
@@ -195,7 +210,7 @@ Run the `list` subcommand to list downloads by printing Downloadfile content for
195
210
 
196
211
  ```
197
212
  bundle download list
198
- ```
213
+ ```
199
214
 
200
215
  Example printout:
201
216
 
@@ -203,7 +218,7 @@ Example printout:
203
218
  Listing /Users/User/.rvm/gems/ruby-2.7.1@bundler-download/gems/glimmer-cw-browser-chromium-1.0.0/Downloadfile
204
219
  download 'http://dl.maketechnology.io/chromium-cef/rls/repository/plugins/com.make.chromium.cef.gtk.linux.x86_64_0.4.0.202005172227.jar',
205
220
  to: 'vendor/jars/linux', os: 'linux'
206
- download 'http://dl.maketechnology.io/chromium-cef/rls/repository/plugins/com.make.chromium.cef.cocoa.macosx.x86_64_0.4.0.202005172227.jar',
221
+ download 'http://dl.maketechnology.io/chromium-cef/rls/repository/plugins/com.make.chromium.cef.cocoa.macosx.x86_64_0.4.0.202005172227.jar',
207
222
  to: 'vendor/jars/mac', os: 'mac'
208
223
  download 'http://dl.maketechnology.io/chromium-cef/rls/repository/plugins/com.make.chromium.cef.win32.win32.x86_64_0.4.0.202005172227.jar',
209
224
  to: 'vendor/jars/windows', os: 'windows'
@@ -215,7 +230,7 @@ Run the `show` subcommand to show downloaded files for all gems:
215
230
 
216
231
  ```
217
232
  bundle download show
218
- ```
233
+ ```
219
234
 
220
235
  Example printout:
221
236
 
@@ -226,6 +241,8 @@ Showing downloaded files for /Users/User/.rvm/gems/ruby-2.7.1@bundler-download/g
226
241
 
227
242
  ### API
228
243
 
244
+ In API mode, only gems belonging to the default group in Gemfile are inspected for presence of Downloadfile by default. An app may change that though by loading other Bundler groups (e.g. `Bundler.setup(:default, :developemnt)`)
245
+
229
246
  Apps may choose to integrate with the [bundler-download](https://rubygems.org/gems/bundler-download) gem directly to trigger downloads instead of relying on the plugin.
230
247
  This can be useful when wanting to trigger downloads only on first use while staying transparent should the gem features not be used.
231
248
 
@@ -236,6 +253,13 @@ require 'bundler-download'
236
253
  Bundler::Download.new.exec('download', [])
237
254
  ```
238
255
 
256
+ You can also use the `--keep-existing` option to avoid redownload if files were there already:
257
+
258
+ ```ruby
259
+ require 'bundler-download'
260
+ Bundler::Download.new.exec('download', ['--keep-existing'])
261
+ ```
262
+
239
263
  ## Contributing to bundler-download
240
264
 
241
265
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.0
1
+ 1.4.0
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: bundler-download 1.2.0 ruby lib
5
+ # stub: bundler-download 1.4.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "bundler-download".freeze
9
- s.version = "1.2.0"
9
+ s.version = "1.4.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["AndyMaleh".freeze]
14
- s.date = "2020-09-25"
14
+ s.date = "2021-08-27"
15
15
  s.description = "bundler-download is a Bundler plugin for auto-downloading gem-specified extra files (e.g. large file downloads) on `bundle install` from a `Downloadfile`".freeze
16
16
  s.email = "andy.am@gmail.com".freeze
17
17
  s.executables = ["bundler-download".freeze]
@@ -35,8 +35,8 @@ Gem::Specification.new do |s|
35
35
  ]
36
36
  s.homepage = "http://github.com/AndyObtiva/bundler-download".freeze
37
37
  s.licenses = ["MIT".freeze]
38
- s.post_install_message = "*** bundler-download post install message ***\nSome gems have a Downloadfile! Follow the instructions below to download their files. \nAdd `plugin 'bundler-download'` to Gemfile and run `bundle install` \nor alternatively just run `bundle plugin install bundler-download`. \nAfterwards, run `bundle install` and extra gem files will be downloaded automatically.".freeze
39
- s.rubygems_version = "3.1.4".freeze
38
+ s.post_install_message = "*** bundler-download post install message ***\nSome gems have a Downloadfile! Follow the instructions below to download their files. \nRun `bundle plugin install bundler-download`. \nAfterwards, run `bundle` and extra files are downloaded automatically.\nTo force download of extra files with bundler-download plugin, run `bundle download`\nTo get help with bundler-download plugin, run `bundle download help`\nLearn more at: https://www.rubydoc.info/gems/bundler-download".freeze
39
+ s.rubygems_version = "3.2.3".freeze
40
40
  s.summary = "bundler-download is a Bundler plugin for auto-downloading specified extra files on `bundle install`".freeze
41
41
 
42
42
  if s.respond_to? :specification_version then
@@ -1,5 +1,5 @@
1
1
  # Copyright (c) 2020 Andy Maleh
2
- #
2
+ #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
5
5
  # "Software"), to deal in the Software without restriction, including
@@ -7,10 +7,10 @@
7
7
  # distribute, sublicense, and/or sell copies of the Software, and to
8
8
  # permit persons to whom the Software is furnished to do so, subject to
9
9
  # the following conditions:
10
- #
10
+ #
11
11
  # The above copyright notice and this permission notice shall be
12
12
  # included in all copies or substantial portions of the Software.
13
- #
13
+ #
14
14
  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
15
  # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
16
  # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -27,18 +27,26 @@ module Bundler
27
27
  begin
28
28
  subcommand = extract_subcommand(args) || 'start'
29
29
  return puts("Invalid subcommand: #{subcommand} \nValid `bundle download` subcommands are: #{Bundler::Downloadfile::SUBCOMMANDS.join(' / ')}") unless Bundler::Downloadfile::SUBCOMMANDS.include?(subcommand)
30
- downloadfiles = Dir.glob(File.join(Gem.dir, 'gems', '**', 'Downloadfile')).to_a
30
+ downloadfiles = Dir.glob(File.join(Gem.dir, 'gems', '**', 'Downloadfile')).to_a
31
31
  loaded_gems = Gem.loaded_specs.keys
32
32
  downloadfiles = downloadfiles.select {|df| loaded_gems.detect {|gem| File.basename(File.dirname(df)).include?(gem)} }
33
+ downloadfiles << 'Downloadfile' if File.exist?('Downloadfile')
33
34
  puts 'No gems were found with Downloadfile.' if downloadfiles.empty?
35
+ help_requested = subcommand == 'help' || subcommand == 'usage'
36
+ help_shown = false
34
37
  downloadfiles.each do |downloadfile|
35
38
  bundler_downloadfile = Bundler::Downloadfile.new(
36
- downloadfile,
37
- gem_path: File.dirname(downloadfile),
39
+ downloadfile,
40
+ gem_path: File.dirname(downloadfile),
38
41
  keep_existing: args.include?('--keep-existing'),
39
42
  all_operating_systems: args.include?('--all-operating-systems'),
40
43
  )
41
- bundler_downloadfile.send(subcommand)
44
+ if !help_requested || !help_shown
45
+ puts "== bundler-download - Bundler Plugin - v#{File.read(File.expand_path('../../../VERSION', __FILE__)).strip} =="
46
+ puts
47
+ bundler_downloadfile.send(subcommand)
48
+ end
49
+ help_shown = true if help_requested
42
50
  end
43
51
  true
44
52
  rescue => e
@@ -1,5 +1,5 @@
1
1
  # Copyright (c) 2020 Andy Maleh
2
- #
2
+ #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
5
5
  # "Software"), to deal in the Software without restriction, including
@@ -7,10 +7,10 @@
7
7
  # distribute, sublicense, and/or sell copies of the Software, and to
8
8
  # permit persons to whom the Software is furnished to do so, subject to
9
9
  # the following conditions:
10
- #
10
+ #
11
11
  # The above copyright notice and this permission notice shall be
12
12
  # included in all copies or substantial portions of the Software.
13
- #
13
+ #
14
14
  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
15
  # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
16
  # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -20,23 +20,24 @@
20
20
  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
21
 
22
22
  module Bundler
23
- class Downloadfile
23
+ class Downloadfile
24
24
  attr_reader :file, :file_content, :gem_path, :keep_existing
25
25
 
26
26
  HELP = <<~MULTI_LINE_STRING
27
- == bundler-download - Bundler Plugin - v#{File.read(File.expand_path('../../../VERSION', __FILE__)).strip} ==
28
- Commands/Subcommands:
29
- bundle download help # Provide help by printing usage instructions
30
- bundle download usage # (alias for help)
31
- bundle download start # Start download
32
- bundle download # (alias for start)
33
- bundle download clear # Clear downloads by deleting them under all gems
34
- bundle download clean # (alias for clear)
35
- bundle download list # List downloads by printing Downloadfile content for all gems
36
- bundle download show # Show downloaded files for all gems
27
+ Commands/Subcommands/Options:
28
+ bundle download help # Provide help by printing usage instructions
29
+ bundle download usage # (alias for help)
30
+ bundle download start # Start downloads for current operating system
31
+ bundle download # (alias for start)
32
+ bundle download --all-operating-systems # Download files for all operating systems
33
+ bundle download --keep-existing # Do not redownload already downloaded files
34
+ bundle download clear # Clear downloads by deleting them under app/gems
35
+ bundle download clean # (alias for clear)
36
+ bundle download list # List downloads by printing Downloadfile content for app/gems
37
+ bundle download show # Show downloaded files for app/gems
37
38
  MULTI_LINE_STRING
38
39
 
39
- SUPPORTED_OPERATING_SYSTEMS = %w[mac windows linux]
40
+ SUPPORTED_OPERATING_SYSTEMS = %w[mac windows linux]
40
41
  PLATFORM_OS = SUPPORTED_OPERATING_SYSTEMS.detect {|os| OS.send("#{os}?")}
41
42
  SUBCOMMANDS = %w[start clear clean help usage list show]
42
43
 
@@ -90,10 +91,28 @@ module Bundler
90
91
 
91
92
  def show
92
93
  puts "Showing downloaded files for #{file}"
94
+ puts '- - -'
95
+ missing_downloads = false
96
+ missing_downloads_for_current_platform_os = false
93
97
  @downloads.each do |download|
94
- file = download.file_path
95
- puts "#{File.size(file)} #{file}" if File.exist?(file)
98
+ download_file_entry = download.file_path
99
+ if File.exist?(download_file_entry)
100
+ puts "Downloaded: #{File.size(download_file_entry)} #{download_file_entry}"
101
+ else
102
+ missing_downloads = true
103
+ missing_downloads_for_current_platform_os = true if download.os == PLATFORM_OS
104
+ puts "Not downloaded: #{download_file_entry}"
105
+ end
96
106
  end
107
+ message = ''
108
+ if missing_downloads_for_current_platform_os
109
+ message += "Downloads are missing for the current operating system (#{PLATFORM_OS}). \nRun `bundle download` to download missing files for current operating system (#{PLATFORM_OS}).\n"
110
+ else
111
+ message += "All downloads are present for current operating system (#{PLATFORM_OS})."
112
+ message += " Optionally, run `bundle download --all-operating-systems` to download files for all operating systems.\n" if missing_downloads
113
+ end
114
+ puts message
115
+ puts
97
116
  end
98
117
  end
99
118
  end
@@ -52,7 +52,7 @@ module Download
52
52
 
53
53
  def start(hash={})
54
54
  set_multi(hash)
55
- return puts("Download '#{file_path}' already exists! (run `bundle download` to redownload)") if options.keys.include?('--keep_existing') && File.exist?(file_path)
55
+ return puts("Download already exists: '#{file_path}' (run `bundle download` to redownload)") if options.keys.include?('--keep_existing') && File.exist?(file_path)
56
56
 
57
57
  uri, head_response = final_uri_and_head_response
58
58
  content_length = head_response["content-length"]
@@ -20,7 +20,11 @@
20
20
  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
21
 
22
22
  require 'bundler'
23
- require 'bundler/setup'
23
+ if ENV['BUNDLER_DOWNLOAD_PLUGIN'].to_s.downcase == 'true'
24
+ require 'bundler/setup'
25
+ else
26
+ Bundler.setup(:default)
27
+ end
24
28
  require 'download'
25
29
  require 'fileutils'
26
30
  require 'os'
data/plugins.rb CHANGED
@@ -1 +1,3 @@
1
+ ENV['BUNDLER_DOWNLOAD_PLUGIN'] = 'true'
2
+
1
3
  require 'bundler-download'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundler-download
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - AndyMaleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-25 00:00:00.000000000 Z
11
+ date: 2021-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -201,10 +201,11 @@ licenses:
201
201
  - MIT
202
202
  metadata: {}
203
203
  post_install_message: "*** bundler-download post install message ***\nSome gems have
204
- a Downloadfile! Follow the instructions below to download their files. \nAdd `plugin
205
- 'bundler-download'` to Gemfile and run `bundle install` \nor alternatively just
206
- run `bundle plugin install bundler-download`. \nAfterwards, run `bundle install`
207
- and extra gem files will be downloaded automatically."
204
+ a Downloadfile! Follow the instructions below to download their files. \nRun `bundle
205
+ plugin install bundler-download`. \nAfterwards, run `bundle` and extra files are
206
+ downloaded automatically.\nTo force download of extra files with bundler-download
207
+ plugin, run `bundle download`\nTo get help with bundler-download plugin, run `bundle
208
+ download help`\nLearn more at: https://www.rubydoc.info/gems/bundler-download"
208
209
  rdoc_options: []
209
210
  require_paths:
210
211
  - lib
@@ -219,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
219
220
  - !ruby/object:Gem::Version
220
221
  version: '0'
221
222
  requirements: []
222
- rubygems_version: 3.1.4
223
+ rubygems_version: 3.2.3
223
224
  signing_key:
224
225
  specification_version: 4
225
226
  summary: bundler-download is a Bundler plugin for auto-downloading specified extra