pipely 0.8.0 → 0.8.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
  SHA1:
3
- metadata.gz: 84180497ce48add0459eec37acfdb95bf66ebe05
4
- data.tar.gz: d39f9fef3430493934320d8a88b38a2ced74b42f
3
+ metadata.gz: eef281a640c1e668ba86abf185d025adef835432
4
+ data.tar.gz: 1f7acfb56818dd7e2af904d1cd21a0d53e469315
5
5
  SHA512:
6
- metadata.gz: dae88dbeb0ed78e2197b90cba2601ed218e7bfc8787e5ca4a28618e5b167b2e9d010bfe378670b8b4a8d688f7b624f44abc123f75173046fbf25e3afa1d69555
7
- data.tar.gz: acbb97a002b4f611be91bd2768e25ed75637e9eba962a632d04a4203bfb2db35ca4141d03fe14dfed196313c53e4f49e4945187e3b4b9d8fbc2a9f64d84a0866
6
+ metadata.gz: 8e4140b9eafae0ea7b07345b1fb9c9543e97303737fe5274841bdb069412802106be6779164a1200184a45fff13399b63d5b9179bbcdb8aab98b1ec8039dd93a
7
+ data.tar.gz: 62d212509ae0e2615741f409f76def3ff800ce5aaf803bf65838d7297b2ee528a26f6fd16adb0284da09b3978f421c7faaa7099855a54a5d4c4a9980e95b374d
@@ -32,12 +32,16 @@ module Pipely
32
32
 
33
33
  end
34
34
 
35
- def gem_files(gem_packager=GemPackager.new(@vendor_dir))
35
+ def gem_files(opts = {})
36
+ gem_packager = opts[:gem_packager] || GemPackager.new(@vendor_dir)
37
+ gems_to_exclude = opts[:gems_to_exclude] || []
38
+
36
39
  gem_files = {}
37
40
 
38
- @spec_set.to_a.each do |spec|
39
- gem_files.merge!(gem_file(spec, gem_packager))
40
- end
41
+ excluded_gems = lambda { |s| gems_to_exclude.include? s.name }
42
+ merge_gem = lambda { |s| gem_files.merge!(gem_file(s, gem_packager)) }
43
+
44
+ @spec_set.to_a.reject(&excluded_gems).each(&merge_gem)
41
45
 
42
46
  gem_files
43
47
  end
@@ -35,7 +35,7 @@ module Pipely
35
35
  # Always exclude bundler and the project gem
36
36
  gems_to_exclude = [ @project_spec.name, 'bundler' ]
37
37
 
38
- bundle.gem_files.reject { |name, path| gems_to_exclude.include?(name) }
38
+ bundle.gem_files(gems_to_exclude: gems_to_exclude)
39
39
  end
40
40
 
41
41
  def project_gem_file(gem_packager=GemPackager.new(@vendor_dir))
@@ -1,3 +1,3 @@
1
1
  module Pipely
2
- VERSION = "0.8.0" unless defined?(::Pipely::VERSION)
2
+ VERSION = "0.8.1" unless defined?(::Pipely::VERSION)
3
3
  end
@@ -44,16 +44,22 @@ describe Pipely::Bundler::Bundle do
44
44
  end
45
45
 
46
46
  it "returns a cache file for each gem" do
47
- gem_files = subject.gem_files(gem_packager)
47
+ gem_files = subject.gem_files(gem_packager: gem_packager)
48
48
  expect(gem_files.keys).to match_array(%w[ gem1 gem2 pipely ])
49
49
  end
50
50
 
51
+ it "filters out gems to exclude" do
52
+ gem_files = subject.gem_files(gem_packager: gem_packager,
53
+ gems_to_exclude: ['gem2'])
54
+ expect(gem_files.keys).to match_array(%w[ gem1 pipely ])
55
+ end
56
+
51
57
  context "given a packaged/non-locked gem" do
52
58
  it "returns the gems and their existing cache files" do
53
59
  expect(gem_packager).to receive(:package).with(gem1_spec)
54
60
  expect(gem_packager).to receive(:package).with(gem2_spec)
55
61
 
56
- subject.gem_files(gem_packager)
62
+ subject.gem_files(gem_packager: gem_packager)
57
63
  end
58
64
  end
59
65
 
@@ -64,7 +70,7 @@ describe Pipely::Bundler::Bundle do
64
70
  pipely_source.path
65
71
  )
66
72
 
67
- subject.gem_files(gem_packager)
73
+ subject.gem_files(gem_packager: gem_packager)
68
74
  end
69
75
  end
70
76
  end
@@ -59,7 +59,9 @@ describe Pipely::Bundler::ProjectGem do
59
59
  end
60
60
 
61
61
  describe "#dependency_gem_files" do
62
- let(:bundle_gem_files) do
62
+ let(:bundle) { double "Pipely::Bundler::Bundle" }
63
+ let(:excludes) { { gems_to_exclude: [project_spec.name, 'bundler'] } }
64
+ let(:filtered_gem_files) do
63
65
  {
64
66
  'packaged-gem1' => '/path/to/cache/packaged-gem1.gem',
65
67
  'built-from-source-gem1' => '/path/to/cache/built-from-source-gem1.gem',
@@ -68,13 +70,9 @@ describe Pipely::Bundler::ProjectGem do
68
70
  }
69
71
  end
70
72
 
71
- let(:bundle) do
72
- double "Pipely::Bundler::Bundle", gem_files: bundle_gem_files
73
- end
74
-
75
73
  it "should filter out the bundler gem and the project gem" do
76
- result = subject.dependency_gem_files(bundle)
77
- expect(result.keys).to eq(%w[ packaged-gem1 built-from-source-gem1 ])
74
+ expect(bundle).to receive(:gem_files).with(excludes) {filtered_gem_files}
75
+ expect(subject.dependency_gem_files(bundle)).to be(filtered_gem_files)
78
76
  end
79
77
  end
80
78
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pipely
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Gillooly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-30 00:00:00.000000000 Z
11
+ date: 2014-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-graphviz