Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Require grit inside begin-rescue and fail gracefully with error message

  • Loading branch information...
commit 48b327580bae9e8347b06cf85021ab9ef61bfd01 1 parent 7de4430
Antti Pitkanen authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/flowdock/capistrano.rb
View
4 lib/flowdock/capistrano.rb
@@ -1,5 +1,4 @@
require 'flowdock'
-require 'grit'
require 'digest/md5'
require 'cgi'
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.