souffle 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. data/Gemfile +9 -3
  2. data/README.md +6 -0
  3. data/bin/{souffle-server → souffle} +0 -0
  4. data/lib/souffle.rb +8 -8
  5. data/lib/souffle/application.rb +15 -10
  6. data/lib/souffle/application/souffle-server.rb +90 -5
  7. data/lib/souffle/config.rb +88 -59
  8. data/lib/souffle/daemon.rb +156 -0
  9. data/lib/souffle/exceptions.rb +29 -17
  10. data/lib/souffle/http.rb +43 -0
  11. data/lib/souffle/log.rb +11 -14
  12. data/lib/souffle/node.rb +91 -53
  13. data/lib/souffle/node/runlist.rb +16 -18
  14. data/lib/souffle/node/runlist_item.rb +43 -36
  15. data/lib/souffle/node/runlist_parser.rb +60 -62
  16. data/lib/souffle/polling_event.rb +110 -0
  17. data/lib/souffle/provider.rb +231 -23
  18. data/lib/souffle/provider/aws.rb +654 -7
  19. data/lib/souffle/provider/vagrant.rb +42 -5
  20. data/lib/souffle/provisioner.rb +55 -0
  21. data/lib/souffle/provisioner/node.rb +157 -0
  22. data/lib/souffle/provisioner/system.rb +195 -0
  23. data/lib/souffle/redis_client.rb +8 -0
  24. data/lib/souffle/redis_mixin.rb +40 -0
  25. data/lib/souffle/server.rb +42 -8
  26. data/lib/souffle/ssh_monkey.rb +8 -0
  27. data/lib/souffle/state.rb +16 -0
  28. data/lib/souffle/system.rb +139 -37
  29. data/lib/souffle/template.rb +30 -0
  30. data/lib/souffle/templates/Vagrantfile.erb +41 -0
  31. data/lib/souffle/version.rb +6 -0
  32. data/spec/config_spec.rb +20 -0
  33. data/spec/log_spec.rb +24 -0
  34. data/spec/{runlist_parser_spec.rb → node/runlist_parser_spec.rb} +1 -1
  35. data/spec/{runlist_spec.rb → node/runlist_spec.rb} +1 -1
  36. data/spec/node_spec.rb +43 -8
  37. data/spec/provider_spec.rb +56 -0
  38. data/spec/providers/aws_provider_spec.rb +114 -0
  39. data/spec/providers/vagrant_provider_spec.rb +22 -0
  40. data/spec/provisioner_spec.rb +47 -0
  41. data/spec/spec_helper.rb +8 -0
  42. data/spec/system_spec.rb +242 -13
  43. data/spec/template_spec.rb +20 -0
  44. data/spec/templates/example_template.erb +1 -0
  45. metadata +125 -30
  46. data/bin/souffle-worker +0 -7
  47. data/lib/souffle/application/souffle-worker.rb +0 -46
  48. data/lib/souffle/providers.rb +0 -2
  49. data/lib/souffle/worker.rb +0 -14
@@ -0,0 +1,20 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "Souffle::Template" do
4
+ it "should generate a reasonable default template path" do
5
+ temp_path = File.expand_path(
6
+ File.join(File.dirname(__FILE__),
7
+ '..', 'lib', 'souffle', 'templates'))
8
+ Souffle::Template.template_path.should eql(temp_path)
9
+ end
10
+
11
+ it "should be able to generate an example template" do
12
+ sample_binding = OpenStruct.new
13
+ sample_binding.name = "bob"
14
+
15
+ template = Souffle::Template.new(
16
+ "../../../spec/templates/example_template.erb")
17
+ template.render(sample_binding).should eql(
18
+ "some random erb template bob\n")
19
+ end
20
+ end
@@ -0,0 +1 @@
1
+ some random erb template <%= name %>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: souffle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-19 00:00:00.000000000 Z
12
+ date: 2012-09-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: yajl-ruby
@@ -75,6 +75,38 @@ dependencies:
75
75
  - - ~>
