spigit_ops 0.0.3.beta → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OTk5MjIwZTdmMGNkZDE2Y2U4MTBiY2UzY2ExNmRkYjE5OGRhMGJkNQ==
4
+ ZGJiOGE2OGRhZDhkZmU5YmRjYTk4OTEwZTQ1ZGVkYjQ4ODYzNjA5OA==
5
5
  data.tar.gz: !binary |-
6
- ODY4MWMzZGNlZjhhYTA5NjhkM2MxNjgwNzE1M2RhMjc4M2FiZDc2MQ==
6
+ NjJjYWI2ZmMzYTQ1MzU5OWQ4NzU2NjE2MmMzNWY1NTg3NThmMzAwYQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NWZjNGRmMGRhMGE0ZWMwMWFlNGQ2N2U5NjlhMjc0ZjFmNmYwMjUzZDEyZWI5
10
- ODYwYzFhMGUyNDJiOWZlNmY1Mjg2MGQ5ZDIyMDE5ZjEyNGYzZTNlMGViYjE0
11
- NWQxMjc0ZmE1YTIxZmRlM2ZkYTBhODhkZjE5ZDMwZTU0MjJiNzA=
9
+ YmEwYjMzMjUzMTA2OWM5MzAwOWEyOGVlMmUyYjM5NDBkMTY0OWUzN2JjZDIw
10
+ MGQ3MmQ1OWE5M2UxMDMwMjgwMjRhZGQ0OTcyZWJlMDgxNTY2ZjgzMTc4Zjlj
11
+ NTU0ZGU1OWMzYTcyODU1NTZjOWNlZmQ3NTA2YmU0OWEyNGY4YjM=
12
12
  data.tar.gz: !binary |-
13
- NjMyM2Q1ODllZTM4YWU5NDYwNDgzM2Q0NGFhNTU0OTVkYjVhNGJlZjJmZjdh
14
- ZjI1NDg5YzZhMzc3OWFiMWFjYzE2NmVhN2RmMDliYzFmNmJjYmZhNjM5ZmJk
15
- YmYxYmFlMWVjYzFkOGNiNzFlZGY0YmFlMTIyMWM5M2M3NmFmNzA=
13
+ OWMzODJkNGI1ZmJkMGNlYWJmNGQ0N2JkN2Y4ODY4ZjQxZmY3M2E3ZWVjODg4
14
+ MTY2ZDc3ZGMzZDcxYTA0OWU2ZTVlOTA3NzNiNjVmMzE2ZDA3NTljZGZiZjI2
15
+ MGU5NmZlNDhlNzgxYjQxNTY5YzcyNDgzM2QxOGMwOTU2MzE5N2I=
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ *.xml
@@ -0,0 +1,62 @@
1
+ require 'net/smtp'
2
+
3
+ module SpigitOps
4
+ class Utils
5
+
6
+ def self.win_to_unix(time)
7
+ begin
8
+ time.to_i if String === time
9
+ windows_time = time
10
+ unix_time = windows_time / 10000000 - 11644473600
11
+
12
+ unix_time
13
+ rescue Exception => e
14
+ puts "error: #{e.message}"
15
+ end
16
+ end
17
+
18
+ def self.unix_to_win(time)
19
+ begin
20
+ time.to_i if String === time
21
+ unix_time = time
22
+ windows_time = (unix_time + 11644473600) * 10000000
23
+
24
+ windows_time
25
+ rescue Exception => e
26
+ puts "error: #{e.message}"
27
+ end
28
+ end
29
+
30
+ def self.send_email(options = {})
31
+ # type lookup
32
+ type = { text: "text/plain", html: "text/html" }
33
+
34
+ host = options[:host] ? options[:host] : "localhost"
35
+
36
+ from = options[:from] ? options[:from] : "operations-team@spigit.com"
37
+ to = options[:to] ? options[:to] : "operations-team@spigit.com"
38
+ subject = options[:subject] ? options[:subject] : raise("Must declare a subject for email")
39
+ message = options[:message] ? options[:message] : raise("Must declare a message for email")
40
+ format = options[:format] ? options[:format] : "text"
41
+
42
+ content_type = type.has_key?(format.to_sym) ? type[format.to_sym] : type["text"]
43
+
44
+
45
+ message = <<MESSAGE_END
46
+ From: #{from}
47
+ To: #{to}
48
+ Subject: #{subject}
49
+ Mime-Version: 1.0
50
+ Content-Type: #{content_type}
51
+ Content-Disposition: inline
52
+
53
+ #{message}
54
+ MESSAGE_END
55
+
56
+ Net::SMTP.start(host, 25) do |smtp|
57
+ smtp.send_message message, from, to
58
+ end
59
+ end
60
+
61
+ end
62
+ end
@@ -1,3 +1,3 @@
1
1
  module SpigitOps
2
- VERSION = "0.0.3.beta"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/spigit_ops.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require "spigit_ops/version"
2
2
  require "spigit_ops/tomcat"
3
3
  require "spigit_ops/spigit_conf"
4
+ require "spigit_ops/utils"
4
5
 
5
6
  module SpigitOps
6
7
  TCS_START = 0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spigit_ops
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3.beta
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Barnett
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-12 00:00:00.000000000 Z
12
+ date: 2013-06-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -70,9 +70,9 @@ files:
70
70
  - lib/spigit_ops.rb
71
71
  - lib/spigit_ops/spigit_conf.rb
72
72
  - lib/spigit_ops/tomcat.rb
73
+ - lib/spigit_ops/utils.rb
73
74
  - lib/spigit_ops/version.rb
74
75
  - spigit_ops.gemspec
75
- - test/server.xml
76
76
  homepage: http://www.spigit.com/
77
77
  licenses:
78
78
  - MIT
@@ -88,14 +88,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
88
88
  version: '0'
89
89
  required_rubygems_version: !ruby/object:Gem::Requirement
90
90
  requirements:
91
- - - ! '>'
91
+ - - ! '>='
92
92
  - !ruby/object:Gem::Version
93
- version: 1.3.1
93
+ version: '0'
94
94
  requirements: []
95
95
  rubyforge_project:
96
96
  rubygems_version: 2.0.3
97
97
  signing_key:
98
98
  specification_version: 4
99
99
  summary: Want to manage Spigit? Grab this gem.
100
- test_files:
101
- - test/server.xml
100
+ test_files: []