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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 31148eb5e8213279827dc3dfed03adc81d6f2f7d
4
- data.tar.gz: 7919552d2b89d1b155f0c8337e97719c16abb9e9
3
+ metadata.gz: 84d9d76d8ed7b19a901690b275e0523a2eea9a09
4
+ data.tar.gz: 3f6a1b4f19d5d3d8a692045bbbb26f10fefeabff
5
5
  SHA512:
6
- metadata.gz: 8e3ecdb76e31103449b7595ed6e27c92617db722e0cb93b626c3b440f61b59a066ea7926d69a39f3b71e61ed6c8980493eb5007cdd2f1665164ba33bc9d19563
7
- data.tar.gz: '018c6c0ed7ff08369b8b64f199d0620dfdbdf1815ce057504a2bfeb202c2e73e09870795f03cf42b97567fb04c2a7b9f48ffb7d1e80522c7530d23be7d152274'
6
+ metadata.gz: a08a958cc147781a0ae491afb5d6c01fc435a0fbe99485917d14da47b059166af894eaa554e57411329ea23486d3d4720c3aacf9e4469f51f2afb423979a7262
7
+ data.tar.gz: 62b1cc93f395c94476a0637eb1da91b61dfa213421bd7953420f635702a669683e22f4a3f9eb806802e9b732b2d0a1cdbd5bb017ba8416e50289e76976795ad1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ 0.7.0
2
+ ===
3
+ - Add prefix option to install command.
4
+
1
5
  0.6.2
2
6
  ===
3
7
  - Provide CLI option to generate binstubs.
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
 
@@ -145,7 +145,7 @@ module Prebundler
145
145
 
146
146
  def gem_list
147
147
  @gem_list ||= Prebundler::GemfileInterpreter.interpret(
148
- gemfile_path, bundle_path
148
+ gemfile_path, bundle_path, prefix: options[:prefix]
149
149
  )
150
150
  end
151
151
 
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module Prebundler
2
- VERSION = '0.6.0'
2
+ VERSION = '0.7.0'
3
3
  end
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.6.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-04 00:00:00.000000000 Z
11
+ date: 2018-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler