Skip to content

Commit

Permalink
More cleanup - require rubygems outside of the codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksieger committed Oct 12, 2010
1 parent 82063df commit bfdf923
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
8 changes: 4 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ begin
RCov::VerifyTask.new(:rcov) do |t|
# Can't get threshold up to 100 unless RSpec backwards compatibility
# code is dropped
t.threshold = 98
t.threshold = 95
t.require_exact_threshold = false
end
rescue LoadError
Expand All @@ -85,9 +85,9 @@ task :generate_output do
rm_rf "acceptance/reports"
ENV['CI_REPORTS'] = "acceptance/reports"
begin
`ruby -Ilib -rci/reporter/rake/test_unit_loader acceptance/test_unit_example_test.rb` rescue puts "Warning: #{$!}"
`ruby -Ilib -S #{@spec_bin} --require ci/reporter/rake/rspec_loader --format CI::Reporter::RSpec acceptance/rspec_example_spec.rb` rescue puts "Warning: #{$!}"
`ruby -Ilib -rci/reporter/rake/cucumber_loader -S cucumber --format CI::Reporter::Cucumber acceptance/cucumber` rescue puts "Warning: #{$!}"
`ruby -Ilib -rubygems -rci/reporter/rake/test_unit_loader acceptance/test_unit_example_test.rb` rescue puts "Warning: #{$!}"
`ruby -Ilib -rubygems -S #{@spec_bin} --require ci/reporter/rake/rspec_loader --format CI::Reporter::RSpec acceptance/rspec_example_spec.rb` rescue puts "Warning: #{$!}"
`ruby -Ilib -rubygems -rci/reporter/rake/cucumber_loader -S cucumber --format CI::Reporter::Cucumber acceptance/cucumber` rescue puts "Warning: #{$!}"
ensure
ENV.delete 'CI_REPORTS'
end
Expand Down
9 changes: 1 addition & 8 deletions lib/ci/reporter/cucumber.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,10 @@
# software license details.

require 'ci/reporter/core'
tried_gem = false
require 'cucumber'
begin
require 'cucumber'
require 'cucumber/ast/visitor'
rescue LoadError
unless tried_gem
tried_gem = true
require 'rubygems'
gem 'cucumber'
retry
end
end

module CI
Expand Down
6 changes: 0 additions & 6 deletions lib/ci/reporter/test_suite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ def finish

# Creates the xml builder instance used to create the report xml document.
def create_builder
begin
require 'rubygems'
gem 'builder'
rescue LoadError
end

require 'builder'
# :escape_attrs is obsolete in a newer version, but should do no harm
Builder::XmlMarkup.new(:indent => 2, :escape_attrs => true)
Expand Down

0 comments on commit bfdf923

Please sign in to comment.