lib/cap_mailer.rb in pboling-capistrano_mailer-3.0.2 vs lib/cap_mailer.rb in pboling-capistrano_mailer-3.1.0
- old
+ new
@@ -38,10 +38,10 @@
def body_data_hash(cap_vars, release_data = {}, extra_information = {}, data = {})
date = Date.today.to_s
time = Time.now.strftime("%I:%M %p").to_s
inferred_command = "cap #{cap_vars.first[:rails_env]} #{cap_vars.first[:task_name]}"
repo = cap_vars.first[:repository]
- x = repo.rindex('/') - 1
+ x = (repo.include?('/')) ? repo.rindex('/') - 1 : repo
front = repo.slice(0..x)
back = repo.sub(front, '')
unless back == 'trunk'
x = front.rindex('/') - 1
front = front.slice(0..x)