76
76
  - !ruby/object:Gem::Version
77
77
  version: 1.1.2
78
+ - !ruby/object:Gem::Dependency
79
+ name: em-ssh
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ version: 0.4.0
86
+ type: :runtime
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: 0.4.0
94
+ - !ruby/object:Gem::Dependency
95
+ name: em-synchrony
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ~>
100
+ - !ruby/object:Gem::Version
101
+ version: 0.2.0
102
+ type: :runtime
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: 0.2.0
78
110
  - !ruby/object:Gem::Dependency
79
111
  name: right_aws
80
112
  requirement: !ruby/object:Gem::Requirement
@@ -91,6 +123,38 @@ dependencies:
91
123
  - - ~>
92
124
  - !ruby/object:Gem::Version
93
125
  version: 3.0.4
126
+ - !ruby/object:Gem::Dependency
127
+ name: tilt
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ~>
132
+ - !ruby/object:Gem::Version
133
+ version: 1.3.3
134
+ type: :runtime
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ~>
140
+ - !ruby/object:Gem::Version
141
+ version: 1.3.3
142
+ - !ruby/object:Gem::Dependency
143
+ name: redis
144
+ requirement: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ~>
148
+ - !ruby/object:Gem::Version
149
+ version: 3.0.1
150
+ type: :runtime
151
+ prerelease: false
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ~>
156
+ - !ruby/object:Gem::Version
157
+ version: 3.0.1
94
158
  - !ruby/object:Gem::Dependency
95
159
  name: mixlib-cli
96
160
  requirement: !ruby/object:Gem::Requirement
@@ -98,7 +162,7 @@ dependencies:
98
162
  requirements:
99
163
  - - ! '>='
100
164
  - !ruby/object:Gem::Version
101
- version: '0'
165
+ version: 1.2.2
102
166
  type: :runtime
103
167
  prerelease: false
104
168
  version_requirements: !ruby/object:Gem::Requirement
@@ -106,7 +170,7 @@ dependencies:
106
170
  requirements:
107
171
  - - ! '>='
108
172
  - !ruby/object:Gem::Version
109
- version: '0'
173
+ version: 1.2.2
110
174
  - !ruby/object:Gem::Dependency
111
175
  name: mixlib-config
112
176
  requirement: !ruby/object:Gem::Requirement
@@ -140,45 +204,61 @@ dependencies:
140
204
  - !ruby/object:Gem::Version
141
205
  version: 1.3.0
142
206
  - !ruby/object:Gem::Dependency
143
- name: rspec
207
+ name: thin
144
208
  requirement: !ruby/object:Gem::Requirement
145
209
  none: false
146
210
  requirements:
147
211
  - - ~>
148
212
  - !ruby/object:Gem::Version
149
- version: 2.10.0
150
- type: :development
213
+ version: 1.4.1
214
+ type: :runtime
151
215
  prerelease: false
152
216
  version_requirements: !ruby/object:Gem::Requirement
153
217
  none: false
154
218
  requirements:
155
219
  - - ~>
156
220
  - !ruby/object:Gem::Version
157
- version: 2.10.0
221
+ version: 1.4.1
158
222
  - !ruby/object:Gem::Dependency
159
- name: fakefs
223
+ name: rack
160
224
  requirement: !ruby/object:Gem::Requirement
161
225
  none: false
162
226
  requirements:
163
227
  - - ~>
164
228
  - !ruby/object:Gem::Version
165
- version: 0.4.0
166
- type: :development
229
+ version: 1.4.1
230
+ type: :runtime
167
231
  prerelease: false
168
232
  version_requirements: !ruby/object:Gem::Requirement
169
233
  none: false
170
234
  requirements:
171
235
  - - ~>
172
236
  - !ruby/object:Gem::Version
173
- version: 0.4.0
237
+ version: 1.4.1
174
238
  - !ruby/object:Gem::Dependency
175
- name: yard
239
+ name: sinatra
176
240
  requirement: !ruby/object:Gem::Requirement
