prebundler 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/prebundle +6 -0
- data/lib/prebundler/cli/install.rb +26 -3
- data/lib/prebundler/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78dfaf4fa82f9db61579bf0370133a0a5d43a9a2
|
4
|
+
data.tar.gz: 0ade8a0aadf781c47972a48bcc810494c16ce4d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f27c4a142a4b10191fc0f2f7bc1a1e75b0194ee2aee4e0b71d9e038642d4c3a4941bec42793f6b8acf9964b6a3bf36f53a4ffcb0f816340868e0187812610a0d
|
7
|
+
data.tar.gz: fe2a9c1fec8982f841ec96eaf31dc201fc0cd5f906f23bf1945b74a540d24d08468a358d75e4eb6f0e21e739859b46d148f04b6940f399eaddbf409eaea2e6e7
|
data/bin/prebundle
CHANGED
@@ -41,6 +41,12 @@ command :install do |c|
|
|
41
41
|
c.default_value ENV.fetch('BUNDLE_PATH', Bundler.bundle_path.to_s)
|
42
42
|
c.flag [:b, :'bundle-path']
|
43
43
|
|
44
|
+
c.desc 'A comma-separated list of groups referencing gems to install.'
|
45
|
+
c.flag :with
|
46
|
+
|
47
|
+
c.desc 'A comma-separated list of groups referencing gems to skip during installation.'
|
48
|
+
c.flag :without
|
49
|
+
|
44
50
|
c.action do |global_options, options, args|
|
45
51
|
raise 'Must specify a non-zero number of jobs' if options[:jobs] < 1
|
46
52
|
Prebundler::Cli::Install.run($out, global_options, options, args)
|
@@ -17,6 +17,7 @@ module Prebundler
|
|
17
17
|
def prepare
|
18
18
|
gem_list.each do |_, gem_ref|
|
19
19
|
next if backend_file_list.include?(gem_ref.tar_file)
|
20
|
+
next unless member_of_installable_group?(gem_ref)
|
20
21
|
install_gem(gem_ref) if gem_ref.installable?
|
21
22
|
end
|
22
23
|
end
|
@@ -44,11 +45,17 @@ module Prebundler
|
|
44
45
|
def install_gem_ref(gem_ref)
|
45
46
|
return unless gem_ref.installable?
|
46
47
|
|
47
|
-
unless
|
48
|
-
|
48
|
+
unless member_of_installable_group?(gem_ref)
|
49
|
+
out.puts "Skipping #{gem_ref.id} because of its group"
|
50
|
+
return
|
49
51
|
end
|
50
52
|
|
51
|
-
|
53
|
+
if File.exist?(gem_ref.install_dir)
|
54
|
+
out.puts "Skipping #{gem_ref.id} because it's already installed"
|
55
|
+
else
|
56
|
+
install_gem(gem_ref)
|
57
|
+
out.puts "Installed #{gem_ref.id}"
|
58
|
+
end
|
52
59
|
end
|
53
60
|
|
54
61
|
def install_gem(gem_ref)
|
@@ -100,6 +107,22 @@ module Prebundler
|
|
100
107
|
def config
|
101
108
|
Prebundler.config
|
102
109
|
end
|
110
|
+
|
111
|
+
def member_of_installable_group?(gem_ref)
|
112
|
+
return true if gem_ref.groups.empty?
|
113
|
+
gem_ref.groups.any? { |g| groups.include?(g) }
|
114
|
+
end
|
115
|
+
|
116
|
+
def groups
|
117
|
+
@groups ||= begin
|
118
|
+
all_groups = gem_list.flat_map { |_, gem_ref| gem_ref.groups }.uniq
|
119
|
+
with_groups = (options[:with] || '').split(',').map { |g| g.strip.to_sym }
|
120
|
+
without_groups = (options[:without] || '').split(',').map { |g| g.strip.to_sym }
|
121
|
+
|
122
|
+
groups = with_groups.empty? ? all_groups : with_groups
|
123
|
+
groups - without_groups
|
124
|
+
end
|
125
|
+
end
|
103
126
|
end
|
104
127
|
end
|
105
128
|
end
|
data/lib/prebundler/version.rb
CHANGED