puppet-herald 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +15 -0
  2. data/.gitignore +22 -0
  3. data/.rspec +2 -0
  4. data/Gemfile +5 -0
  5. data/README.md +73 -0
  6. data/Rakefile +6 -0
  7. data/bin/puppet-herald +13 -0
  8. data/config.ru +2 -0
  9. data/db/migrate/20141211165540_create_nodes.rb +10 -0
  10. data/db/migrate/20141211171305_create_reports.rb +16 -0
  11. data/db/migrate/20141211171326_create_log_entries.rb +13 -0
  12. data/db/schema.rb +47 -0
  13. data/db/seeds.rb +0 -0
  14. data/lib/puppet-herald.rb +37 -0
  15. data/lib/puppet-herald/app.rb +112 -0
  16. data/lib/puppet-herald/cli.rb +53 -0
  17. data/lib/puppet-herald/database.rb +50 -0
  18. data/lib/puppet-herald/javascript.rb +34 -0
  19. data/lib/puppet-herald/models/log-entry.rb +3 -0
  20. data/lib/puppet-herald/models/node.rb +7 -0
  21. data/lib/puppet-herald/models/report.rb +78 -0
  22. data/lib/puppet-herald/public/.bowerrc +3 -0
  23. data/lib/puppet-herald/public/app.js +27 -0
  24. data/lib/puppet-herald/public/bower.json +15 -0
  25. data/lib/puppet-herald/public/components/artifact/artifact-directive.js +12 -0
  26. data/lib/puppet-herald/public/components/artifact/artifact-directive_test.js +17 -0
  27. data/lib/puppet-herald/public/components/artifact/artifact.js +31 -0
  28. data/lib/puppet-herald/public/components/directives/directives.js +5 -0
  29. data/lib/puppet-herald/public/components/directives/status-button.html +7 -0
  30. data/lib/puppet-herald/public/components/directives/status-button.js +54 -0
  31. data/lib/puppet-herald/public/components/filters/filters.js +12 -0
  32. data/lib/puppet-herald/public/css/herald.css +38 -0
  33. data/lib/puppet-herald/public/img/shield97.svg +17 -0
  34. data/lib/puppet-herald/public/node/node.html +30 -0
  35. data/lib/puppet-herald/public/node/node.js +24 -0
  36. data/lib/puppet-herald/public/nodes/nodes.html +29 -0
  37. data/lib/puppet-herald/public/nodes/nodes.js +24 -0
  38. data/lib/puppet-herald/public/report/report.html +24 -0
  39. data/lib/puppet-herald/public/report/report.js +24 -0
  40. data/lib/puppet-herald/stubs/puppet.rb +29 -0
  41. data/lib/puppet-herald/version.rb +20 -0
  42. data/lib/puppet-herald/views/app.erb +42 -0
  43. data/lib/puppet-herald/views/err500.erb +31 -0
  44. data/puppet-herald.gemspec +62 -0
  45. data/spec/model_helper.rb +2 -0
  46. data/spec/spec_helper.rb +37 -0
  47. data/spec/support/active_record.rb +17 -0
  48. data/spec/unit/fixtures/changed-notify.yaml +278 -0
  49. data/spec/unit/models/report_spec.rb +38 -0
  50. metadata +331 -0
