continuum-stager-api 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +15 -0
  2. data/.gitignore +22 -0
  3. data/.travis.yml +15 -0
  4. data/CHANGELOG.md +16 -0
  5. data/Gemfile +3 -0
  6. data/LICENSE +21 -0
  7. data/README.md +37 -0
  8. data/Rakefile +7 -0
  9. data/apcera-stager-api-contrib.gemspec +25 -0
  10. data/lib/apcera/stager/error.rb +6 -0
  11. data/lib/apcera/stager/loader.rb +10 -0
  12. data/lib/apcera/stager/stager.rb +270 -0
  13. data/lib/continuum-stager-api.rb +1 -0
  14. data/spec/apcera/stager/stager_spec.rb +496 -0
  15. data/spec/fixtures/cassettes/complete.yml +55 -0
  16. data/spec/fixtures/cassettes/dependencies_add.yml +53 -0
  17. data/spec/fixtures/cassettes/dependencies_remove.yml +53 -0
  18. data/spec/fixtures/cassettes/done.yml +28 -0
  19. data/spec/fixtures/cassettes/download.yml +37400 -0
  20. data/spec/fixtures/cassettes/environment_add.yml +53 -0
  21. data/spec/fixtures/cassettes/environment_remove.yml +53 -0
  22. data/spec/fixtures/cassettes/fail.yml +28 -0
  23. data/spec/fixtures/cassettes/invalid/complete.yml +55 -0
  24. data/spec/fixtures/cassettes/invalid/dependencies_add.yml +53 -0
  25. data/spec/fixtures/cassettes/invalid/dependencies_remove.yml +53 -0
  26. data/spec/fixtures/cassettes/invalid/done.yml +55 -0
  27. data/spec/fixtures/cassettes/invalid/download.yml +54 -0
  28. data/spec/fixtures/cassettes/invalid/environment_add.yml +53 -0
  29. data/spec/fixtures/cassettes/invalid/environment_remove.yml +53 -0
  30. data/spec/fixtures/cassettes/invalid/fail.yml +28 -0
  31. data/spec/fixtures/cassettes/invalid/metadata.yml +28 -0
  32. data/spec/fixtures/cassettes/invalid/provides_add.yml +53 -0
  33. data/spec/fixtures/cassettes/invalid/provides_remove.yml +53 -0
  34. data/spec/fixtures/cassettes/invalid/relaunch.yml +53 -0
  35. data/spec/fixtures/cassettes/invalid/snapshot.yml +53 -0
  36. data/spec/fixtures/cassettes/invalid/templates_add.yml +53 -0
  37. data/spec/fixtures/cassettes/invalid/templates_remove.yml +53 -0
  38. data/spec/fixtures/cassettes/invalid/upload.yml +55 -0
  39. data/spec/fixtures/cassettes/metadata.yml +51 -0
  40. data/spec/fixtures/cassettes/provides_add.yml +53 -0
  41. data/spec/fixtures/cassettes/provides_remove.yml +116 -0
  42. data/spec/fixtures/cassettes/relaunch.yml +28 -0
  43. data/spec/fixtures/cassettes/snapshot.yml +28 -0
  44. data/spec/fixtures/cassettes/templates_add.yml +53 -0
  45. data/spec/fixtures/cassettes/templates_remove.yml +53 -0
  46. data/spec/fixtures/cassettes/upload.yml +30 -0
  47. data/spec/spec_helper.rb +31 -0
  48. metadata +189 -0
