markbates-hoptoad_notifier 1.2.0 → 1.2.0.1
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/MIT-LICENSE +22 -0
- data/install.rb +1 -0
- data/lib/hoptoad_tasks.rb +26 -0
- data/recipes/hoptoad.rb +21 -0
- metadata +5 -1
data/MIT-LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2007, Tammer Saleh, Thoughtbot, Inc.
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person
|
4
|
+
obtaining a copy of this software and associated documentation
|
5
|
+
files (the "Software"), to deal in the Software without
|
6
|
+
restriction, including without limitation the rights to use,
|
7
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the
|
9
|
+
Software is furnished to do so, subject to the following
|
10
|
+
conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be
|
13
|
+
included in all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
17
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
19
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
20
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
21
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
data/install.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
puts IO.read(File.join(File.dirname(__FILE__), 'INSTALL'))
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
require 'uri'
|
3
|
+
require 'active_support'
|
4
|
+
|
5
|
+
module HoptoadTasks
|
6
|
+
def self.deploy(opts = {})
|
7
|
+
if HoptoadNotifier.api_key.blank?
|
8
|
+
puts "I don't seem to be configured with an API key. Please check your configuration."
|
9
|
+
return false
|
10
|
+
end
|
11
|
+
|
12
|
+
if opts[:rails_env].blank?
|
13
|
+
puts "I don't know to which Rails environment you are deploying (use the TO=production option)."
|
14
|
+
return false
|
15
|
+
end
|
16
|
+
|
17
|
+
params = {:api_key => HoptoadNotifier.api_key}
|
18
|
+
opts.each {|k,v| params["deploy[#{k}]"] = v }
|
19
|
+
|
20
|
+
url = URI.parse("http://#{HoptoadNotifier.host}/deploys.txt")
|
21
|
+
response = Net::HTTP.post_form(url, params)
|
22
|
+
puts response.body
|
23
|
+
return Net::HTTPSuccess === response
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
data/recipes/hoptoad.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# When Hoptoad is installed as a plugin this is loaded automatically.
|
2
|
+
#
|
3
|
+
# When Hoptoad installed as a gem, you need to add
|
4
|
+
# require 'hoptoad_notifier/recipes/hoptoad'
|
5
|
+
# to your deploy.rb
|
6
|
+
#
|
7
|
+
# Defines deploy:notify_hoptoad which will send information about the deploy to Hoptoad.
|
8
|
+
#
|
9
|
+
after "deploy:cleanup", "deploy:notify_hoptoad"
|
10
|
+
|
11
|
+
namespace :deploy do
|
12
|
+
desc "Notify Hoptoad of the deployment"
|
13
|
+
task :notify_hoptoad do
|
14
|
+
rails_env = fetch(:rails_env, "production")
|
15
|
+
local_user = ENV['USER'] || ENV['USERNAME']
|
16
|
+
notify_command = "rake hoptoad:deploy TO=#{rails_env} REVISION=#{current_revision} REPO=#{repository} USER=#{local_user}"
|
17
|
+
puts "Notifying Hoptoad of Deploy (#{notify_command})"
|
18
|
+
`#{notify_command}`
|
19
|
+
puts "Hoptoad Notification Complete."
|
20
|
+
end
|
21
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: markbates-hoptoad_notifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.0
|
4
|
+
version: 1.2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thoughtbot
|
@@ -23,9 +23,13 @@ extra_rdoc_files: []
|
|
23
23
|
|
24
24
|
files:
|
25
25
|
- INSTALL
|
26
|
+
- install.rb
|
26
27
|
- lib/hoptoad_notifier.rb
|
28
|
+
- lib/hoptoad_tasks.rb
|
29
|
+
- MIT-LICENSE
|
27
30
|
- Rakefile
|
28
31
|
- README
|
32
|
+
- recipes/hoptoad.rb
|
29
33
|
- tasks/hoptoad_notifier_tasks.rake
|
30
34
|
has_rdoc: true
|
31
35
|
homepage: http://github.com/thoughtbot/hoptoad_notifier
|