ingm-handler 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. metadata +2 -3
  2. data/lib/crep_handler.rb +0 -25
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.1.0
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -33,8 +33,7 @@ email: luca1.pandini@gmail.com
33
33
  executables: []
34
34
  extensions: []
35
35
  extra_rdoc_files: []
36
- files:
37
- - ./lib/crep_handler.rb
36
+ files: []
38
37
  homepage:
39
38
  licenses: []
40
39
  post_install_message:
data/lib/crep_handler.rb DELETED
@@ -1,25 +0,0 @@
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