Skip to content

Commit

Permalink
Require grit inside begin-rescue and fail gracefully with error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Antti Pitkanen committed Feb 10, 2012
1 parent 7de4430 commit 48b3275
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/flowdock/capistrano.rb
@@ -1,5 +1,4 @@
require 'flowdock'
require 'grit'
require 'digest/md5'
require 'cgi'

Expand All @@ -22,8 +21,11 @@
task :set_flowdock_api do
set :rails_env, variables.include?(:stage) ? stage : ENV['RAILS_ENV']
begin
require 'grit'
set :repo, Grit::Repo.new(".")
config = Grit::Config.new(repo)
rescue LoadError
puts "Flowdock: you need to have Grit gem installed: #{e.to_s}"
rescue => e
puts "Flowdock: error in fetching your git repository information: #{e.to_s}"
end
Expand Down

0 comments on commit 48b3275

Please sign in to comment.