177
241
  none: false
178
242
  requirements:
179
243
  - - ~>
180
244
  - !ruby/object:Gem::Version
181
- version: '0.8'
245
+ version: 1.3.2
246
+ type: :runtime
247
+ prerelease: false
248
+ version_requirements: !ruby/object:Gem::Requirement
249
+ none: false
250
+ requirements:
251
+ - - ~>
252
+ - !ruby/object:Gem::Version
253
+ version: 1.3.2
254
+ - !ruby/object:Gem::Dependency
255
+ name: rspec
256
+ requirement: !ruby/object:Gem::Requirement
257
+ none: false
258
+ requirements:
259
+ - - ~>
260
+ - !ruby/object:Gem::Version
261
+ version: 2.10.0
182
262
  type: :development
183
263
  prerelease: false
184
264
  version_requirements: !ruby/object:Gem::Requirement
@@ -186,15 +266,15 @@ dependencies:
186
266
  requirements:
187
267
  - - ~>
188
268
  - !ruby/object:Gem::Version
189
- version: '0.8'
269
+ version: 2.10.0
190
270
  - !ruby/object:Gem::Dependency
191
- name: redcarpet
271
+ name: yard
192
272
  requirement: !ruby/object:Gem::Requirement
193
273
  none: false
194
274
  requirements:
195
275
  - - ~>
196
276
  - !ruby/object:Gem::Version
197
- version: 2.1.1
277
+ version: '0.8'
198
278
  type: :development
199
279
  prerelease: false
200
280
  version_requirements: !ruby/object:Gem::Requirement
@@ -202,15 +282,15 @@ dependencies:
202
282
  requirements:
203
283
  - - ~>
204
284
  - !ruby/object:Gem::Version
205
- version: 2.1.1
285
+ version: '0.8'
206
286
  - !ruby/object:Gem::Dependency
207
- name: rdoc
287
+ name: redcarpet
208
288
  requirement: !ruby/object:Gem::Requirement
209
289
  none: false
210
290
  requirements:
211
291
  - - ~>
212
292
  - !ruby/object:Gem::Version
213
- version: '3.12'
293
+ version: 2.1.1
214
294
  type: :development
215
295
  prerelease: false
216
296
  version_requirements: !ruby/object:Gem::Requirement
@@ -218,7 +298,7 @@ dependencies:
218
298
  requirements:
219
299
  - - ~>
220
300
  - !ruby/object:Gem::Version
221
- version: '3.12'
301
+ version: 2.1.1
222
302
  - !ruby/object:Gem::Dependency
223
303
  name: cucumber
224
304
  requirement: !ruby/object:Gem::Requirement
@@ -302,8 +382,7 @@ dependencies:
302
382
  description: An orchestrator to create entire chef environments
303
383
  email: joshtoft@gmail.com
304
384
  executables:
305
- - souffle-server
306
- - souffle-worker
385
+ - souffle
307
386
  extensions: []
308
387
  extra_rdoc_files:
309
388
  - LICENSE.txt
@@ -315,37 +394,53 @@ files:
315
394
  - LICENSE.txt
316
395
  - README.md
317
396
  - Rakefile
318
- - bin/souffle-server
319
- - bin/souffle-worker
397
+ - bin/souffle
320
398
  - features/souffle.feature
321
399
  - features/step_definitions/souffle_steps.rb
322
400
  - features/support/env.rb
323
401
  - lib/souffle.rb
324
402
  - lib/souffle/application.rb
325
403
  - lib/souffle/application/souffle-server.rb
326
- - lib/souffle/application/souffle-worker.rb
327
404
  - lib/souffle/config.rb
405
+ - lib/souffle/daemon.rb
328
406
  - lib/souffle/exceptions.rb
407
+ - lib/souffle/http.rb
329
408
  - lib/souffle/log.rb
330
409
  - lib/souffle/node.rb
331
410
  - lib/souffle/node/runlist.rb
332
411
  - lib/souffle/node/runlist_item.rb
