crapapult 0.0.7 → 0.0.8
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/VERSION +1 -1
- data/lib/crapapult.rb +5 -9
- metadata +4 -4
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.0.
|
|
1
|
+
0.0.8
|
data/lib/crapapult.rb
CHANGED
|
@@ -155,26 +155,22 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
155
155
|
# Post a message to your Yammer network when you deploy.
|
|
156
156
|
def yammer(token, opts={})
|
|
157
157
|
opts = { :host => "www.yammer.com",
|
|
158
|
-
:body => %Q{The <%= current_branch %> branch of <%= application_name %> (<%= last_ref[0..5] %>) was just deployed to the <%= current_environment %> environment by @<%= `whoami
|
|
158
|
+
:body => %Q{The <%= current_branch %> branch of <%= application_name %> (<%= last_ref[0..5] %>) was just deployed to the <%= current_environment %> environment by @<%= `whoami`.strip %>.}
|
|
159
159
|
}.merge(opts)
|
|
160
160
|
|
|
161
161
|
after :deploy do
|
|
162
162
|
puts "> Sending notification to Yammer"
|
|
163
|
-
|
|
163
|
+
opts[:body] = Erubis::Eruby.new(opts[:body]).result(binding)
|
|
164
164
|
http = Net::HTTP.new(opts.delete(:host), 443)
|
|
165
165
|
http.use_ssl = true
|
|
166
|
-
|
|
167
|
-
opts[:body] = Erubis::Eruby.new(opts[:body]).result(binding)
|
|
168
|
-
opts[:access_token] = token
|
|
169
|
-
|
|
170
|
-
request = Net::HTTP::Post.new("/api/v1/messages.json")
|
|
166
|
+
request = Net::HTTP::Post.new("/api/v1/messages.json?access_token=#{token}")
|
|
171
167
|
request.set_form_data(opts)
|
|
172
168
|
|
|
173
169
|
response = http.request(request)
|
|
174
170
|
if response.is_a? Net::HTTPSuccess
|
|
175
|
-
puts "
|
|
171
|
+
puts ">> Sent!"
|
|
176
172
|
else
|
|
177
|
-
puts "
|
|
173
|
+
puts "!! Error sending notification: #{response.code} #{response.message}"
|
|
178
174
|
end
|
|
179
175
|
end
|
|
180
176
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: crapapult
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 15
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 0
|
|
9
|
-
-
|
|
10
|
-
version: 0.0.
|
|
9
|
+
- 8
|
|
10
|
+
version: 0.0.8
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Coda Hale
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2011-05-
|
|
18
|
+
date: 2011-05-13 00:00:00 -07:00
|
|
19
19
|
default_executable:
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|