ingm-handler 0.2.0 → 0.2.1

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.
@@ -0,0 +1,26 @@
1
+ module INGM
2
+ module Handler
3
+ class Crep < Chef::Handler::JsonFile
4
+
5
+ def initialize(config={})
6
+ @config = config
7
+ raise ArgumentError, 'No server to report specified' unless @config[:server]
8
+ @config[:path] ||= '/var/chef/reports'
9
+ super @config
10
+ end
11
+
12
+ def report
13
+ super.report
14
+ f = Dir.glob(@config[:path]).sort_by { |f| File.ctime f }.last
15
+ opt = { :headers => { 'Content-Type' => 'application/json'},
16
+ :body => f
17
+ }
18
+ HTTParty.post @config[:server], opt
19
+ end
20
+
21
+ def to_s
22
+ "path => #{@config[:path]}\nserver => #{@config[:server]}"
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,6 @@
1
+ require 'chef/handler/json_file'
2
+ require 'httparty'
3
+ require 'ingm/handler/crep'
4
+
5
+
6
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ingm-handler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -27,13 +27,31 @@ dependencies:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: 0.9.0
30
+ - !ruby/object:Gem::Dependency
31
+ name: chef
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: 10.16.2
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 10.16.2
30
46
  description: Contains ingm report handlers. With this release only the Chef report
31
47
  handler crep_handler is present
32
48
  email: luca1.pandini@gmail.com
33
49
  executables: []
34
50
  extensions: []
35
51
  extra_rdoc_files: []
36
- files: []
52
+ files:
53
+ - ./lib/ingm/handler/crep.rb
54
+ - ./lib/ingm_handler.rb
37
55
  homepage:
38
56
  licenses: []
39
57
  post_install_message: