apcera-stager-api 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +22 -0
  3. data/.travis.yml +15 -0
  4. data/CHANGELOG.md +17 -0
  5. data/Gemfile +3 -0
  6. data/LICENSE +21 -0
  7. data/README.md +86 -0
  8. data/Rakefile +8 -0
  9. data/apcera-stager-api-contrib.gemspec +25 -0
  10. data/lib/apcera-stager-api.rb +1 -0
  11. data/lib/apcera/stager/error.rb +8 -0
  12. data/lib/apcera/stager/loader.rb +11 -0
  13. data/lib/apcera/stager/stager.rb +335 -0
  14. data/spec/apcera/stager/stager_spec.rb +571 -0
  15. data/spec/fixtures/cassettes/complete.yml +55 -0
  16. data/spec/fixtures/cassettes/dependencies_add.yml +101 -0
  17. data/spec/fixtures/cassettes/dependencies_remove.yml +101 -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 +53 -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 +55 -0
  47. data/spec/spec_helper.rb +31 -0
  48. data/spec/tmp/.gitkeep +0 -0
  49. metadata +190 -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.9.2
@@ -0,0 +1,53 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
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,53 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
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
+ 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: put
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: put
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,55 @@
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
+ - request:
31
+ method: post
32
+ uri: http://example.com/done
33
+ body:
34
+ encoding: US-ASCII
35
+ string: ''
36
+ headers: {}
37
+ response:
38
+ status:
39
+ code: 200
40
+ message: OK
41
+ headers:
42
+ Content-Type:
43
+ - text/html; charset=ISO-8859-1
44
+ Date:
45
+ - Mon, 25 Aug 2014 02:00:56 GMT
46
+ Content-Length:
47
+ - '2'
48
+ Connection:
49
+ - close
50
+ body:
51
+ encoding: US-ASCII
52
+ string: OK
53
+ http_version:
54
+ recorded_at: Mon, 25 Aug 2014 02:00:56 GMT
55
+ 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 'apcera-stager-api'
13
+
14
+ root_path = File.join(Gem::Specification.find_by_name("apcera-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
File without changes
metadata ADDED
@@ -0,0 +1,190 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: apcera-stager-api
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.5
5
+ platform: ruby
6
+ authors:
7
+ - Josh Ellithorpe
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-10-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rest-client
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: json
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 2.6.0
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 2.6.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: webmock
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '='
74
+ - !ruby/object:Gem::Version
75
+ version: '1.11'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '='
81
+ - !ruby/object:Gem::Version
82
+ version: '1.11'
83
+ - !ruby/object:Gem::Dependency
84
+ name: simplecov
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: vcr
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ description: Apcera Stager API Library
112
+ email:
113
+ - josh@apcera.com
114
+ executables: []
115
+ extensions: []
116
+ extra_rdoc_files: []
117
+ files:
118
+ - ".gitignore"
119
+ - ".travis.yml"
120
+ - CHANGELOG.md
121
+ - Gemfile
122
+ - LICENSE
123
+ - README.md
124
+ - Rakefile
125
+ - apcera-stager-api-contrib.gemspec
126
+ - lib/apcera-stager-api.rb
127
+ - lib/apcera/stager/error.rb
128
+ - lib/apcera/stager/loader.rb
129
+ - lib/apcera/stager/stager.rb
130
+ - spec/apcera/stager/stager_spec.rb
131
+ - spec/fixtures/cassettes/complete.yml
132
+ - spec/fixtures/cassettes/dependencies_add.yml
133
+ - spec/fixtures/cassettes/dependencies_remove.yml
134
+ - spec/fixtures/cassettes/done.yml
135
+ - spec/fixtures/cassettes/download.yml
136
+ - spec/fixtures/cassettes/environment_add.yml
137
+ - spec/fixtures/cassettes/environment_remove.yml
138
+ - spec/fixtures/cassettes/fail.yml
139
+ - spec/fixtures/cassettes/invalid/complete.yml
140
+ - spec/fixtures/cassettes/invalid/dependencies_add.yml
141
+ - spec/fixtures/cassettes/invalid/dependencies_remove.yml
142
+ - spec/fixtures/cassettes/invalid/done.yml
143
+ - spec/fixtures/cassettes/invalid/download.yml
144
+ - spec/fixtures/cassettes/invalid/environment_add.yml
145
+ - spec/fixtures/cassettes/invalid/environment_remove.yml
146
+ - spec/fixtures/cassettes/invalid/fail.yml
147
+ - spec/fixtures/cassettes/invalid/metadata.yml
148
+ - spec/fixtures/cassettes/invalid/provides_add.yml
149
+ - spec/fixtures/cassettes/invalid/provides_remove.yml
150
+ - spec/fixtures/cassettes/invalid/relaunch.yml
151
+ - spec/fixtures/cassettes/invalid/snapshot.yml
152
+ - spec/fixtures/cassettes/invalid/templates_add.yml
153
+ - spec/fixtures/cassettes/invalid/templates_remove.yml
154
+ - spec/fixtures/cassettes/invalid/upload.yml
155
+ - spec/fixtures/cassettes/metadata.yml
156
+ - spec/fixtures/cassettes/provides_add.yml
157
+ - spec/fixtures/cassettes/provides_remove.yml
158
+ - spec/fixtures/cassettes/relaunch.yml
159
+ - spec/fixtures/cassettes/snapshot.yml
160
+ - spec/fixtures/cassettes/templates_add.yml
161
+ - spec/fixtures/cassettes/templates_remove.yml
162
+ - spec/fixtures/cassettes/upload.yml
163
+ - spec/spec_helper.rb
164
+ - spec/tmp/.gitkeep
165
+ homepage: http://apcera.com
166
+ licenses:
167
+ - MIT
168
+ metadata: {}
169
+ post_install_message:
170
+ rdoc_options: []
171
+ require_paths:
172
+ - lib
173
+ required_ruby_version: !ruby/object:Gem::Requirement
174
+ requirements:
175
+ - - ">="
176
+ - !ruby/object:Gem::Version
177
+ version: '0'
178
+ required_rubygems_version: !ruby/object:Gem::Requirement
179
+ requirements:
180
+ - - ">="
181
+ - !ruby/object:Gem::Version
182
+ version: '0'
183
+ requirements: []
184
+ rubyforge_project:
185
+ rubygems_version: 2.4.5.1
186
+ signing_key:
187
+ specification_version: 4
188
+ summary: Apcera Stager API library which makes it super easy to write stagers for
189
+ the Apcera Platform.
190
+ test_files: []