pipely 0.8.2 → 0.8.3

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: 2053409e13e0e6323526d8c45d0b55cb2e197ba9
4
- data.tar.gz: 03bccc2c5589b9b31e26200c64d5a30867e0f47d
3
+ metadata.gz: 14e0eda2e643cd0b9b8fcf79b668adb5162510a8
4
+ data.tar.gz: ea9199edd89bcbc3d8b6ab71a727e2a8c69e2b56
5
5
  SHA512:
6
- metadata.gz: 3b10710d5daa86dbebeb009e745df33bce6f922489617d56e7442b1759f2073db754d80f11d4bc7f7786aa4181be376bc6cb368b02854a86048732de0adcd817
7
- data.tar.gz: c465ed2eb9ca2949c5c9902352ce164013d4884f4cf4d7ada8c078486caa41ea30e1e5a200e9615e368dd7a9130799b1df4d258f4c50929ff042ca4bad0aad06
6
+ metadata.gz: f7f3a6df462c844a132d070af1474c3b102c40ad4592531f8e9078f5523abf0b265386b8c090a12c2dd39f18d8060d9f2d1f47b448a5eb8080dadc97fc3c9b2d
7
+ data.tar.gz: d578ec42ba4eb48e6937824b2a67c6af16a7b3c700655a3d956e9584f7cce3eb1ea33b1fb8109f8a26c2db36abaa544375a67b0fbad6515d3621e43a7e508078
@@ -1,5 +1,5 @@
1
1
  require 'fileutils'
2
- require 'excon'
2
+ require 'rubygems/remote_fetcher'
3
3
 
4
4
  module Pipely
5
5
  module Bundler
@@ -100,19 +100,12 @@ module Pipely
100
100
  "distrubtion, for more details see LINK"
101
101
 
102
102
  ruby_gem_url = "https://rubygems.org/downloads/#{gem_file_name}"
103
- response = Excon.get( ruby_gem_url, {
104
- middlewares: Excon.defaults[:middlewares] +
105
- [Excon::Middleware::RedirectFollower]
106
- })
107
-
108
- if response.status == 200
109
- File.open(vendored_gem, 'w') { |file| file.write( response.body ) }
110
- return vendored_gem
111
- else
112
- raise GemFetchError.new(
113
- "Failed to find #{gem_file_name} at rubygems, recieved
114
- #{response.status} with #{response.body}" )
115
- end
103
+
104
+ fetcher = Gem::RemoteFetcher.new
105
+ gem_data = fetcher.fetch_path(ruby_gem_url)
106
+ IO.binwrite(vendored_gem, gem_data)
107
+
108
+ vendored_gem
116
109
  end
117
110
  end
118
111
  end
@@ -1,3 +1,3 @@
1
1
  module Pipely
2
- VERSION = "0.8.2" unless defined?(::Pipely::VERSION)
2
+ VERSION = "0.8.3" unless defined?(::Pipely::VERSION)
3
3
  end
@@ -64,29 +64,15 @@ describe Pipely::Bundler::GemPackager do
64
64
  end
65
65
 
66
66
  it "downloads from rubygems" do
67
- response = double(:response, status: 200, body: 'im a gem')
68
- expect(Excon).to receive(:get).with(
69
- "https://rubygems.org/downloads/test-0.0.1.gem", anything())
70
- .and_return(response)
67
+ remote_fetcher = double(:remote_fetcher)
68
+ expect(Gem::RemoteFetcher).to receive(:new).and_return(remote_fetcher)
69
+ expect(remote_fetcher).to receive(:fetch_path).
70
+ with("https://rubygems.org/downloads/test-0.0.1.gem")
71
71
  expect(subject.package(gem_spec)).to eq(
72
72
  {"test"=>"vendor/test/test-0.0.1.gem"})
73
73
  end
74
74
  end
75
75
 
76
- context "if source not available and not on rubygems" do
77
- before do
78
- allow(File).to receive(:directory?).with(gem_spec.gem_dir) { false }
79
- end
80
-
81
- it "raises" do
82
- response = double(:response, status: 400, body: 'test')
83
- expect(Excon).to receive(:get).with(
84
- "https://rubygems.org/downloads/test-0.0.1.gem", anything())
85
- .and_return(response)
86
-
87
- expect { subject.package(gem_spec) }.to raise_error
88
- end
89
- end
90
76
  end
91
77
  end
92
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.2
4
+ version: 0.8.3
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-10-06 00:00:00.000000000 Z
11
+ date: 2014-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-graphviz