sysdog 0.0.3 → 0.0.4

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/lib/sysdog.rb CHANGED
@@ -4,7 +4,6 @@ require "sysdog/version"
4
4
  require "sysdog/email"
5
5
  require "sysdog/http"
6
6
  require "sysdog/sysinfo"
7
- #require File.join(File.dirname(__FILE__), 'sysdog')
8
7
  module Sysdog
9
8
  # Your code goes here...
10
9
  class << self
@@ -18,7 +17,7 @@ module Sysdog
18
17
  mail.send(hostname + ' System load average to hight.',hostname + ":\n\rSystem load average to hight.")
19
18
  end
20
19
  else
21
- mail.send(hostname + "Can't open the site!",hostname + "\n\r" + 'Can\'t open the site!')
20
+ mail.send(hostname + "Can't open the site! ",hostname + "\n\r" + 'Can\'t open the site!')
22
21
  end
23
22
  end
24
23
  def report(hostname,mailto)
data/lib/sysdog/email.rb CHANGED
@@ -7,22 +7,23 @@ class Email
7
7
  @email = YAML.load_file(File.dirname(__FILE__) + "/../config.yml")
8
8
  end
9
9
  def send(title,content)
10
- Net::SMTP.start( @email['email']['server'],
11
- @email['email']['port'].to_s,
12
- @email['email']['server_alias'],
13
- @email['email']['address'],
14
- @email['email']['password'].to_s,
15
- @email['email']['auth_type'].to_sym) {|smtp|
16
- #@email['email']['password'].to_s,
17
- smtp.send_mail <<EndOfMail, "#{@email['email']['address']}", "#{@to}"
10
+ message = <<EndOfMail
18
11
  From: #{Sysdog.name} #{Sysdog::VERSION} <#{@email['email']['address']}>
19
12
  To: <#{@to}>
20
13
  Subject: #{title}
21
14
  Date: #{Time.new}
22
15
  Content-type: text/html
23
-
24
- <html><body>#{content}\n\r\t\t\tPower By #{Sysdog.name} #{Sysdog::VERSION}</body</html>
16
+ <html><body>#{content}\n\r\t\t\tPower By #{Sysdog.name} #{Sysdog::VERSION}</body></html>
25
17
  EndOfMail
26
- }
18
+ Net::SMTP.start( @email['email']['server'],
19
+ @email['email']['port'].to_s,
20
+ @email['email']['server_alias'],
21
+ @email['email']['address'],
22
+ @email['email']['password'].to_s,
23
+ @email['email']['auth_type'].to_sym) {|smtp|
24
+ smtp.send_mail message,
25
+ @email['email']['address'],
26
+ @to
27
+ }
27
28
  end
28
29
  end
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  module Sysdog
2
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
3
4
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sysdog
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - 23c
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-03-03 00:00:00 +08:00
19
- default_executable:
18
+ date: 2012-03-06 00:00:00 Z
20
19
  dependencies: []
21
20
 
22
21
  description: Watch website and system load avg.
@@ -29,7 +28,6 @@ extensions: []
29
28
  extra_rdoc_files: []
30
29
 
31
30
  files:
32
- - .gitignore
33
31
  - Gemfile
34
32
  - Rakefile
35
33
  - lib/config.yml
@@ -39,7 +37,6 @@ files:
39
37
  - lib/sysdog/sysinfo.rb
40
38
  - lib/sysdog/version.rb
41
39
  - sysdog.gemspec
42
- has_rdoc: true
43
40
  homepage: ""
44
41
  licenses: []
45
42
 
@@ -69,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
66
  requirements: []
70
67
 
71
68
  rubyforge_project: sysdog
72
- rubygems_version: 1.5.2
69
+ rubygems_version: 1.8.17
73
70
  signing_key:
74
71
  specification_version: 3
75
72
  summary: Linux system monitor
data/.gitignore DELETED
@@ -1,4 +0,0 @@
1
- *.gem
2
- .bundle
3
- Gemfile.lock
4
- pkg/*