apcera-stager-api 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/apcera-stager-api-contrib.gemspec +2 -2
- data/lib/apcera/stager/stager.rb +4 -1
- data/spec/apcera/stager/stager_spec.rb +25 -1
- data/spec/fixtures/cassettes/complete.yml +44 -1
- data/spec/fixtures/cassettes/upload.yml +44 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9dd6d7eb756e6ca3067097459ad91639f4fe79c
|
4
|
+
data.tar.gz: a38aab10c262f0dade6c6ce10aa9ac26b318cb46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b12f8f8efea4ce6f829082aafb0092a7e9cd5664f6ef14f88f9696a999bb9ee4d663cb75ab22735a10bacdf95afdf7b64febc1ad176a7886cbf696efb54fa68e
|
7
|
+
data.tar.gz: cb56f494eb2e0a6799d038a39c1d3760da0234dbb709b3c76c9972e164172f15607234b63497e74780492692e13b92c0e71e8428cb7a36d1a0ef7becea454288
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,21 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
Documentation started at the 0.2.5 release.
|
4
4
|
|
5
|
+
## 0.3.2 apcera-stager-api
|
6
|
+
|
7
|
+
### Added
|
8
|
+
- Nothing
|
9
|
+
|
10
|
+
### Deprecated
|
11
|
+
- Nothing.
|
12
|
+
|
13
|
+
### Removed
|
14
|
+
- Nothing.
|
15
|
+
|
16
|
+
### Fixed
|
17
|
+
- Fixed a problem with the upload routine that would prevent your files from
|
18
|
+
being wrapped in the expected directory when having used `extract("some_dir")`.
|
19
|
+
|
5
20
|
## 0.3.1 apcera-stager-api
|
6
21
|
|
7
22
|
### Added
|
@@ -15,10 +15,10 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.test_files = `git ls-files -- {spec}/*`.split("\n")
|
16
16
|
gem.name = "apcera-stager-api"
|
17
17
|
gem.require_paths = ["lib"]
|
18
|
-
gem.version = "0.3.
|
18
|
+
gem.version = "0.3.2"
|
19
19
|
|
20
20
|
gem.add_development_dependency 'rspec', '~> 2.6.0'
|
21
|
-
gem.add_development_dependency 'rake'
|
21
|
+
gem.add_development_dependency 'rake', '~> 10.5'
|
22
22
|
gem.add_development_dependency 'webmock', '1.11'
|
23
23
|
gem.add_development_dependency 'simplecov'
|
24
24
|
gem.add_development_dependency 'vcr'
|
data/lib/apcera/stager/stager.rb
CHANGED
@@ -115,7 +115,10 @@ module Apcera
|
|
115
115
|
|
116
116
|
upload_file(@pkg_path)
|
117
117
|
else
|
118
|
-
execute_app
|
118
|
+
# Use execute instead of execute_app so that if the user provided a dir
|
119
|
+
# to extract into it results in the uploaded package being wrapped in
|
120
|
+
# that directory.
|
121
|
+
execute("cd #{@app_path} && tar czf #{@updated_pkg_path} ./*")
|
119
122
|
|
120
123
|
upload_file(@updated_pkg_path)
|
121
124
|
end
|
@@ -209,11 +209,35 @@ describe Apcera::Stager do
|
|
209
209
|
|
210
210
|
@stager.extract(@appdir)
|
211
211
|
|
212
|
-
@stager.should_receive(:
|
212
|
+
@stager.should_receive(:execute).with("cd #{@stager.app_path} && tar czf #{@stager.updated_pkg_path} ./*").and_return
|
213
213
|
|
214
214
|
@stager.upload
|
215
215
|
end
|
216
216
|
|
217
|
+
it "should upload files with a wrapping directory if extracted into one" do
|
218
|
+
VCR.use_cassette('download') do
|
219
|
+
@stager.download
|
220
|
+
end
|
221
|
+
|
222
|
+
@stager.extract(@appdir)
|
223
|
+
@stager.upload
|
224
|
+
|
225
|
+
out = `tar -tf #{@stager.updated_pkg_path}`
|
226
|
+
out.should include("./#{@appdir}/")
|
227
|
+
end
|
228
|
+
|
229
|
+
it "should upload files without a wrapping directory if not extracted into one" do
|
230
|
+
VCR.use_cassette('download') do
|
231
|
+
@stager.download
|
232
|
+
end
|
233
|
+
|
234
|
+
@stager.extract()
|
235
|
+
@stager.upload
|
236
|
+
|
237
|
+
out = `tar -tf #{@stager.updated_pkg_path}`
|
238
|
+
out.should_not include("./#{@appdir}/")
|
239
|
+
end
|
240
|
+
|
217
241
|
it "should upload the original package when the app wasn't extracted" do
|
218
242
|
VCR.use_cassette('download') do
|
219
243
|
@stager.download
|
@@ -52,4 +52,47 @@ http_interactions:
|
|
52
52
|
string: OK
|
53
53
|
http_version:
|
54
54
|
recorded_at: Mon, 25 Aug 2014 02:37:56 GMT
|
55
|
-
|
55
|
+
- request:
|
56
|
+
method: post
|
57
|
+
uri: http://example.com/failed
|
58
|
+
body:
|
59
|
+
encoding: ASCII-8BIT
|
60
|
+
string: ''
|
61
|
+
headers:
|
62
|
+
Accept:
|
63
|
+
- "*/*; q=0.5, application/xml"
|
64
|
+
Accept-Encoding:
|
65
|
+
- gzip, deflate
|
66
|
+
Content-Length:
|
67
|
+
- '0'
|
68
|
+
Content-Type:
|
69
|
+
- application/x-www-form-urlencoded
|
70
|
+
User-Agent:
|
71
|
+
- Ruby
|
72
|
+
response:
|
73
|
+
status:
|
74
|
+
code: 404
|
75
|
+
message: Not Found
|
76
|
+
headers:
|
77
|
+
Cache-Control:
|
78
|
+
- max-age=604800
|
79
|
+
Content-Type:
|
80
|
+
- text/html
|
81
|
+
Date:
|
82
|
+
- Mon, 21 Mar 2016 19:07:01 GMT
|
83
|
+
Expires:
|
84
|
+
- Mon, 28 Mar 2016 19:07:01 GMT
|
85
|
+
Server:
|
86
|
+
- EOS (lax004/2812)
|
87
|
+
Content-Length:
|
88
|
+
- '452'
|
89
|
+
body:
|
90
|
+
encoding: UTF-8
|
91
|
+
string: "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<!DOCTYPE html PUBLIC
|
92
|
+
\"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html
|
93
|
+
xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n\t<head>\n\t\t<title>404
|
94
|
+
- Not Found</title>\n\t</head>\n\t<body>\n\t\t<h1>404 - Not Found</h1>\n\t\t<script
|
95
|
+
type=\"text/javascript\" src=\"http://gp1.wpc.edgecastcdn.net/00222B/jtest/beacontest.js\"></script>\n\t</body>\n</html>\n"
|
96
|
+
http_version:
|
97
|
+
recorded_at: Mon, 21 Mar 2016 19:07:01 GMT
|
98
|
+
recorded_with: VCR 3.0.1
|
@@ -52,4 +52,47 @@ http_interactions:
|
|
52
52
|
string: OK
|
53
53
|
http_version:
|
54
54
|
recorded_at: Mon, 25 Aug 2014 02:00:56 GMT
|
55
|
-
|
55
|
+
- request:
|
56
|
+
method: post
|
57
|
+
uri: http://example.com/failed
|
58
|
+
body:
|
59
|
+
encoding: ASCII-8BIT
|
60
|
+
string: ''
|
61
|
+
headers:
|
62
|
+
Accept:
|
63
|
+
- "*/*; q=0.5, application/xml"
|
64
|
+
Accept-Encoding:
|
65
|
+
- gzip, deflate
|
66
|
+
Content-Length:
|
67
|
+
- '0'
|
68
|
+
Content-Type:
|
69
|
+
- application/x-www-form-urlencoded
|
70
|
+
User-Agent:
|
71
|
+
- Ruby
|
72
|
+
response:
|
73
|
+
status:
|
74
|
+
code: 404
|
75
|
+
message: Not Found
|
76
|
+
headers:
|
77
|
+
Cache-Control:
|
78
|
+
- max-age=604800
|
79
|
+
Content-Type:
|
80
|
+
- text/html
|
81
|
+
Date:
|
82
|
+
- Mon, 21 Mar 2016 19:07:00 GMT
|
83
|
+
Expires:
|
84
|
+
- Mon, 28 Mar 2016 19:07:00 GMT
|
85
|
+
Server:
|
86
|
+
- EOS (lax004/2812)
|
87
|
+
Content-Length:
|
88
|
+
- '452'
|
89
|
+
body:
|
90
|
+
encoding: UTF-8
|
91
|
+
string: "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<!DOCTYPE html PUBLIC
|
92
|
+
\"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html
|
93
|
+
xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n\t<head>\n\t\t<title>404
|
94
|
+
- Not Found</title>\n\t</head>\n\t<body>\n\t\t<h1>404 - Not Found</h1>\n\t\t<script
|
95
|
+
type=\"text/javascript\" src=\"http://gp1.wpc.edgecastcdn.net/00222B/jtest/beacontest.js\"></script>\n\t</body>\n</html>\n"
|
96
|
+
http_version:
|
97
|
+
recorded_at: Mon, 21 Mar 2016 19:07:00 GMT
|
98
|
+
recorded_with: VCR 3.0.1
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apcera-stager-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Ellithorpe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -56,16 +56,16 @@ dependencies:
|
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '10.5'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '10.5'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: webmock
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|