hookworm-handlers 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 30043deb101634d96e47f8dd8d585fa4069010ee
4
- data.tar.gz: 3796eaf4bb2ef71fb8e70d7a61d2e3729dc81e15
3
+ metadata.gz: 61221e9f79a523de8c5cfed29b84f5e095e3e693
4
+ data.tar.gz: 4ebd7d6558808ef526a4d65316c65f7905b0f782
5
5
  SHA512:
6
- metadata.gz: e5b15bb2c82297ef9748e8ee955af882fc0bb3eb0828e22dbd04efc006874208cba8d4a25354e8a98fcc2058cd556113cf0c80e3d43b03d7225af149e602f123
7
- data.tar.gz: 89c038c5988be0df4bcf43b5ea8f085e1ae13a2e16466b3054ce67a70db106f4ac8ee3a76f4ed9f2eb6d2267b1f0bf95e49e5ed869bb85d62d75d596882a98b6
6
+ metadata.gz: e8ab68e87cd5fdece07e421ddf63de839dc1ae0443df8fd3d966b2821cdf39c15085dc4dc862ae27e853806087442af32fa236d194824db861cc4b045c5fe85f
7
+ data.tar.gz: 6644ba27fe9bc3cb852aff3c6827b22b930781c755d4061930f3542142d0b1cb4361e48679ce55cd0f90dd014687c471c206007427fbcccc7825c01ff58b788d
@@ -1,6 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
- # vim:fileencoding=utf-8
3
2
  require 'hookworm-handlers'
4
- require 'English'
5
3
 
6
- exit Hookworm::Annotator.new.run!(ARGV) if $PROGRAM_NAME == __FILE__
4
+ exit Hookworm::Annotator.new.run!(ARGV)
@@ -1,6 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
- # vim:fileencoding=utf-8
3
2
  require 'hookworm-handlers'
4
- require 'English'
5
3
 
6
- exit Hookworm::BuildIndexHandler.new.run!(ARGV) if $PROGRAM_NAME == __FILE__
4
+ exit Hookworm::BuildIndexHandler.new.run!(ARGV)
@@ -1,6 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
- # vim:fileencoding=utf-8
3
- require 'English'
4
2
  require 'hookworm-handlers'
5
3
 
6
- exit Hookworm::LoggingHandler.new.run!(ARGV) if $PROGRAM_NAME == __FILE__
4
+ exit Hookworm::LoggingHandler.new.run!(ARGV)
@@ -1,6 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
- # vim:fileencoding=utf-8
3
- require 'English'
4
2
  require 'hookworm-handlers'
5
3
 
6
- exit Hookworm::RogueCommitHandler.new.run!(ARGV) if $PROGRAM_NAME == __FILE__
4
+ exit Hookworm::RogueCommitHandler.new.run!(ARGV)
@@ -1,4 +1,3 @@
1
- # vim:fileencoding=utf-8
2
1
  lib = File.expand_path('../lib', __FILE__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
  require 'hookworm/handlers/version'
@@ -1,5 +1,4 @@
1
- # vim:fileencoding=utf-8
2
-
1
+ require 'English'
3
2
  require 'json'
4
3
  require 'hookworm-base'
5
4
  require_relative 'github_payload_annotator'
@@ -47,3 +46,5 @@ module Hookworm
47
46
  end
48
47
  end
49
48
  end
49
+
50
+ exit Hookworm::Annotator.new.run!(ARGV) if $PROGRAM_NAME == __FILE__
@@ -1,5 +1,4 @@
1
- # vim:fileencoding=utf-8
2
-
1
+ require 'English'
3
2
  require 'erb'
4
3
  require 'fileutils'
5
4
  require 'json'
@@ -130,3 +129,5 @@ module Hookworm
130
129
  end
131
130
  end
132
131
  end
132
+
133
+ exit Hookworm::BuildIndexHandler.new.run!(ARGV) if $PROGRAM_NAME == __FILE__
@@ -1,5 +1,5 @@
1
1
  module Hookworm
2
2
  module Handlers
3
- VERSION = '0.1.1'
3
+ VERSION = '0.2.0'
4
4
  end
5
5
  end
@@ -1,5 +1,4 @@
1
- # vim:fileencoding=utf-8
2
-
1
+ require 'English'
3
2
  require 'json'
4
3
  require 'syslog'
5
4
 
@@ -53,3 +52,5 @@ module Hookworm
53
52
  end
54
53
  end
55
54
  end
55
+
56
+ exit Hookworm::LoggingHandler.new.run!(ARGV) if $PROGRAM_NAME == __FILE__
@@ -1,5 +1,4 @@
1
- # vim:fileencoding=utf-8
2
-
1
+ require 'English'
3
2
  require 'erb'
4
3
  require 'json'
5
4
  require 'net/smtp'
@@ -75,10 +74,11 @@ module Hookworm
75
74
  end
76
75
 
77
76
  class Judger
78
- attr_reader :cfg
77
+ attr_reader :cfg, :env
79
78
 
80
- def initialize(cfg)
79
+ def initialize(cfg, env = ENV)
81
80
  @cfg = cfg
81
+ @env = env
82
82
  end
83
83
 
84
84
  def judge_payload(payload)
@@ -181,7 +181,10 @@ module Hookworm
181
181
  end
182
182
 
183
183
  def emailer
184
- @emailer ||= Hookworm::Emailer.new(cfg[:worm_flags][:email_uri])
184
+ @emailer ||= Hookworm::Emailer.new(
185
+ env['HOOKWORM_EMAIL_URI'] || cfg[:worm_flags][:email_uri],
186
+ env['HOOKWORM_EMAIL_HELO'] || 'localhost'
187
+ )
185
188
  end
186
189
 
187
190
  def log_rogue_commit(payload)
@@ -238,3 +241,5 @@ module Hookworm
238
241
  end
239
242
  end
240
243
  end
244
+
245
+ exit Hookworm::RogueCommitHandler.new.run!(ARGV) if $PROGRAM_NAME == __FILE__
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hookworm-handlers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Buch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-31 00:00:00.000000000 Z
11
+ date: 2014-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler