fyi 1.0.10 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +1 -0
- data/Rakefile +1 -24
- data/bin/fyi +3 -0
- data/config_example.yml +5 -3
- data/fyi.gemspec +10 -8
- data/lib/fyi.rb +1 -6
- data/lib/fyi/notifiers/email.rb +19 -19
- data/lib/fyi/version.rb +1 -1
- metadata +56 -66
data/.gitignore
ADDED
data/Gemfile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
gemspec
|
data/Rakefile
CHANGED
@@ -1,24 +1 @@
|
|
1
|
-
|
2
|
-
require 'fyi/version'
|
3
|
-
|
4
|
-
desc 'Build the gem.'
|
5
|
-
task :build do
|
6
|
-
sh 'gem build fyi.gemspec'
|
7
|
-
end
|
8
|
-
|
9
|
-
desc 'Build and install the gem locally.'
|
10
|
-
task :install => :build do
|
11
|
-
sh "gem install fyi-#{Fyi::VERSION}.gem"
|
12
|
-
end
|
13
|
-
|
14
|
-
desc 'Tag the code and push tags to origin.'
|
15
|
-
task :tag do
|
16
|
-
sh "git tag v#{Fyi::VERSION}"
|
17
|
-
sh "git push origin master --tags"
|
18
|
-
end
|
19
|
-
|
20
|
-
desc 'Publish to rubygems.org.'
|
21
|
-
task :publish => [:build, :tag] do
|
22
|
-
sh "gem push fyi-#{Fyi::VERSION}.gem"
|
23
|
-
# sh "git clean -fd"
|
24
|
-
end
|
1
|
+
require 'bundler/gem_tasks'
|
data/bin/fyi
CHANGED
data/config_example.yml
CHANGED
@@ -13,8 +13,10 @@ email:
|
|
13
13
|
to: you@yourdomain.com
|
14
14
|
smtp:
|
15
15
|
address: smtp.yourserver.com
|
16
|
-
port:
|
16
|
+
port: 465
|
17
|
+
domain: yourdomain.com
|
17
18
|
user_name: username
|
18
19
|
password: password
|
19
|
-
authentication:
|
20
|
-
|
20
|
+
authentication: 'plain'
|
21
|
+
enable_starttls_auto: false
|
22
|
+
ssl: true
|
data/fyi.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
|
3
|
-
$LOAD_PATH.unshift 'lib'
|
3
|
+
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
|
4
4
|
require 'fyi/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
@@ -12,11 +12,13 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.homepage = 'http://github.com/airblade/fyi'
|
13
13
|
s.authors = ['Andy Stewart']
|
14
14
|
s.email = 'boss@airbladesoftware.com'
|
15
|
-
|
16
|
-
s.files
|
17
|
-
s.files
|
18
|
-
s.executables =
|
19
|
-
s.
|
20
|
-
|
21
|
-
s.
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = %w[ lib ]
|
20
|
+
|
21
|
+
s.add_development_dependency 'rake', '0.9.2.2'
|
22
|
+
s.add_dependency 'mail', '~> 2.4.4'
|
23
|
+
s.add_dependency 'systemu', '>= 2.4.0'
|
22
24
|
end
|
data/lib/fyi.rb
CHANGED
data/lib/fyi/notifiers/email.rb
CHANGED
@@ -1,8 +1,4 @@
|
|
1
|
-
|
2
|
-
require 'pony'
|
3
|
-
rescue LoadError
|
4
|
-
abort '** Please install pony.'
|
5
|
-
end
|
1
|
+
require 'mail'
|
6
2
|
|
7
3
|
class Fyi
|
8
4
|
class Notifier
|
@@ -21,20 +17,19 @@ class Fyi
|
|
21
17
|
# Optional. Defaults to true.
|
22
18
|
# +smtp+: you should supply SMTP config options under this key.
|
23
19
|
#
|
24
|
-
# SMTP config options are
|
25
|
-
#
|
26
|
-
# +port+
|
27
|
-
# +user+
|
28
|
-
# +password+
|
29
|
-
# +auth+
|
30
|
-
# +domain+
|
20
|
+
# SMTP config options are whatever Mail takes.
|
21
|
+
# https://github.com/mikel/mail/blob/master/lib/mail/network/delivery_methods/smtp.rb
|
31
22
|
def initialize options
|
32
23
|
@from = options['from']
|
33
24
|
@to = options['to']
|
34
|
-
@smtp = symbolize_keys options['smtp']
|
35
25
|
@on_success = options['on_success']
|
36
26
|
# Notify of failures by default.
|
37
27
|
@on_failure = options.has_key?('on_failure') ? options['on_failure'] : true
|
28
|
+
|
29
|
+
smtp = symbolize_keys(options['smtp'])
|
30
|
+
Mail.defaults do
|
31
|
+
delivery_method :smtp, smtp
|
32
|
+
end
|
38
33
|
end
|
39
34
|
|
40
35
|
def notify command, result, duration, output, error = '', host = ''
|
@@ -48,12 +43,17 @@ class Fyi
|
|
48
43
|
end
|
49
44
|
|
50
45
|
def send_email command, result, duration, output, error, host
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
46
|
+
_subject = subject(command, result)
|
47
|
+
_body = body(command, duration, output, error, host)
|
48
|
+
_to = @to
|
49
|
+
_from = @from
|
50
|
+
|
51
|
+
Mail.deliver do
|
52
|
+
to _to
|
53
|
+
from _from
|
54
|
+
subject _subject
|
55
|
+
body _body
|
56
|
+
end
|
57
57
|
end
|
58
58
|
|
59
59
|
def subject command, result
|
data/lib/fyi/version.rb
CHANGED
metadata
CHANGED
@@ -1,107 +1,97 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: fyi
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
- 10
|
10
|
-
version: 1.0.10
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Andy Stewart
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
12
|
+
date: 2012-06-25 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake
|
16
|
+
requirement: &2153492000 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - =
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.9.2.2
|
22
|
+
type: :development
|
23
23
|
prerelease: false
|
24
|
-
|
24
|
+
version_requirements: *2153492000
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: mail
|
27
|
+
requirement: &2153491460 !ruby/object:Gem::Requirement
|
25
28
|
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
segments:
|
31
|
-
- 1
|
32
|
-
- 3
|
33
|
-
version: "1.3"
|
29
|
+
requirements:
|
30
|
+
- - ~>
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 2.4.4
|
34
33
|
type: :runtime
|
35
|
-
version_requirements: *id001
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: systemu
|
38
34
|
prerelease: false
|
39
|
-
|
35
|
+
version_requirements: *2153491460
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: systemu
|
38
|
+
requirement: &2153490780 !ruby/object:Gem::Requirement
|
40
39
|
none: false
|
41
|
-
requirements:
|
42
|
-
- -
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
hash: 31
|
45
|
-
segments:
|
46
|
-
- 2
|
47
|
-
- 4
|
48
|
-
- 0
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
49
43
|
version: 2.4.0
|
50
44
|
type: :runtime
|
51
|
-
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *2153490780
|
52
47
|
description: Find out what cron is doing.
|
53
48
|
email: boss@airbladesoftware.com
|
54
|
-
executables:
|
49
|
+
executables:
|
55
50
|
- fyi
|
56
51
|
extensions: []
|
57
|
-
|
58
|
-
|
59
|
-
-
|
60
|
-
|
52
|
+
extra_rdoc_files: []
|
53
|
+
files:
|
54
|
+
- .gitignore
|
55
|
+
- Gemfile
|
61
56
|
- README.md
|
62
57
|
- Rakefile
|
63
|
-
- fyi.gemspec
|
64
|
-
- config_example.yml
|
65
58
|
- bin/fyi
|
59
|
+
- config_example.yml
|
60
|
+
- fyi.gemspec
|
61
|
+
- lib/fyi.rb
|
66
62
|
- lib/fyi/config.rb
|
67
63
|
- lib/fyi/core_ext.rb
|
68
64
|
- lib/fyi/notifiers/email.rb
|
69
65
|
- lib/fyi/notifiers/log.rb
|
70
66
|
- lib/fyi/version.rb
|
71
|
-
- lib/fyi.rb
|
72
|
-
has_rdoc: true
|
73
67
|
homepage: http://github.com/airblade/fyi
|
74
68
|
licenses: []
|
75
|
-
|
76
69
|
post_install_message:
|
77
70
|
rdoc_options: []
|
78
|
-
|
79
|
-
require_paths:
|
71
|
+
require_paths:
|
80
72
|
- lib
|
81
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
73
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
82
74
|
none: false
|
83
|
-
requirements:
|
84
|
-
- -
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
|
87
|
-
segments:
|
75
|
+
requirements:
|
76
|
+
- - ! '>='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
79
|
+
segments:
|
88
80
|
- 0
|
89
|
-
|
90
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
|
+
hash: 1551681380249218475
|
82
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
83
|
none: false
|
92
|
-
requirements:
|
93
|
-
- -
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
|
96
|
-
segments:
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
segments:
|
97
89
|
- 0
|
98
|
-
|
90
|
+
hash: 1551681380249218475
|
99
91
|
requirements: []
|
100
|
-
|
101
92
|
rubyforge_project:
|
102
|
-
rubygems_version: 1.
|
93
|
+
rubygems_version: 1.8.11
|
103
94
|
signing_key:
|
104
95
|
specification_version: 3
|
105
96
|
summary: Find out what cron is doing.
|
106
97
|
test_files: []
|
107
|
-
|