Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add --rails-debug option

  • Loading branch information...
commit 5559fd2ebe9cd731956ba1cf470efd97ecc5401a 1 parent 944b6c2
@rubys authored
View
11 README
@@ -16,25 +16,28 @@ Execution instructions:
This is a library which, among other things, will interpret ARGV. Here's
an example based on http://github.com/rubys/awdwr:
- ruby makedepot.rb [VERSION] [bundle] [restore] [RANGE]... [save]
+ ruby makedepot.rb [VERSION] [--bundle] [--restore] [RANGE]... [--save]
"VERSION" - specifies the Rails version to test. Examples:
edge
_2.2.2_
~/git
- "bundle" - bundle this version of rails with each Rails app generated.
+ "--bundle" - bundle this version of rails with each Rails app generated.
- if libraries are listed in the RUBYLIB environment variable, they
will be added as directories to the Gemfile before making the bundle
+ (adding '--system' will only bundle system gems)
- "restore" - restore from snapshot before resuming execution
+ "--restore" - restore from snapshot before resuming execution
"RANGE" - specifies a set of sections to execute. Examples:
6.2..6.5
7.1-9.5
16
- "save" - save snapshot after execution completes
+ "--save" - save snapshot after execution completes
+
+ "--rails-debug" - turn on BACKTRACE and Thread.abort_on_exception
Tests against the output produced (e.g., makedepot.html) can also be run
separately:
View
4 gorp.gemspec
@@ -2,11 +2,11 @@
Gem::Specification.new do |s|
s.name = %q{gorp}
- s.version = "0.21.1"
+ s.version = "0.21.2"
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
s.authors = ["Sam Ruby"]
- s.date = %q{2010-01-06}
+ s.date = %q{2010-01-08}
s.description = %q{ Enables the creation of scenarios that involve creating a rails project,
starting and stoppping of servers, generating projects, editing files,
issuing http requests, running of commands, etc. Output is captured as
View
4 lib/gorp/output.rb
@@ -31,7 +31,7 @@
end
# optionally save a snapshot
- if ARGV.include? 'restore'
+ if ARGV.include?('restore') or ARGV.include?('--restore')
log :snap, 'restore'
Dir.chdir $BASE
FileUtils.rm_rf $WORK
@@ -73,7 +73,7 @@
Gorp::Commands.stop_server
# optionally save a snapshot
- if ARGV.include? 'save'
+ if ARGV.include?('save') or ARGV.include? '--save'
log :snap, 'save'
Dir.chdir $BASE
FileUtils.rm_rf "snapshot"
View
17 lib/gorp/rails.rb
@@ -67,7 +67,7 @@
Process.exit!
end
-$bundle = ARGV.include? 'bundle'
+$bundle = ARGV.include?('bundle') or ARGV.include?('--bundle')
module Gorp
# determine which version of rails is running
@@ -107,12 +107,12 @@ def rails name, app=nil
Dir.chdir(name)
FileUtils.rm_rf 'public/.htaccess'
- cmd 'rake rails:freeze:edge' if ARGV.include? 'edge'
+ cmd 'rake rails:freeze:edge' if ARGV.include? '--edge'
if $rails != 'rails' and File.directory?($rails)
if File.exist? 'Gemfile'
if $bundle
- if ENV['RUBYLIB'] or ARGV.include?('system')
+ if ENV['RUBYLIB'] or ARGV.include?('--system')
gem=open('Gemfile') {|file| file.read}
gem.sub! /gem "rails", :path => "(.*)"/ do
@@ -122,7 +122,7 @@ def rails name, app=nil
eval(file.read.gsub(/\s*(module|end).*\n/, '').downcase)
end
- if ARGV.include?('system')
+ if ARGV.include?('--system')
rails = <<-EOF.gsub(/^\s+/,'') + rails
@environment.clear_sources
@environment.add_source SystemGemSource.instance
@@ -154,6 +154,15 @@ def rails name, app=nil
end
end
+ if ARGV.include?('--rails-debug')
+ edit 'config/initializers/rails_debug.rb' do |data|
+ data.all = <<-EOF.unindent(12)
+ ENV['BACKTRACE'] = '1'
+ Thread.abort_on_exception = true
+ EOF
+ end
+ end
+
$rails_app = name
end
View
2  lib/version.rb
@@ -2,7 +2,7 @@ module Gorp
module VERSION #:nodoc:
MAJOR = 0
MINOR = 21
- TINY = 1
+ TINY = 2
STRING = [MAJOR, MINOR, TINY].join('.')
end
Please sign in to comment.
Something went wrong with that request. Please try again.