sr-scripts 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
data/bin/sr-send-email ADDED
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require 'fog'
5
+ require 'optparse'
6
+
7
+ options = {}
8
+
9
+ optparse = OptionParser.new do|opts|
10
+ opts.on( '-f FROM', 'From Email Address') do |o|
11
+ options[:from] = o
12
+ end
13
+ opts.on( '-t TO', 'To Email Address') do |o|
14
+ options[:to] = o
15
+ end
16
+ opts.on( '-s SUBJECT', 'Email Subject') do |o|
17
+ options[:subject] = o
18
+ end
19
+ opts.on( '-h', '--help', 'Display this screen' ) do
20
+ puts opts
21
+ exit
22
+ end
23
+ end
24
+
25
+ optparse.parse!
26
+
27
+ ses = Fog::AWS::SES.new()
28
+
29
+ destination = {}
30
+ destination['ToAddresses'] = [options[:to]]
31
+
32
+ message = {}
33
+ message['Body'] = {}
34
+ message['Body']['Text'] = {}
35
+ message['Body']['Text']['Data'] = ARGF.read
36
+ message['Subject'] = {}
37
+ message['Subject']['Data'] = options[:subject]
38
+
39
+ ses.send_email options[:from], destination, message
@@ -1,5 +1,5 @@
1
1
  module Sr
2
2
  module Scripts
3
- VERSION = "0.0.9"
3
+ VERSION = "0.0.10"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sr-scripts
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 9
10
- version: 0.0.9
9
+ - 10
10
+ version: 0.0.10
11
11
  platform: ruby
12
12
  authors:
13
13
  - Davy Campano
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-28 00:00:00 -05:00
18
+ date: 2011-03-15 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -25,6 +25,7 @@ email:
25
25
  executables:
26
26
  - sr-backup-mysql
27
27
  - sr-ec2-consistent-snapshot
28
+ - sr-send-email
28
29
  - sr-start-slave
29
30
  - sr-update-dns
30
31
  - sr-update-hosts-file
@@ -38,6 +39,7 @@ files:
38
39
  - Rakefile
39
40
  - bin/sr-backup-mysql
40
41
  - bin/sr-ec2-consistent-snapshot
42
+ - bin/sr-send-email
41
43
  - bin/sr-start-slave
42
44
  - bin/sr-update-dns
43
45
  - bin/sr-update-hosts-file