ingm-handler 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/crep_handler.rb +25 -0
- metadata +62 -0
data/lib/crep_handler.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'chef/handler/json_file'
|
2
|
+
require 'httparty'
|
3
|
+
require 'pp'
|
4
|
+
|
5
|
+
module INGMHandlers
|
6
|
+
class CrepHandler < JsonFile
|
7
|
+
|
8
|
+
def initialize(config={})
|
9
|
+
@config = config
|
10
|
+
raise ArgumentError, 'No server to report specified' unless @config[:server]
|
11
|
+
@config[:path] ||= '/var/chef/reports'
|
12
|
+
super @config
|
13
|
+
end
|
14
|
+
|
15
|
+
def report
|
16
|
+
super.report
|
17
|
+
f = Dir.glob(@config[:path]).sort_by { |f| File.ctime f }.last
|
18
|
+
opt = { :headers => { 'Content-Type' => 'application/json'},
|
19
|
+
:body => f
|
20
|
+
}
|
21
|
+
pp(HTTParty.post @config[:server], opt)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ingm-handler
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Luca Pandini
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-12-14 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: httparty
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.9.0
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.9.0
|
30
|
+
description: Contains ingm report handlers. With this release only the Chef report
|
31
|
+
handler crep_handler is present
|
32
|
+
email: luca1.pandini@gmail.com
|
33
|
+
executables: []
|
34
|
+
extensions: []
|
35
|
+
extra_rdoc_files: []
|
36
|
+
files:
|
37
|
+
- ./lib/crep_handler.rb
|
38
|
+
homepage:
|
39
|
+
licenses: []
|
40
|
+
post_install_message:
|
41
|
+
rdoc_options: []
|
42
|
+
require_paths:
|
43
|
+
- lib
|
44
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
45
|
+
none: false
|
46
|
+
requirements:
|
47
|
+
- - ! '>='
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 1.8.6
|
50
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
requirements: []
|
57
|
+
rubyforge_project:
|
58
|
+
rubygems_version: 1.8.24
|
59
|
+
signing_key:
|
60
|
+
specification_version: 3
|
61
|
+
summary: ingm handlers
|
62
|
+
test_files: []
|