bundle-only 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -1
- data/.rubocop_todo.yml +2 -4
- data/.travis.yml +12 -0
- data/.vscode/settings.json +4 -0
- data/Gemfile +1 -0
- data/Rakefile +6 -1
- data/bin/run +4 -0
- data/bin/test +7 -0
- data/bundle-only.gemspec +3 -3
- data/exe/bundle-only +9 -6
- data/lib/bundle-only.rb +1 -0
- data/lib/bundle-only/messages.rb +42 -24
- data/lib/bundle-only/version.rb +2 -1
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 867805f0a3fd082b61eaf648224640fc057ece34c1544f545624fb6fea102e13
|
4
|
+
data.tar.gz: 4922cd046b99d1913d0c18034c277855881593a3f8c1b05b88728526e13a5018
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 647df0b373bf683fadaa4a64ef0b78354d5b92f2cc4d814f0c27fde5fcef818681dde1a1b297638698bb0cea8b7b6ad45ff39c2e3b7c6afb0d2d6464ee700401
|
7
|
+
data.tar.gz: cafc443ea654041d4fa212e54d146318ebadf182221e2da33c86a343b64d52bc3a085241cd539f38da4274d020a7188780622b043ae831dd86cb591e12e5800b
|
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
CHANGED
@@ -1,14 +1,12 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on
|
3
|
+
# on 2019-07-22 14:21:08 +0300 using RuboCop version 0.73.0.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
9
|
# Offense count: 1
|
10
|
-
Style/
|
10
|
+
Style/CommentedKeyword:
|
11
11
|
Exclude:
|
12
|
-
- 'spec/**/*'
|
13
|
-
- 'test/**/*'
|
14
12
|
- 'exe/bundle-only'
|
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/bin/run
ADDED
data/bin/test
ADDED
data/bundle-only.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# coding: utf-8
|
2
1
|
# frozen_string_literal: true
|
3
|
-
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
5
|
require 'bundle-only/version'
|
6
6
|
|
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
24
|
spec.require_paths = ['lib']
|
25
25
|
|
26
|
-
spec.add_runtime_dependency 'bundler', '
|
26
|
+
spec.add_runtime_dependency 'bundler', '>= 1.11'
|
27
27
|
spec.add_development_dependency 'rake', '~> 10.0'
|
28
28
|
spec.add_development_dependency 'rubocop', '>= 0.36.0'
|
29
29
|
end
|
data/exe/bundle-only
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
+
# Exit cleanly from an early interrupt
|
5
|
+
Signal.trap('INT') do
|
6
|
+
Bundler.ui.debug("\n#{caller.join("\n")}") if defined?(Bundler)
|
7
|
+
exit 1
|
8
|
+
end
|
9
|
+
|
4
10
|
require 'bundle-only/messages'
|
5
11
|
|
6
12
|
install_only = ARGV.to_a.map(&:to_sym)
|
@@ -33,9 +39,6 @@ Bundler.ui = Bundler::UI::Shell.new
|
|
33
39
|
|
34
40
|
installer = Bundler::Installer.install(Bundler.root, definition, system: true)
|
35
41
|
|
36
|
-
BundleOnly::Messages.
|
37
|
-
BundleOnly::Messages.
|
38
|
-
|
39
|
-
installer.post_install_messages.each do |name, message|
|
40
|
-
BundleOnly::Messages.print_post_install_message(name, message)
|
41
|
-
end
|
42
|
+
BundleOnly::Messages::Install.output_installation_complete_message(definition)
|
43
|
+
BundleOnly::Messages::Common.output_without_groups_message(:install)
|
44
|
+
BundleOnly::Messages::Common.output_post_install_messages installer.post_install_messages
|
data/lib/bundle-only.rb
CHANGED
data/lib/bundle-only/messages.rb
CHANGED
@@ -1,37 +1,55 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module BundleOnly
|
3
4
|
module Messages
|
4
|
-
|
5
|
+
module Install
|
6
|
+
# Ref: https://github.com/bundler/bundler/blob/d0d3f2786149cbaca6506b95e4be91be98161c15/lib/bundler/cli/install.rb
|
5
7
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
"Gems in the #{group_str} #{group_list} were not installed."
|
11
|
-
end
|
8
|
+
def self.dependencies_count_for(definition)
|
9
|
+
count = definition.dependencies.count
|
10
|
+
"#{count} Gemfile #{count == 1 ? 'dependency' : 'dependencies'}"
|
11
|
+
end
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
def self.gems_installed_for(definition)
|
14
|
+
count = definition.specs.count
|
15
|
+
"#{count} #{count == 1 ? 'gem' : 'gems'} now installed"
|
16
|
+
end
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
def self.output_installation_complete_message(definition)
|
19
|
+
Bundler.ui.confirm "Bundle complete! #{dependencies_count_for(definition)}, #{gems_installed_for(definition)}."
|
20
|
+
end
|
21
21
|
end
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
"#{count} #{count == 1 ? 'gem' : 'gems'} now installed"
|
26
|
-
end
|
23
|
+
module Common
|
24
|
+
# Ref: https://github.com/bundler/bundler/blob/d0d3f2786149cbaca6506b95e4be91be98161c15/lib/bundler/cli/common.rb
|
27
25
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
26
|
+
def self.output_post_install_messages(messages)
|
27
|
+
return if Bundler.settings['ignore_messages']
|
28
|
+
|
29
|
+
messages.to_a.each do |name, msg|
|
30
|
+
print_post_install_message(name, msg) unless Bundler.settings["ignore_messages.#{name}"]
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.print_post_install_message(name, msg)
|
35
|
+
Bundler.ui.confirm "Post-install message from #{name}:"
|
36
|
+
Bundler.ui.info msg
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.output_without_groups_message(command)
|
40
|
+
return if Bundler.settings[:without].empty?
|
41
|
+
|
42
|
+
Bundler.ui.confirm without_groups_message(command)
|
43
|
+
end
|
32
44
|
|
33
|
-
|
34
|
-
|
45
|
+
def self.without_groups_message(command)
|
46
|
+
command_in_past_tense = command == :install ? 'installed' : 'updated'
|
47
|
+
groups = Bundler.settings[:without]
|
48
|
+
group_list = [groups[0...-1].join(', '), groups[-1..-1]]
|
49
|
+
.reject { |s| s.to_s.empty? }.join(' and ')
|
50
|
+
group_str = groups.size == 1 ? 'group' : 'groups'
|
51
|
+
"Gems in the #{group_str} #{group_list} were not #{command_in_past_tense}."
|
52
|
+
end
|
35
53
|
end
|
36
54
|
end
|
37
55
|
end
|
data/lib/bundle-only/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bundle-only
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MOZGIII
|
@@ -14,14 +14,14 @@ dependencies:
|
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.11'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.11'
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -67,9 +67,13 @@ files:
|
|
67
67
|
- ".gitignore"
|
68
68
|
- ".rubocop.yml"
|
69
69
|
- ".rubocop_todo.yml"
|
70
|
+
- ".travis.yml"
|
71
|
+
- ".vscode/settings.json"
|
70
72
|
- Gemfile
|
71
73
|
- README.md
|
72
74
|
- Rakefile
|
75
|
+
- bin/run
|
76
|
+
- bin/test
|
73
77
|
- bundle-only.gemspec
|
74
78
|
- exe/bundle-only
|
75
79
|
- lib/bundle-only.rb
|