333
412
  - lib/souffle/node/runlist_parser.rb
413
+ - lib/souffle/polling_event.rb
334
414
  - lib/souffle/provider.rb
335
415
  - lib/souffle/provider/aws.rb
336
416
  - lib/souffle/provider/vagrant.rb
337
- - lib/souffle/providers.rb
417
+ - lib/souffle/provisioner.rb
418
+ - lib/souffle/provisioner/node.rb
419
+ - lib/souffle/provisioner/system.rb
420
+ - lib/souffle/redis_client.rb
421
+ - lib/souffle/redis_mixin.rb
338
422
  - lib/souffle/server.rb
423
+ - lib/souffle/ssh_monkey.rb
424
+ - lib/souffle/state.rb
339
425
  - lib/souffle/system.rb
340
- - lib/souffle/worker.rb
426
+ - lib/souffle/template.rb
427
+ - lib/souffle/templates/Vagrantfile.erb
428
+ - lib/souffle/version.rb
341
429
  - spec/config/example.json
342
430
  - spec/config/example.rb
343
431
  - spec/config_spec.rb
432
+ - spec/log_spec.rb
433
+ - spec/node/runlist_parser_spec.rb
434
+ - spec/node/runlist_spec.rb
344
435
  - spec/node_spec.rb
345
- - spec/runlist_parser_spec.rb
346
- - spec/runlist_spec.rb
436
+ - spec/provider_spec.rb
437
+ - spec/providers/aws_provider_spec.rb
438
+ - spec/providers/vagrant_provider_spec.rb
439
+ - spec/provisioner_spec.rb
347
440
  - spec/spec_helper.rb
348
441
  - spec/system_spec.rb
442
+ - spec/template_spec.rb
443
+ - spec/templates/example_template.erb
349
444
  homepage: http://github.com/seryl/souffle
350
445
  licenses:
351
446
  - MIT
data/bin/souffle-worker DELETED
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env ruby
2
- $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
3
-
4
- require 'souffle'
5
- require 'souffle/application/souffle-worker'
6
-
7
- Souffle::Application::Worker.new.run
@@ -1,46 +0,0 @@
1
- require 'souffle/application'
2
- require 'souffle/worker'
3
-
4
- # The souffle worker command line parser.
5
- class Souffle::Application::Worker < Souffle::Application
6
-
7
- option :config_file,
8
- :short => "-c CONFIG",
9
- :long => "--config CONFIG",
10
- :default => "/etc/souffle/worker.rb",
11
- :description => "The configuration file to use"
12
-
13
- option :log_level,
14
- :short => "-l LEVEL",
15
- :long => "--log_level LEVEL",
16
- :description => "Set the log level (debug, info, warn, error, fatal)",
17
- :proc => lambda { |l| l.to_sym }
18
-
19
- option :log_location,
20
- :short => "-L LOGLOCATION",
21
- :long => "--logfile LOGLOCATION",
22
- :description => "Set the log file location, defaults to STDOUT",
23
- :proc => nil
24
-
25
- option :help,
26
- :short => "-h",
27
- :long => "--help",
28
- :description => "Show this message",
29
- :on => :tail,
30
- :boolean => true,
31
- :show_options => true,
32
- :exit => 0
33
-
34
- option :version,
35
- :short => "-v",
36
- :long => "--version",
37
- :description => "Show souffle version",
38
- :boolean => true,
39
- :proc => lambda { |v| puts "Souffle: #{::Souffle::VERSION}"},
40
- :exit => 0
41
-
42
- def initialize
43
- super
44
-
45
- end
46
- end
@@ -1,2 +0,0 @@
1
- require 'souffle/provider/aws'
2
- require 'souffle/provider/vagrant'
@@ -1,14 +0,0 @@
1
- module Souffle
2
- # The souffle worker daemon.
3
- class Worker
4
-
5
- # Creates a new souffle worker.
6
- def initialize
7
- end
8
-
9
- # Runs the worker.
10
- def run
11
- end
12
-
13
- end
14
- end