prebundler 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/bin/prebundle +3 -0
- data/lib/prebundler/cli/install.rb +1 -1
- data/lib/prebundler/gem_ref.rb +4 -2
- data/lib/prebundler/gemfile_interpreter.rb +8 -6
- data/lib/prebundler/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84d9d76d8ed7b19a901690b275e0523a2eea9a09
|
4
|
+
data.tar.gz: 3f6a1b4f19d5d3d8a692045bbbb26f10fefeabff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a08a958cc147781a0ae491afb5d6c01fc435a0fbe99485917d14da47b059166af894eaa554e57411329ea23486d3d4720c3aacf9e4469f51f2afb423979a7262
|
7
|
+
data.tar.gz: 62b1cc93f395c94476a0637eb1da91b61dfa213421bd7953420f635702a669683e22f4a3f9eb806802e9b732b2d0a1cdbd5bb017ba8416e50289e76976795ad1
|
data/CHANGELOG.md
CHANGED
data/bin/prebundle
CHANGED
@@ -38,6 +38,9 @@ command :install do |c|
|
|
38
38
|
c.default_value ENV.fetch('BUNDLE_PATH', Bundler.bundle_path.to_s)
|
39
39
|
c.flag [:b, :'bundle-path']
|
40
40
|
|
41
|
+
c.desc 'Backend prefix (i.e. path) at which to store gems.'
|
42
|
+
c.flag [:prefix]
|
43
|
+
|
41
44
|
c.desc 'A comma-separated list of groups referencing gems to install.'
|
42
45
|
c.flag :with
|
43
46
|
|
data/lib/prebundler/gem_ref.rb
CHANGED
@@ -14,7 +14,7 @@ module Prebundler
|
|
14
14
|
end
|
15
15
|
|
16
16
|
attr_reader :name, :bundle_path, :groups
|
17
|
-
attr_accessor :spec, :dependencies
|
17
|
+
attr_accessor :spec, :dependencies, :prefix
|
18
18
|
|
19
19
|
def initialize(name, bundle_path, options = {})
|
20
20
|
@name = name
|
@@ -22,6 +22,7 @@ module Prebundler
|
|
22
22
|
@groups = Set.new(options[:groups])
|
23
23
|
@source = options[:source]
|
24
24
|
@dependencies = options[:dependencies]
|
25
|
+
@prefix = options[:prefix]
|
25
26
|
end
|
26
27
|
|
27
28
|
def dependencies
|
@@ -115,7 +116,8 @@ module Prebundler
|
|
115
116
|
end
|
116
117
|
|
117
118
|
def tar_file
|
118
|
-
File.join(Bundler.local_platform.to_s, Gem.extension_api_version.to_s, "#{id}.tar")
|
119
|
+
file = File.join(Bundler.local_platform.to_s, Gem.extension_api_version.to_s, "#{id}.tar")
|
120
|
+
prefix && !prefix.empty? ? File.join(prefix, file) : file
|
119
121
|
end
|
120
122
|
|
121
123
|
def gemspec_file
|
@@ -2,23 +2,24 @@ require 'set'
|
|
2
2
|
|
3
3
|
module Prebundler
|
4
4
|
class GemfileInterpreter
|
5
|
-
def self.interpret(gemfile_path, bundle_path)
|
6
|
-
Gemfile.new(new(gemfile_path, bundle_path).gems)
|
5
|
+
def self.interpret(gemfile_path, bundle_path, options = {})
|
6
|
+
Gemfile.new(new(gemfile_path, bundle_path, options).gems)
|
7
7
|
end
|
8
8
|
|
9
|
-
attr_reader :gems, :gemfile_path, :bundle_path
|
9
|
+
attr_reader :gems, :gemfile_path, :bundle_path, :prefix
|
10
10
|
|
11
|
-
def initialize(gemfile_path, bundle_path)
|
11
|
+
def initialize(gemfile_path, bundle_path, options)
|
12
12
|
@gems = {}
|
13
13
|
@current_groups = [:global]
|
14
14
|
@gemfile_path = gemfile_path
|
15
15
|
@bundle_path = bundle_path
|
16
|
+
@prefix = options[:prefix]
|
16
17
|
instance_eval(File.read(gemfile_path))
|
17
18
|
|
18
19
|
lockfile = Bundler::LockfileParser.new(File.read("#{gemfile_path}.lock"))
|
19
20
|
|
20
21
|
lockfile.specs.each do |spec|
|
21
|
-
gems[spec.name] ||= GemRef.create(spec.name, bundle_path)
|
22
|
+
gems[spec.name] ||= GemRef.create(spec.name, bundle_path, options)
|
22
23
|
gems[spec.name].spec = spec
|
23
24
|
gems[spec.name].dependencies = spec.dependencies.map(&:name)
|
24
25
|
end
|
@@ -28,7 +29,8 @@ module Prebundler
|
|
28
29
|
{
|
29
30
|
path: @current_path,
|
30
31
|
groups: @current_groups,
|
31
|
-
source: @current_source
|
32
|
+
source: @current_source,
|
33
|
+
prefix: prefix
|
32
34
|
}
|
33
35
|
end
|
34
36
|
|
data/lib/prebundler/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prebundler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cameron Dutro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|