fyi 1.0.10 → 1.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/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ .DS_Store
2
+ pkg/
3
+ Gemfile.lock
4
+
data/Gemfile ADDED
@@ -0,0 +1 @@
1
+ gemspec
data/Rakefile CHANGED
@@ -1,24 +1 @@
1
- $LOAD_PATH.unshift 'lib'
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
@@ -1,4 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ lib_dir = File.expand_path '../lib', __FILE__
4
+ $LOAD_PATH.unshift lib_dir unless $LOAD_PATH.include? lib_dir
5
+
3
6
  require 'fyi'
4
7
  Fyi.run ARGV.join(' ')
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: 25
16
+ port: 465
17
+ domain: yourdomain.com
17
18
  user_name: username
18
19
  password: password
19
- authentication: :login
20
- domain: yourdomain.com
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
- s.files = %w( README.md Rakefile fyi.gemspec config_example.yml )
16
- s.files += Dir.glob("bin/**/*")
17
- s.files += Dir.glob("lib/**/*")
18
- s.executables = %w( fyi )
19
- s.extra_rdoc_files = %w( README.md )
20
- s.add_dependency 'pony', ['>= 1.3']
21
- s.add_dependency 'systemu', ['>= 2.4.0']
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
@@ -1,9 +1,4 @@
1
- begin
2
- require 'systemu'
3
- rescue LoadError
4
- abort '** Please install systemu.'
5
- end
6
-
1
+ require 'systemu'
7
2
  require 'fyi/config'
8
3
  require 'fyi/core_ext'
9
4
 
@@ -1,8 +1,4 @@
1
- begin
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
- # +host+
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
- Pony.mail :to => @to,
52
- :from => @from,
53
- :subject => subject(command, result),
54
- :body => body(command, duration, output, error, host),
55
- :via => :smtp,
56
- :via_options => @smtp
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
@@ -1,3 +1,3 @@
1
1
  class Fyi
2
- VERSION = '1.0.10'
2
+ VERSION = '1.1.0'
3
3
  end
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
- hash: 3
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
- date: 2011-10-21 00:00:00 +02:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- name: pony
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
- requirement: &id001 !ruby/object:Gem::Requirement
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
- hash: 9
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
- requirement: &id002 !ruby/object:Gem::Requirement
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
- version_requirements: *id002
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
- extra_rdoc_files:
59
- - README.md
60
- files:
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
- hash: 3
87
- segments:
75
+ requirements:
76
+ - - ! '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ segments:
88
80
  - 0
89
- version: "0"
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
- hash: 3
96
- segments:
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ segments:
97
89
  - 0
98
- version: "0"
90
+ hash: 1551681380249218475
99
91
  requirements: []
100
-
101
92
  rubyforge_project:
102
- rubygems_version: 1.6.2
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
-