@@ -0,0 +1,38 @@
1
+ require 'model_helper'
2
+ require 'puppet-herald/models/report'
3
+ require 'puppet-herald/models/log-entry'
4
+
5
+ describe Report, ".create_from_yaml" do
6
+ context 'for valid YAML' do
7
+ let(:yaml) { File.read(File.expand_path("../../fixtures/changed-notify.yaml", __FILE__)) }
8
+ it 'that is really not empty' do
9
+ yaml.should_not be_empty
10
+ end
11
+ context 'running on real sqlite3 db' do
12
+ subject { Report.create_from_yaml yaml }
13
+ it "should return value that isn't nil" do
14
+ subject.should_not be_nil
15
+ end
16
+ it "should return a report object" do
17
+ subject.class.should eq(Report)
18
+ end
19
+ it "should return persisted report" do
20
+ subject.persisted?.should be_truthy
21
+ end
22
+ it "should have status 'changed'" do
23
+ subject.status.should eq('changed')
24
+ end
25
+ it "should have 3 log entries, also persisted" do
26
+ subject.log_entries.size.should eq(3)
27
+ subject.log_entries.each do |log|
28
+ log.persisted?.should be_truthy
29
+ end
30
+ end
31
+ it "should have parent node, that is persistedand has status 'changed'" do
32
+ subject.node.should_not be_nil
33
+ subject.node.status.should eq('changed')
34
+ subject.node.persisted?.should be_truthy
35
+ end
36
+ end
37
+ end
38
+ end
metadata ADDED
@@ -0,0 +1,331 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: puppet-herald
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Krzysztof Suszynski
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-12-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
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: sinatra
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: sinatra-contrib
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: sinatra-activerecord
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
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: micro-optparse
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ! '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ! '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: uglifier
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ! '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
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: sqlite3
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ! '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: pg
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ! '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: puma
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ! '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ! '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rspec
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ! '>='
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ! '>='
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rspec-its
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ! '>='
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ! '>='
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: coveralls
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ! '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ! '>='
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: simplecov
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ! '>='
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ! '>='
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
195
+ - !ruby/object:Gem::Dependency
196
+ name: inch
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - ! '>='
200
+ - !ruby/object:Gem::Version
201
+ version: '0'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - ! '>='
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
209
+ - !ruby/object:Gem::Dependency
210
+ name: travis
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - ! '>='
214
+ - !ruby/object:Gem::Version
215
+ version: '0'
216
+ type: :development
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - ! '>='
221
+ - !ruby/object:Gem::Version
222
+ version: '0'
223
+ - !ruby/object:Gem::Dependency
224
+ name: travis-lint
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - ! '>='
228
+ - !ruby/object:Gem::Version
229
+ version: '0'
230
+ type: :development
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - ! '>='
235
+ - !ruby/object:Gem::Version
236
+ version: '0'
237
+ - !ruby/object:Gem::Dependency
238
+ name: pry-debugger
239
+ requirement: !ruby/object:Gem::Requirement
240
+ requirements:
241
+ - - ! '>='
242
+ - !ruby/object:Gem::Version
243
+ version: '0'
244
+ type: :development
245
+ prerelease: false
246
+ version_requirements: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - ! '>='
249
+ - !ruby/object:Gem::Version
250
+ version: '0'
251
+ description: Provides a gateway for consuming puppet reports, a REST API and a simple
252
+ Web app to display reports.
253
+ email: krzysztof.suszynski@wavesoftware.pl
254
+ executables:
255
+ - puppet-herald
256
+ extensions: []
257
+ extra_rdoc_files: []
258
+ files:
259
+ - .gitignore
260
+ - .rspec
261
+ - Gemfile
262
+ - README.md
263
+ - Rakefile
264
+ - bin/puppet-herald
265
+ - config.ru
266
+ - db/migrate/20141211165540_create_nodes.rb
267
+ - db/migrate/20141211171305_create_reports.rb
268
+ - db/migrate/20141211171326_create_log_entries.rb
269
+ - db/schema.rb
270
+ - db/seeds.rb
271
+ - lib/puppet-herald.rb
272
+ - lib/puppet-herald/app.rb
273
+ - lib/puppet-herald/cli.rb
274
+ - lib/puppet-herald/database.rb
275
+ - lib/puppet-herald/javascript.rb
276
+ - lib/puppet-herald/models/log-entry.rb
277
+ - lib/puppet-herald/models/node.rb
278
+ - lib/puppet-herald/models/report.rb
279
+ - lib/puppet-herald/public/.bowerrc
280
+ - lib/puppet-herald/public/app.js
281
+ - lib/puppet-herald/public/bower.json
282
+ - lib/puppet-herald/public/components/artifact/artifact-directive.js
283
+ - lib/puppet-herald/public/components/artifact/artifact-directive_test.js
284
+ - lib/puppet-herald/public/components/artifact/artifact.js
285
+ - lib/puppet-herald/public/components/directives/directives.js
286
+ - lib/puppet-herald/public/components/directives/status-button.html
287
+ - lib/puppet-herald/public/components/directives/status-button.js
288
+ - lib/puppet-herald/public/components/filters/filters.js
289
+ - lib/puppet-herald/public/css/herald.css
290
+ - lib/puppet-herald/public/img/shield97.svg
291
+ - lib/puppet-herald/public/node/node.html
292
+ - lib/puppet-herald/public/node/node.js
293
+ - lib/puppet-herald/public/nodes/nodes.html
294
+ - lib/puppet-herald/public/nodes/nodes.js
295
+ - lib/puppet-herald/public/report/report.html
296
+ - lib/puppet-herald/public/report/report.js
297
+ - lib/puppet-herald/stubs/puppet.rb
298
+ - lib/puppet-herald/version.rb
299
+ - lib/puppet-herald/views/app.erb
300
+ - lib/puppet-herald/views/err500.erb
301
+ - puppet-herald.gemspec
302
+ - spec/model_helper.rb
303
+ - spec/spec_helper.rb
304
+ - spec/support/active_record.rb
305
+ - spec/unit/fixtures/changed-notify.yaml
306
+ - spec/unit/models/report_spec.rb
307
+ homepage: https://github.com/wavesoftware/gem-puppet-herald
308
+ licenses:
309
+ - Apache 2.0
310
+ metadata: {}
311
+ post_install_message:
312
+ rdoc_options: []
313
+ require_paths:
314
+ - lib
315
+ required_ruby_version: !ruby/object:Gem::Requirement
316
+ requirements:
317
+ - - ! '>='
318
+ - !ruby/object:Gem::Version
319
+ version: 1.9.2
320
+ required_rubygems_version: !ruby/object:Gem::Requirement
321
+ requirements:
322
+ - - ! '>='
323
+ - !ruby/object:Gem::Version
324
+ version: '0'
325
+ requirements: []
326
+ rubyforge_project:
327
+ rubygems_version: 2.4.5
328
+ signing_key:
329
+ specification_version: 4
330
+ summary: a Puppet report processor
331
+ test_files: []