prebundler 0.9.0 → 0.9.1

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: 1928d857a1f4ed0596fa85e0ca8e2d38cdc3a35f1061dcf0cdc62edbe0f0f95d
4
- data.tar.gz: 89b331c36e6f7d1962ce81a976e73fc557d86c73b9585ecc1f029e0d20e75c4c
3
+ metadata.gz: f49a9f3fcf95202953b7e9b0ff30de9fc464a773e2e7758b66405aa785fdf469
4
+ data.tar.gz: efc796dedb3083913832bd140cf3e7d94d7591177beb199f24f98ef0b5ea659d
5
5
  SHA512:
6
- metadata.gz: 25d91cdaad84af6e2bbe70c70ed11a4e30124b75287df16ef94391d411bbc411618619271ead3507241a2a47ec204f3e4849390b475d50f1e98543de657623f5
7
- data.tar.gz: 49c459e87af92719d8715c160cf82ea43cb28e4300617621717479ccc34577a1e571aeff58761ba8fa89a8dcc8027268426ca96a42553b25e5e25e8172059e60
6
+ metadata.gz: 53ba3344cdc671135fd4ec13bced1631ad7207c76a08086544ce3c012bf15a4af363b5d1314afb59b26f6642e107110ecd51f9d409b8b4816640e5bbaf4d61e2
7
+ data.tar.gz: 58575cb59c0101a01578c27e171f131b32a471af4b7f0d7161ba68a342d502578311525a1689a62c563dc17457a2b3b141a757debdab08ccf4364b3dd4b1ab95
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ 0.9.1
2
+ ===
3
+ - Woops, also use platform version when determining the gems that have already been built.
4
+ - Fix the subsetter so it outputs gems inside correct source blocks.
5
+
1
6
  0.9.0
2
7
  ===
3
8
  - Include platform version when uploading gem tarballs to the storage backend (this will cause bundles installed by previous versions of prebundler to be rebuilt).
data/lib/prebundler.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'ohai'
2
+
1
3
  module Prebundler
2
4
  autoload :Cli, 'prebundler/cli'
3
5
  autoload :Configurator, 'prebundler/configurator'
@@ -23,5 +25,15 @@ module Prebundler
23
25
  def configured?
24
26
  !!@config
25
27
  end
28
+
29
+ def platform_version
30
+ @platform_version ||= "#{system_info['platform']}-#{system_info['platform_version']}"
31
+ end
32
+
33
+ private
34
+
35
+ def system_info
36
+ @@system_info ||= Ohai::System.new.all_plugins(['platform'])
37
+ end
26
38
  end
27
39
  end
@@ -1,6 +1,5 @@
1
1
  require 'fileutils'
2
2
  require 'set'
3
- require 'ohai'
4
3
 
5
4
  module Prebundler
6
5
  class GemRef
@@ -119,21 +118,14 @@ module Prebundler
119
118
  end
120
119
 
121
120
  def relative_gemspec_files
122
- [File.join('specifications', gemspec_file)]
121
+ Dir.chdir(bundle_path) do
122
+ Dir.glob(File.join('specifications', "#{id}*.gemspec"))
123
+ end
123
124
  end
124
125
 
125
126
  def tar_file
126
- platform_version = "#{system_info['platform']}-#{system_info['platform_version']}"
127
- file = File.join(Bundler.local_platform.to_s, platform_version, Gem.extension_api_version.to_s, "#{id}.tar")
127
+ file = File.join(Bundler.local_platform.to_s, Prebundler.platform_version, Gem.extension_api_version.to_s, "#{id}.tar")
128
128
  prefix && !prefix.empty? ? File.join(prefix, file) : file
129
129
  end
130
-
131
- def system_info
132
- @@system_info ||= Ohai::System.new.all_plugins(['platform'])
133
- end
134
-
135
- def gemspec_file
136
- "#{id}.gemspec"
137
- end
138
130
  end
139
131
  end
@@ -1,3 +1,5 @@
1
+ require 'set'
2
+
1
3
  module Prebundler
2
4
  class GemfileSubset
3
5
  attr_reader :gemfile, :included_gems, :additional_gems, :raw
@@ -8,7 +10,7 @@ module Prebundler
8
10
 
9
11
  def initialize(gemfile)
10
12
  @gemfile = gemfile
11
- @included_gems = []
13
+ @included_gems = Set.new
12
14
  @additional_gems = []
13
15
  @raw = []
14
16
  end
@@ -46,18 +48,12 @@ module Prebundler
46
48
  end
47
49
 
48
50
  ''.tap do |result|
49
- (groups.keys - [nil]).each_with_index do |remote, idx|
51
+ groups.each_with_index do |(remote, _), idx|
50
52
  result << "\n" if idx > 0
51
53
  result << "source '#{remote}' do\n"
52
54
  result << groups[remote].map { |g| " #{g}" }.join("\n")
53
55
  result << "\nend\n"
54
56
  end
55
-
56
- unless groups[nil].empty?
57
- result << "\n"
58
- result << groups[nil].join("\n")
59
- result << "\n"
60
- end
61
57
  end
62
58
  end
63
59
 
@@ -67,24 +63,26 @@ module Prebundler
67
63
  Hash.new { |h, k| h[k] = [] }.tap do |ret|
68
64
  deps.each do |dep|
69
65
  if spec = gemfile.gems[dep.name]
70
- ret[spec.remote] << spec.to_gem
66
+ ret[spec.remote || GemRef::DEFAULT_SOURCE] << spec.to_gem
71
67
  else
72
68
  req_str = dep.requirements_list.map { |r| "'#{r}'" }.join(', ')
73
- ret[nil] << "gem '#{dep.name}', #{req_str}"
69
+ ret[GemRef::DEFAULT_SOURCE] << "gem '#{dep.name}', #{req_str}"
74
70
  end
75
71
  end
76
72
  end
77
73
  end
78
74
 
79
75
  def aggregate_deps(include_dev_deps)
80
- Set.new.tap do |result|
76
+ dep_names = Set.new.tap do |result|
81
77
  included_gems.each do |included_gem_name|
82
78
  gemfile.gems[included_gem_name].gemspecs.each do |gemspec|
83
- result.merge(gemspec.runtime_dependencies)
84
- result.merge(gemspec.development_dependencies) if include_dev_deps
79
+ result.merge(gemspec.runtime_dependencies.map(&:name))
80
+ result.merge(gemspec.development_dependencies.map(&:name)) if include_dev_deps
85
81
  end
86
82
  end
87
83
  end
84
+
85
+ dep_names.map { |dep_name| gemfile.gems[dep_name] }.compact
88
86
  end
89
87
  end
90
88
  end
@@ -31,7 +31,7 @@ module Prebundler
31
31
  files = []
32
32
  base_options = {
33
33
  bucket: bucket,
34
- prefix: "#{Bundler.local_platform.to_s}/#{Gem.extension_api_version.to_s}"
34
+ prefix: "#{Bundler.local_platform.to_s}/#{Prebundler.platform_version}/#{Gem.extension_api_version.to_s}"
35
35
  }
36
36
 
37
37
  while truncated
@@ -1,3 +1,3 @@
1
1
  module Prebundler
2
- VERSION = '0.9.0'
2
+ VERSION = '0.9.1'
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.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Dutro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-05 00:00:00.000000000 Z
11
+ date: 2019-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler