spigit_ops 0.0.3.beta → 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.
- checksums.yaml +8 -8
- data/.gitignore +1 -0
- data/lib/spigit_ops/utils.rb +62 -0
- data/lib/spigit_ops/version.rb +1 -1
- data/lib/spigit_ops.rb +1 -0
- metadata +6 -7
- data/test/server.xml +0 -5842
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZGJiOGE2OGRhZDhkZmU5YmRjYTk4OTEwZTQ1ZGVkYjQ4ODYzNjA5OA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjJjYWI2ZmMzYTQ1MzU5OWQ4NzU2NjE2MmMzNWY1NTg3NThmMzAwYQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YmEwYjMzMjUzMTA2OWM5MzAwOWEyOGVlMmUyYjM5NDBkMTY0OWUzN2JjZDIw
|
10
|
+
MGQ3MmQ1OWE5M2UxMDMwMjgwMjRhZGQ0OTcyZWJlMDgxNTY2ZjgzMTc4Zjlj
|
11
|
+
NTU0ZGU1OWMzYTcyODU1NTZjOWNlZmQ3NTA2YmU0OWEyNGY4YjM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OWMzODJkNGI1ZmJkMGNlYWJmNGQ0N2JkN2Y4ODY4ZjQxZmY3M2E3ZWVjODg4
|
14
|
+
MTY2ZDc3ZGMzZDcxYTA0OWU2ZTVlOTA3NzNiNjVmMzE2ZDA3NTljZGZiZjI2
|
15
|
+
MGU5NmZlNDhlNzgxYjQxNTY5YzcyNDgzM2QxOGMwOTU2MzE5N2I=
|
data/.gitignore
CHANGED
@@ -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
|
data/lib/spigit_ops/version.rb
CHANGED
data/lib/spigit_ops.rb
CHANGED
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.
|
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
|
+
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:
|
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: []
|