envoy 0.0.1 → 1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +6 -20
- data/README.markdown +91 -0
- data/envoy.gemspec +3 -2
- data/lib/envoy/messenger.rb +1 -1
- data/lib/envoy/transport.rb +64 -12
- data/lib/envoy/version.rb +1 -1
- data/spec/spec_helper.rb +45 -0
- data/spec/transport_spec.rb +23 -42
- metadata +34 -31
- data/README +0 -43
data/Gemfile.lock
CHANGED
@@ -1,32 +1,20 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
envoy (
|
4
|
+
envoy (1.0)
|
5
5
|
broach (= 0.2.1)
|
6
|
-
|
7
|
-
pony (= 1.1)
|
6
|
+
tmail (= 1.2.7.1)
|
8
7
|
|
9
8
|
GEM
|
10
9
|
remote: http://rubygems.org/
|
11
10
|
specs:
|
12
|
-
activesupport (3.0.3)
|
13
11
|
broach (0.2.1)
|
14
12
|
json (~> 1.4)
|
15
13
|
nap (~> 0.3)
|
16
14
|
diff-lcs (1.1.2)
|
17
15
|
fakeweb (1.3.0)
|
18
|
-
|
19
|
-
json (1.4.6)
|
20
|
-
mail (2.2.11)
|
21
|
-
activesupport (>= 2.3.6)
|
22
|
-
i18n (~> 0.5.0)
|
23
|
-
mime-types (~> 1.16)
|
24
|
-
treetop (~> 1.4.8)
|
25
|
-
mime-types (1.16)
|
16
|
+
json (1.5.1)
|
26
17
|
nap (0.4)
|
27
|
-
polyglot (0.3.1)
|
28
|
-
pony (1.1)
|
29
|
-
mail (> 2.0)
|
30
18
|
rspec (2.1.0)
|
31
19
|
rspec-core (~> 2.1.0)
|
32
20
|
rspec-expectations (~> 2.1.0)
|
@@ -35,16 +23,14 @@ GEM
|
|
35
23
|
rspec-expectations (2.1.0)
|
36
24
|
diff-lcs (~> 1.1.2)
|
37
25
|
rspec-mocks (2.1.0)
|
38
|
-
|
39
|
-
|
26
|
+
timecop (0.3.5)
|
27
|
+
tmail (1.2.7.1)
|
40
28
|
|
41
29
|
PLATFORMS
|
42
30
|
ruby
|
43
31
|
|
44
32
|
DEPENDENCIES
|
45
|
-
broach (= 0.2.1)
|
46
33
|
envoy!
|
47
34
|
fakeweb (= 1.3.0)
|
48
|
-
i18n (~> 0.5.0)
|
49
|
-
pony (= 1.1)
|
50
35
|
rspec (~> 2.1.0)
|
36
|
+
timecop (~> 0.3.5)
|
data/README.markdown
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
A simple, extendable messaging system designed for deployments
|
2
|
+
|
3
|
+
Usage
|
4
|
+
=====
|
5
|
+
gem install envoy (use sudo if not using RVM)
|
6
|
+
require 'envoy'
|
7
|
+
|
8
|
+
Create a new messenger
|
9
|
+
----------------------
|
10
|
+
messenger = Envoy::Messenger.new
|
11
|
+
|
12
|
+
Define some transports
|
13
|
+
----------------------
|
14
|
+
messenger.transports.each do |transport|
|
15
|
+
transport.add_transport(:campfire, :account => 'foo', :token => 'bar', :room => 'my_room')
|
16
|
+
end
|
17
|
+
|
18
|
+
OR
|
19
|
+
|
20
|
+
messenger.transport(:campfire, :account => 'foo', :token => 'bar', :room => 'my_room')
|
21
|
+
|
22
|
+
Add some messages
|
23
|
+
-----------------
|
24
|
+
messenger.messages.each do |message|
|
25
|
+
message.add_message(:name => 'Start deployment message', :subject => "Carlos started deployment of branch foo to production at #{Time.now}")
|
26
|
+
message.add_message(:name => 'End deployment message', :subject => "Carlos ended deployment of branch foo to production at #{Time.now}")
|
27
|
+
end
|
28
|
+
|
29
|
+
OR
|
30
|
+
|
31
|
+
messenger.message(:name => 'Start deployment message', :subject => "Carlos started deployment of branch foo to production at #{Time.now}")
|
32
|
+
|
33
|
+
Deliver messages one at a time
|
34
|
+
------------------------------
|
35
|
+
|
36
|
+
messenger.deliver_start_deployment_message
|
37
|
+
|
38
|
+
AND THEN
|
39
|
+
|
40
|
+
messenger.deliver_end_deployment_message
|
41
|
+
|
42
|
+
Deliver all messages
|
43
|
+
--------------------
|
44
|
+
|
45
|
+
messenger.deliver_all_messages
|
46
|
+
|
47
|
+
Email, Campfire, and Webhook Transports are included. Create your own by inheriting from Envoy::Transport
|
48
|
+
|
49
|
+
Sample Capistrano Usage
|
50
|
+
=======================
|
51
|
+
|
52
|
+
begin
|
53
|
+
require 'envoy'
|
54
|
+
set :envoy_loaded, true
|
55
|
+
rescue LoadError
|
56
|
+
set :envoy_loaded, false
|
57
|
+
end
|
58
|
+
|
59
|
+
if envoy_loaded
|
60
|
+
set :messenger, Envoy::Messenger.new
|
61
|
+
set :git_username, `git config user.name`.gsub("\n", '')
|
62
|
+
messenger.transport :name => :campfire, :account => [YOUR ACCOUNT HERE], :token => [YOUR TOKEN HERE], :use_ssl => true
|
63
|
+
else
|
64
|
+
set :messenger, nil
|
65
|
+
end
|
66
|
+
|
67
|
+
before :deploy do
|
68
|
+
if messenger
|
69
|
+
messenger.message :name => :start_deployment,
|
70
|
+
:subject => "#{git_username} started deployment of branch master to production for project Foo at #{Time.now}"
|
71
|
+
messenger.deliver_start_deployment
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
after :deploy do
|
76
|
+
if messenger
|
77
|
+
messenger.message :name => :end_deployment,
|
78
|
+
:subject => "#{git_username} ended deployment of branch master to production for project Foo at #{Time.now}"
|
79
|
+
messenger.deliver_end_deployment
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
Thanks
|
84
|
+
------
|
85
|
+
|
86
|
+
Thanks to [Robby Russell](http://robbyonrails.com) for beta testing
|
87
|
+
|
88
|
+
Copyright
|
89
|
+
---------
|
90
|
+
|
91
|
+
**Envoy** is Copyright (c) 2010 [Carlos Rodriguez](http://eddorre.com), released under the MIT License.
|
data/envoy.gemspec
CHANGED
@@ -20,9 +20,10 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.require_paths = ["lib"]
|
21
21
|
|
22
22
|
s.add_dependency "broach", "0.2.1"
|
23
|
-
s.add_dependency "
|
24
|
-
s.add_dependency "
|
23
|
+
s.add_dependency "tmail", "1.2.7.1"
|
24
|
+
s.add_dependency "tlsmail", "0.0.1" if RUBY_VERSION <= '1.8.6'
|
25
25
|
|
26
26
|
s.add_development_dependency "rspec", "~> 2.1.0"
|
27
27
|
s.add_development_dependency "fakeweb", "1.3.0"
|
28
|
+
s.add_development_dependency "timecop", "~> 0.3.5"
|
28
29
|
end
|
data/lib/envoy/messenger.rb
CHANGED
@@ -37,6 +37,7 @@ module Envoy
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
40
|
+
alias :deliver_all_messages :deliver_messages
|
40
41
|
|
41
42
|
def deliver_message(transport, message)
|
42
43
|
unless self._sent_messages.include?({ :transport => transport, :message => message })
|
@@ -55,7 +56,6 @@ module Envoy
|
|
55
56
|
end
|
56
57
|
|
57
58
|
def message(message_options = {})
|
58
|
-
message_options.symbolize_keys!
|
59
59
|
self._messages << Envoy::Message.new(message_options[:name], message_options[:subject],
|
60
60
|
message_options[:body], message_options[:options])
|
61
61
|
end
|
data/lib/envoy/transport.rb
CHANGED
@@ -1,8 +1,16 @@
|
|
1
|
+
if RUBY_VERSION <= '1.8.6'
|
2
|
+
begin
|
3
|
+
require 'tlsmail'
|
4
|
+
rescue LoadError
|
5
|
+
raise "You need to install tlsmail if you are using ruby <= 1.8.6"
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
1
9
|
require 'broach'
|
2
|
-
require 'pony'
|
3
|
-
require 'i18n'
|
4
10
|
require 'net/http'
|
5
11
|
require 'uri'
|
12
|
+
require 'net/smtp'
|
13
|
+
require 'tmail'
|
6
14
|
|
7
15
|
module Envoy
|
8
16
|
class Transport
|
@@ -82,30 +90,74 @@ module Envoy
|
|
82
90
|
end
|
83
91
|
|
84
92
|
class Email < Transport
|
85
|
-
attr_accessor :host, :username, :password, :sender, :to, :port, :ssl, :authentication
|
93
|
+
attr_accessor :host, :username, :password, :sender, :to, :port, :ssl, :authentication, :domain, :openssl_verify_mode
|
86
94
|
|
87
95
|
def initialize(options = {})
|
88
96
|
self.host = options[:host]
|
89
97
|
self.username = options[:username]
|
90
98
|
self.sender = options[:sender]
|
99
|
+
self.password = options[:password]
|
91
100
|
self.to = options[:to]
|
92
101
|
self.port = options[:port] || 25
|
93
102
|
self.ssl = options[:ssl] || false
|
94
103
|
self.authentication = options[:authentication] || nil
|
104
|
+
self.domain = options[:domain]
|
105
|
+
self.openssl_verify_mode = options[:openssl_verify_mode]
|
106
|
+
end
|
107
|
+
|
108
|
+
def sendmail_binary
|
109
|
+
sendmail = `which sendmail`.chomp
|
110
|
+
(sendmail.nil? || sendmail == '') ? '/usr/bin/sendmail' : sendmail
|
111
|
+
end
|
112
|
+
|
113
|
+
def build_mail(message)
|
114
|
+
mail = TMail::Mail.new
|
115
|
+
mail.to = @to.is_a?(String) ? @to : @to.join(',')
|
116
|
+
mail.from = @sender.nil? ? 'Envoy Messenger <envoymessenger@localhost>' : @sender
|
117
|
+
mail.subject = message.subject
|
118
|
+
mail.date = Time.now
|
119
|
+
mail.body = message.body || message.subject
|
120
|
+
|
121
|
+
mail
|
122
|
+
end
|
123
|
+
|
124
|
+
def build_connection
|
125
|
+
smtp = Net::SMTP.new(@host, @port)
|
126
|
+
|
127
|
+
if using_authentication?
|
128
|
+
@openssl_verify_mode.nil? ? smtp.send(tls_mode) : smtp.send(tls_mode, @openss_verify_mode)
|
129
|
+
end
|
130
|
+
|
131
|
+
return smtp
|
132
|
+
end
|
133
|
+
|
134
|
+
def tls_mode
|
135
|
+
RUBY_VERSION <= '1.8.6' ? "enable_tls" : "enable_starttls_auto"
|
136
|
+
end
|
137
|
+
|
138
|
+
def using_authentication?
|
139
|
+
!@username.nil? && !@password.nil? && !@authentication.nil? && @ssl
|
95
140
|
end
|
96
141
|
|
97
142
|
def send_message(message)
|
143
|
+
mail = self.build_mail(message)
|
144
|
+
|
98
145
|
if @host.to_sym == :sendmail
|
99
|
-
|
100
|
-
|
101
|
-
|
146
|
+
IO.popen("#{self.sendmail_binary} -f #{mail.from}, #{mail.to}", "w+") do |io|
|
147
|
+
io.puts mail
|
148
|
+
io.flush
|
149
|
+
end
|
102
150
|
else
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
151
|
+
smtp = build_connection
|
152
|
+
if using_authentication?
|
153
|
+
smtp.start(@domain, @username, @password, @authentication.to_sym) do |smtp|
|
154
|
+
smtp.sendmail mail.to_s, mail.from, mail.to
|
155
|
+
end
|
156
|
+
else
|
157
|
+
smtp.start do |smtp|
|
158
|
+
smtp.sendmail mail.to_s, mail.from, mail.to
|
159
|
+
end
|
160
|
+
end
|
109
161
|
end
|
110
162
|
|
111
163
|
return true
|
data/lib/envoy/version.rb
CHANGED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# Original mockup from ActionMailer - copied from Mail gem
|
2
|
+
|
3
|
+
class MockSMTP
|
4
|
+
def self.deliveries
|
5
|
+
@@deliveries
|
6
|
+
end
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@@deliveries = []
|
10
|
+
end
|
11
|
+
|
12
|
+
def sendmail(mail, from, to)
|
13
|
+
@@deliveries << [mail, from, to]
|
14
|
+
end
|
15
|
+
|
16
|
+
def start(*args)
|
17
|
+
yield self
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.clear_deliveries
|
21
|
+
@@deliveries = []
|
22
|
+
end
|
23
|
+
# in the standard lib: net/smtp.rb line 577
|
24
|
+
# a TypeError is thrown unless this arg is a
|
25
|
+
# kind of OpenSSL::SSL::SSLContext
|
26
|
+
def enable_tls(context = nil)
|
27
|
+
if context && context.kind_of?(OpenSSL::SSL::SSLContext)
|
28
|
+
true
|
29
|
+
elsif context
|
30
|
+
raise TypeError,
|
31
|
+
"wrong argument (#{context.class})! "+
|
32
|
+
"(Expected kind of OpenSSL::SSL::SSLContext)"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def enable_starttls_auto
|
37
|
+
true
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
class Net::SMTP
|
42
|
+
def self.new(*args)
|
43
|
+
MockSMTP.new
|
44
|
+
end
|
45
|
+
end
|
data/spec/transport_spec.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
require 'envoy'
|
2
2
|
require 'fakeweb'
|
3
|
+
require 'spec_helper'
|
4
|
+
require 'timecop'
|
3
5
|
include Envoy
|
4
6
|
|
5
7
|
describe Transport do
|
@@ -17,72 +19,51 @@ describe Transport do
|
|
17
19
|
|
18
20
|
describe "Email Transport" do
|
19
21
|
before(:each) do
|
20
|
-
@transport = Envoy::Email.new
|
21
|
-
@transport.to = 'carlos@eddorre.com'
|
22
|
+
@transport = Envoy::Email.new(:to => 'carlos@eddorre.com', :sender => 'carlos_sender@eddorre.com')
|
22
23
|
end
|
23
24
|
|
24
|
-
it "should send a message through
|
25
|
+
it "should send a message through sendmail binary" do
|
25
26
|
@transport.host = :sendmail
|
26
|
-
|
27
|
+
IO.should_receive(:popen).with("#{@transport.sendmail_binary} -f #{@transport.sender}, #{@transport.to}", "w+")
|
27
28
|
@transport.send_message(@message)
|
28
29
|
end
|
29
30
|
|
30
|
-
it "should send a message through
|
31
|
-
|
32
|
-
|
31
|
+
it "should send a message through SMTP" do
|
32
|
+
new_time = Time.local(2008, 9, 1, 12, 0, 0)
|
33
|
+
Timecop.freeze(new_time)
|
33
34
|
|
34
|
-
|
35
|
-
|
35
|
+
mail = TMail::Mail.new
|
36
|
+
mail.to = @transport.to
|
37
|
+
mail.from = @transport.sender
|
38
|
+
mail.subject = @message.subject
|
39
|
+
mail.date = Time.now
|
40
|
+
mail.body = @message.subject
|
36
41
|
|
37
|
-
|
38
|
-
end
|
42
|
+
TMail::Mail.stub!(:new).and_return(mail)
|
39
43
|
|
40
|
-
it "should send a message through pony using SMTP" do
|
41
44
|
@transport.host = 'mail.eddorre.com'
|
42
45
|
|
43
|
-
Pony.should_receive(:mail).with(:from => 'Envoy Messenger <envoymessenger@localhost>', :to => 'carlos@eddorre.com', :via => :smtp, :via_options => { :address => @transport.host,
|
44
|
-
:port => 25, :enable_starttls_auto => false, :user_name => nil, :password => nil, :authentication => nil,
|
45
|
-
:body => @message.subject, :subject => @message.subject })
|
46
|
-
|
47
46
|
@transport.send_message(@message)
|
48
|
-
end
|
49
|
-
|
50
|
-
it "should send a message through pony with multiple recipients" do
|
51
|
-
@transport.to = ['carlos@eddorre.com', 'hello@eddorre.com']
|
52
|
-
@transport.host = :sendmail
|
53
47
|
|
54
|
-
|
55
|
-
|
48
|
+
MockSMTP.deliveries[0][1].should == [@transport.sender]
|
49
|
+
MockSMTP.deliveries[0][2].should == [@transport.to]
|
50
|
+
MockSMTP.deliveries[0][0].should == mail.to_s
|
56
51
|
|
57
|
-
|
58
|
-
end
|
59
|
-
|
60
|
-
it "should send a message through pony with a set sender" do
|
61
|
-
@transport.host = :sendmail
|
62
|
-
@transport.sender = 'carlos@eddorre.com'
|
63
|
-
|
64
|
-
Pony.should_receive(:mail).with(:via => :sendmail, :from => 'carlos@eddorre.com',
|
65
|
-
:to => 'carlos@eddorre.com', :body => @message.subject, :subject => @message.subject)
|
66
|
-
|
67
|
-
@transport.send_message(@message)
|
52
|
+
Timecop.return
|
68
53
|
end
|
69
54
|
|
70
|
-
it "should return false when an exception is triggered
|
55
|
+
it "should return false when an exception is triggered" do
|
71
56
|
@transport.host = :sendmail
|
72
|
-
@transport.sender = 'carlos@eddorre.com'
|
73
|
-
@transport.to = 'carlos@eddorre.com'
|
74
57
|
|
75
|
-
|
58
|
+
IO.stub!(:popen).and_raise(ArgumentError)
|
76
59
|
|
77
60
|
@transport.send_message(@message).should == false
|
78
61
|
end
|
79
62
|
|
80
|
-
it "should return true when there is no exception triggered
|
63
|
+
it "should return true when there is no exception triggered" do
|
81
64
|
@transport.host = :sendmail
|
82
|
-
@transport.sender = 'carlos@eddorre.com'
|
83
|
-
@transport.to = 'carlos@eddorre.com'
|
84
65
|
|
85
|
-
|
66
|
+
IO.stub!(:popen).and_return
|
86
67
|
|
87
68
|
@transport.send_message(@message).should == true
|
88
69
|
end
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: envoy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 15
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
7
|
- 1
|
10
|
-
|
8
|
+
- 0
|
9
|
+
version: "1.0"
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Carlos Rodriguez
|
@@ -15,7 +14,7 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date:
|
17
|
+
date: 2011-04-02 00:00:00 -07:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
@@ -35,40 +34,26 @@ dependencies:
|
|
35
34
|
type: :runtime
|
36
35
|
version_requirements: *id001
|
37
36
|
- !ruby/object:Gem::Dependency
|
38
|
-
name:
|
37
|
+
name: tmail
|
39
38
|
prerelease: false
|
40
39
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - ~>
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
hash: 11
|
46
|
-
segments:
|
47
|
-
- 0
|
48
|
-
- 5
|
49
|
-
- 0
|
50
|
-
version: 0.5.0
|
51
|
-
type: :runtime
|
52
|
-
version_requirements: *id002
|
53
|
-
- !ruby/object:Gem::Dependency
|
54
|
-
name: pony
|
55
|
-
prerelease: false
|
56
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
57
40
|
none: false
|
58
41
|
requirements:
|
59
42
|
- - "="
|
60
43
|
- !ruby/object:Gem::Version
|
61
|
-
hash:
|
44
|
+
hash: 81
|
62
45
|
segments:
|
63
46
|
- 1
|
47
|
+
- 2
|
48
|
+
- 7
|
64
49
|
- 1
|
65
|
-
version:
|
50
|
+
version: 1.2.7.1
|
66
51
|
type: :runtime
|
67
|
-
version_requirements: *
|
52
|
+
version_requirements: *id002
|
68
53
|
- !ruby/object:Gem::Dependency
|
69
54
|
name: rspec
|
70
55
|
prerelease: false
|
71
|
-
requirement: &
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
72
57
|
none: false
|
73
58
|
requirements:
|
74
59
|
- - ~>
|
@@ -80,11 +65,11 @@ dependencies:
|
|
80
65
|
- 0
|
81
66
|
version: 2.1.0
|
82
67
|
type: :development
|
83
|
-
version_requirements: *
|
68
|
+
version_requirements: *id003
|
84
69
|
- !ruby/object:Gem::Dependency
|
85
70
|
name: fakeweb
|
86
71
|
prerelease: false
|
87
|
-
requirement: &
|
72
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
88
73
|
none: false
|
89
74
|
requirements:
|
90
75
|
- - "="
|
@@ -96,6 +81,22 @@ dependencies:
|
|
96
81
|
- 0
|
97
82
|
version: 1.3.0
|
98
83
|
type: :development
|
84
|
+
version_requirements: *id004
|
85
|
+
- !ruby/object:Gem::Dependency
|
86
|
+
name: timecop
|
87
|
+
prerelease: false
|
88
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
hash: 25
|
94
|
+
segments:
|
95
|
+
- 0
|
96
|
+
- 3
|
97
|
+
- 5
|
98
|
+
version: 0.3.5
|
99
|
+
type: :development
|
99
100
|
version_requirements: *id005
|
100
101
|
description: A simple, extendable messaging system built for deployments
|
101
102
|
email:
|
@@ -110,7 +111,7 @@ files:
|
|
110
111
|
- .gitignore
|
111
112
|
- Gemfile
|
112
113
|
- Gemfile.lock
|
113
|
-
- README
|
114
|
+
- README.markdown
|
114
115
|
- Rakefile
|
115
116
|
- envoy.gemspec
|
116
117
|
- lib/envoy.rb
|
@@ -119,6 +120,7 @@ files:
|
|
119
120
|
- lib/envoy/transport.rb
|
120
121
|
- lib/envoy/version.rb
|
121
122
|
- spec/messenger_spec.rb
|
123
|
+
- spec/spec_helper.rb
|
122
124
|
- spec/transport_spec.rb
|
123
125
|
has_rdoc: true
|
124
126
|
homepage: http://github.com/eddorre/envoy
|
@@ -150,10 +152,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
152
|
requirements: []
|
151
153
|
|
152
154
|
rubyforge_project: envoy
|
153
|
-
rubygems_version: 1.
|
155
|
+
rubygems_version: 1.6.2
|
154
156
|
signing_key:
|
155
157
|
specification_version: 3
|
156
158
|
summary: A simple, extendable messaging system built for deployments
|
157
159
|
test_files:
|
158
160
|
- spec/messenger_spec.rb
|
161
|
+
- spec/spec_helper.rb
|
159
162
|
- spec/transport_spec.rb
|
data/README
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
A simple, extendable messaging system
|
2
|
-
|
3
|
-
Usage
|
4
|
-
|
5
|
-
require 'envoy'
|
6
|
-
|
7
|
-
# Create a new messenger
|
8
|
-
messenger = Envoy::Messenger.new
|
9
|
-
|
10
|
-
# Define some transports
|
11
|
-
messenger.transports.each do |transport|
|
12
|
-
transport.add_transport(:campfire, :account => 'foo', :token => 'bar', :room => 'my_room')
|
13
|
-
end
|
14
|
-
|
15
|
-
OR
|
16
|
-
|
17
|
-
messenger.transport(:campfire, :account => 'foo', :token => 'bar', :room => 'my_room')
|
18
|
-
|
19
|
-
# Add some messages
|
20
|
-
messenger.messages.each do |message|
|
21
|
-
message.add_message(:name => 'Start deployment message', :subject => "Carlos started deployment of branch foo to production at #{Time.now}")
|
22
|
-
message.add_message(:name => 'End deployment message', :subject => "Carlos ended deployment of branch foo to production at #{Time.now}")
|
23
|
-
end
|
24
|
-
|
25
|
-
Email and Campfire Transports are included. Create your own by inheriting from Envoy::Transport
|
26
|
-
|
27
|
-
OR
|
28
|
-
|
29
|
-
messenger.message(:name => 'Start deployment message', :subject => "Carlos started deployment of branch foo to production at #{Time.now}")
|
30
|
-
|
31
|
-
# Deliver messages one at a time
|
32
|
-
|
33
|
-
messenger.deliver_start_deployment_message
|
34
|
-
|
35
|
-
AND THEN
|
36
|
-
|
37
|
-
messenger.deliver_end_deployment_message
|
38
|
-
|
39
|
-
OR
|
40
|
-
|
41
|
-
# Deliver all messages
|
42
|
-
|
43
|
-
messenger.deliver_all_messages
|