@@ -0,0 +1,51 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://example.com/meta
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ Date:
16
+ - Wed, 14 Aug 2013 08:52:04 GMT
17
+ Transfer-Encoding:
18
+ - chunked
19
+ Content-Type:
20
+ - application/json;charset=UTF-8
21
+ body:
22
+ encoding: UTF-8
23
+ string: |-
24
+ {
25
+ "dependencies": [
26
+ {"type": "os", "name": "linux"},
27
+ {"type": "package", "name": "build-essential"}
28
+ ],
29
+ "provides": [
30
+ {"type": "runtime", "name": "ruby"},
31
+ {"type": "runtime", "name": "ruby-1.9"}
32
+ ],
33
+ "environment": {
34
+ "PATH": "/opt/apcera/ruby-1.9.3/bin:$PATH",
35
+ "START_COMMAND": "./startme",
36
+ "START_PATH": "/app"
37
+ },
38
+ "templates": [
39
+ {
40
+ "path": "foo",
41
+ "left_delimiter": "<<",
42
+ "right_delimiter": ">>"
43
+ },
44
+ {
45
+ "path": "bar"
46
+ }
47
+ ]
48
+ }
49
+ http_version:
50
+ recorded_at: Wed, 14 Aug 2013 08:52:04 GMT
51
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,53 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://example.com/meta
6
+ body:
7
+ encoding: US-ASCII
8
+ string: resource=provides&action=add&type=os&name=linux
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ response:
13
+ status:
14
+ code: 200
15
+ message:
16
+ headers:
17
+ Content-Type:
18
+ - text/html
19
+ Date:
20
+ - Mon, 25 Aug 2014 22:37:32 GMT
21
+ Content-Length:
22
+ - '4'
23
+ body:
24
+ encoding: US-ASCII
25
+ string: ! "OK"
26
+ http_version:
27
+ recorded_at: Mon, 25 Aug 2014 22:37:33 GMT
28
+ - request:
29
+ method: post
30
+ uri: http://example.com/done
31
+ body:
32
+ encoding: US-ASCII
33
+ string: ''
34
+ headers: {}
35
+ response:
36
+ status:
37
+ code: 200
38
+ message: OK
39
+ headers:
40
+ Content-Type:
41
+ - text/html; charset=ISO-8859-1
42
+ Date:
43
+ - Mon, 25 Aug 2014 02:00:56 GMT
44
+ Content-Length:
45
+ - '2'
46
+ Connection:
47
+ - close
48
+ body:
49
+ encoding: US-ASCII
50
+ string: OK
51
+ http_version:
52
+ recorded_at: Mon, 25 Aug 2014 02:00:56 GMT
53
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,116 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://example.com/meta
6
+ body:
7
+ encoding: US-ASCII
8
+ string: resource=provides&action=remove&type=os&name=linux
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ response:
13
+ status:
14
+ code: 200
15
+ message:
16
+ headers:
17
+ Content-Type:
18
+ - text/html
19
+ Date:
20
+ - Mon, 25 Aug 2014 22:37:32 GMT
21
+ Content-Length:
22
+ - '4'
23
+ body:
24
+ encoding: US-ASCII
25
+ string: OK
26
+ http_version:
27
+ recorded_at: Mon, 25 Aug 2014 22:37:33 GMT
28
+ - request:
29
+ method: post
30
+ uri: http://example.com/done
31
+ body:
32
+ encoding: US-ASCII
33
+ string: ''
34
+ headers: {}
35
+ response:
36
+ status:
37
+ code: 200
38
+ message: OK
39
+ headers:
40
+ Content-Type:
41
+ - text/html; charset=ISO-8859-1
42
+ Date:
43
+ - Mon, 25 Aug 2014 02:00:56 GMT
44
+ Content-Length:
45
+ - '2'
46
+ Connection:
47
+ - close
48
+ body:
49
+ encoding: US-ASCII
50
+ string: OK
51
+ http_version:
52
+ recorded_at: Mon, 25 Aug 2014 02:00:56 GMT
53
+ - request:
54
+ method: post
55
+ uri: http://example.com/failed
56
+ body:
57
+ encoding: ASCII-8BIT
58
+ string: !binary ""
59
+ headers:
60
+ Accept:
61
+ - ! '*/*; q=0.5, application/xml'
62
+ Accept-Encoding:
63
+ - gzip, deflate
64
+ Content-Length:
65
+ - '0'
66
+ Content-Type:
67
+ - application/x-www-form-urlencoded
68
+ User-Agent:
69
+ - Ruby
70
+ response:
71
+ status:
72
+ code: 404
73
+ message: Not Found
74
+ headers:
75
+ Accept-Ranges:
76
+ - bytes
77
+ Cache-Control:
78
+ - max-age=604800
79
+ Content-Type:
80
+ - text/html
81
+ Date:
82
+ - Mon, 25 Aug 2014 23:26:54 GMT
83
+ Etag:
84
+ - ! '"359670651"'
85
+ Expires:
86
+ - Mon, 01 Sep 2014 23:26:54 GMT
87
+ Last-Modified:
88
+ - Fri, 09 Aug 2013 23:54:35 GMT
89
+ Server:
90
+ - EOS (lax004/280C)
91
+ X-Ec-Custom-Error:
92
+ - '1'
93
+ Content-Length:
94
+ - '1270'
95
+ body:
96
+ encoding: US-ASCII
97
+ string: ! "<!doctype html>\n<html>\n<head>\n <title>Example Domain</title>\n\n
98
+ \ <meta charset=\"utf-8\" />\n <meta http-equiv=\"Content-type\" content=\"text/html;
99
+ charset=utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width,
100
+ initial-scale=1\" />\n <style type=\"text/css\">\n body {\n background-color:
101
+ #f0f0f2;\n margin: 0;\n padding: 0;\n font-family: \"Open
102
+ Sans\", \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n \n }\n
103
+ \ div {\n width: 600px;\n margin: 5em auto;\n padding:
104
+ 50px;\n background-color: #fff;\n border-radius: 1em;\n }\n
105
+ \ a:link, a:visited {\n color: #38488f;\n text-decoration:
106
+ none;\n }\n @media (max-width: 700px) {\n body {\n background-color:
107
+ #fff;\n }\n div {\n width: auto;\n margin:
108
+ 0 auto;\n border-radius: 0;\n padding: 1em;\n }\n
109
+ \ }\n </style> \n</head>\n\n<body>\n<div>\n <h1>Example Domain</h1>\n
110
+ \ <p>This domain is established to be used for illustrative examples in
111
+ documents. You may use this\n domain in examples without prior coordination
112
+ or asking for permission.</p>\n <p><a href=\"http://www.iana.org/domains/example\">More
113
+ information...</a></p>\n</div>\n</body>\n</html>\n"
114
+ http_version:
115
+ recorded_at: Mon, 25 Aug 2014 23:26:54 GMT
116
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,28 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://example.com/relaunch
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ Content-Type:
16
+ - text/html; charset=ISO-8859-1
17
+ Date:
18
+ - Mon, 25 Aug 2014 02:00:56 GMT
19
+ Content-Length:
20
+ - '2'
21
+ Connection:
22
+ - close
23
+ body:
24
+ encoding: US-ASCII
25
+ string: OK
26
+ http_version:
27
+ recorded_at: Mon, 25 Aug 2014 02:00:57 GMT
28
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,28 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://example.com/snapshot
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ Content-Type:
16
+ - text/html; charset=ISO-8859-1
17
+ Date:
18
+ - Mon, 25 Aug 2014 02:00:56 GMT
19
+ Content-Length:
20
+ - '2'
21
+ Connection:
22
+ - close
23
+ body:
24
+ encoding: US-ASCII
25
+ string: OK
26
+ http_version:
27
+ recorded_at: Mon, 25 Aug 2014 02:00:56 GMT
28
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,53 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://example.com/meta
6
+ body:
7
+ encoding: US-ASCII
8
+ string: resource=templates&action=add&path=/path/to/template&left_delimiter={{&right_delimiter=}}
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ response:
13
+ status:
14
+ code: 200
15
+ message:
16
+ headers:
17
+ Content-Type:
18
+ - text/html
19
+ Date:
20
+ - Mon, 25 Aug 2014 22:37:32 GMT
21
+ Content-Length:
22
+ - '4'
23
+ body:
24
+ encoding: US-ASCII
25
+ string: ! "OK"
26
+ http_version:
27
+ recorded_at: Mon, 25 Aug 2014 22:37:33 GMT
28
+ - request:
29
+ method: post
30
+ uri: http://example.com/done
31
+ body:
32
+ encoding: US-ASCII
33
+ string: ''
34
+ headers: {}
35
+ response:
36
+ status:
37
+ code: 200
38
+ message: OK
39
+ headers:
40
+ Content-Type:
41
+ - text/html; charset=ISO-8859-1
42
+ Date:
43
+ - Mon, 25 Aug 2014 02:00:56 GMT
44
+ Content-Length:
45
+ - '2'
46
+ Connection:
47
+ - close
48
+ body:
49
+ encoding: US-ASCII
50
+ string: OK
51
+ http_version:
52
+ recorded_at: Mon, 25 Aug 2014 02:00:56 GMT
53
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,53 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://example.com/meta
6
+ body:
7
+ encoding: US-ASCII
8
+ string: resource=templates&action=remove&path=/path/to/template&left_delimiter={{&right_delimiter=}}
9
+ headers:
10
+ Content-Type:
11
+ - application/x-www-form-urlencoded
12
+ response:
13
+ status:
14
+ code: 200
15
+ message:
16
+ headers:
17
+ Content-Type:
18
+ - text/html
19
+ Date:
20
+ - Mon, 25 Aug 2014 22:37:32 GMT
21
+ Content-Length:
22
+ - '4'
23
+ body:
24
+ encoding: US-ASCII
25
+ string: ! "OK"
26
+ http_version:
27
+ recorded_at: Mon, 25 Aug 2014 22:37:33 GMT
28
+ - request:
29
+ method: post
30
+ uri: http://example.com/done
31
+ body:
32
+ encoding: US-ASCII
33
+ string: ''
34
+ headers: {}
35
+ response:
36
+ status:
37
+ code: 200
38
+ message: OK
39
+ headers:
40
+ Content-Type:
41
+ - text/html; charset=ISO-8859-1
42
+ Date:
43
+ - Mon, 25 Aug 2014 02:00:56 GMT
44
+ Content-Length:
45
+ - '2'
46
+ Connection:
47
+ - close
48
+ body:
49
+ encoding: US-ASCII
50
+ string: OK
51
+ http_version:
52
+ recorded_at: Mon, 25 Aug 2014 02:00:56 GMT
53
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,30 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://example.com/data
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Content-Type:
11
+ - application/octet-stream
12
+ response:
13
+ status:
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ Content-Type:
18
+ - text/html
19
+ Content-Length:
20
+ - '2'
21
+ Connection:
22
+ - close
23
+ Date:
24
+ - Mon, 25 Aug 2014 02:37:56 GMT
25
+ body:
26
+ encoding: US-ASCII
27
+ string: OK
28
+ http_version:
29
+ recorded_at: Mon, 25 Aug 2014 02:37:56 GMT
30
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,31 @@
1
+ # Were running tests?
2
+ RSPEC_RUNNING = true
3
+
4
+ require 'simplecov'
5
+ SimpleCov.start do
6
+ add_filter 'spec'
7
+ end
8
+
9
+ require File.join('bundler', 'setup')
10
+ require 'rspec'
11
+ require 'vcr'
12
+ require 'continuum-stager-api'
13
+
14
+ root_path = File.join(Gem::Specification.find_by_name("continuum-stager-api").gem_dir, "spec")
15
+
16
+ VCR.configure do |c|
17
+ c.cassette_library_dir = File.join(root_path, 'fixtures/cassettes')
18
+ c.hook_into :webmock
19
+ c.default_cassette_options = { :match_requests_on => [:path], :record => :new_episodes, :erb => true, :serialize_with => :yaml }
20
+ end
21
+
22
+ RSpec.configure do |config|
23
+ # Use color in STDOUT
24
+ config.color_enabled = true
25
+
26
+ # Use color not only in STDOUT but also in pagers and files
27
+ config.tty = true
28
+
29
+ # Use the specified formatter
30
+ config.formatter = :documentation # :progress, :html, :textmate
31
+ end