Skip to content

Commit

Permalink
rake task prepends 'bundle exec' if there is a Gemfile
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Jun 21, 2010
1 parent ad2af76 commit cb792f3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/rspec/core/rake_task.rb
Expand Up @@ -102,6 +102,7 @@ def files_to_run # :nodoc:
def rcov_command(cmd_parts)
cmd_parts.unshift runner_options
cmd_parts.unshift runner
cmd_parts.unshift bundler
cmd_parts += files_to_run.map { |fn| %["#{fn}"] }
cmd_parts.join(" ")
end
Expand All @@ -114,6 +115,9 @@ def runner_options
rcov ? [rcov_opts] : [ruby_opts]
end

def bundler
File.exist?("./Gemfile") ? "bundle exec " : ""
end
end

end
Expand Down

0 comments on commit cb792f3

Please sign in to comment.