Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kirs committed Sep 29, 2012
0 parents commit 55a278f
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
Gemfile.lock
pkg
8 changes: 8 additions & 0 deletions Gemfile
@@ -0,0 +1,8 @@
source :rubygems

gemspec

group :development, :test do
gem 'rake'
gem 'rspec'
end
22 changes: 22 additions & 0 deletions LICENSE
@@ -0,0 +1,22 @@
Copyright (c) 2012 Kir Shatrov

MIT License

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17 changes: 17 additions & 0 deletions README.md
@@ -0,0 +1,17 @@
Capistrano + Notification Center
=========================

capistrano-nc integrates Capistrano and Mountain Lion's Notification Center.

![Screenshot](http://f.cl.ly/items/1k253H0o350m1F0L371j/Screen%20Shot%202012-09-29%20at%2012.57.34%20PM.png)

Installation
------------

Just put it in your Gemfile (`gem 'capistrano-nc'`) and

##Contributors

- [Kir Shatrov](https://github.com/kirs/) (Evrone)

##Feel free for pull requests!
8 changes: 8 additions & 0 deletions Rakefile
@@ -0,0 +1,8 @@
#!/usr/bin/env rake

require 'bundler/gem_tasks'
require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new(:spec)

task :default => :spec
17 changes: 17 additions & 0 deletions capistrano-nc.gemspec
@@ -0,0 +1,17 @@
# -*- encoding: utf-8 -*-
Gem::Specification.new do |gem|
gem.name = 'capistrano-nc'
gem.version = '0.0.1'
gem.authors = ['Kir Shatrov']
gem.email = ['shatrov@me.com']
gem.description = 'https://github.com/evrone/capistrano-nc'
gem.summary = "Capistrano integration with Mountain Lion's Notification Center"
gem.description = 'https://github.com/evrone/capistrano-nc'

gem.add_dependency 'terminal-notifier', '~> 1.4.2'

gem.files = `git ls-files`.split($\)
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
gem.test_files = gem.files.grep(%r{^(spec)/})
gem.require_paths = ['lib']
end
33 changes: 33 additions & 0 deletions lib/capistrano-nc.rb
@@ -0,0 +1,33 @@
require 'capistrano'
require 'terminal-notifier'

module CapistranoNc
module Capistrano
def self.load_into(configuration)
configuration.load do

after 'deploy', 'nc:finished'
after 'deploy:migrations', 'nc:finished'

namespace :nc do
task :finished do
announced_stage = fetch(:stage, 'production')

announcement = "\u2705 Successfully deployed "
announcement += if fetch(:branch, nil)
"#{application}'s #{branch} to #{announced_stage}"
else
"#{application} to #{announced_stage}"
end

TerminalNotifier.notify announcement, :title => "Capistrano"
end
end
end
end
end
end

if Capistrano::Configuration.instance
CapistranoNc::Capistrano.load_into(Capistrano::Configuration.instance)
end

0 comments on commit 55a278f

Please sign in to comment.