Changing Pry.config.history.load/save into should_load/should_save to work aroung ActiveSupport 3.1.rc2 hijacking "load"

Changing test_pry.rb to require 'helper' using absolute path, so we can run tests under 1.9.2+
This commit is contained in:
David Palm 2011-06-09 12:25:06 +02:00
parent 6d1f537c22
commit 34f85aa3a9
4 changed files with 7 additions and 7 deletions

View File

@ -75,9 +75,9 @@ class Pry
# sub-options include hist.file, hist.load, and hist.save # sub-options include hist.file, hist.load, and hist.save
# hist.file is the file to save/load history too, e.g # hist.file is the file to save/load history too, e.g
# Pry.config.history.file = "~/.pry_history". # Pry.config.history.file = "~/.pry_history".
# hist.load is a boolean that determines whether history will be # hist.should_load is a boolean that determines whether history will be
# loaded from hist.file at session start. # loaded from hist.file at session start.
# hist.save is a boolean that determines whether history will be # hist.should_save is a boolean that determines whether history will be
# saved to hist.file at session end. # saved to hist.file at session end.
# @return [OpenStruct] # @return [OpenStruct]
attr_accessor :history attr_accessor :history

View File

@ -97,7 +97,7 @@ class Pry
# multiple times per each new session (i.e in debugging) # multiple times per each new session (i.e in debugging)
load_rc if Pry.config.should_load_rc load_rc if Pry.config.should_load_rc
load_plugins if Pry.config.plugins.enabled load_plugins if Pry.config.plugins.enabled
load_history if Pry.config.history.instance_variable_get("@table")[:load] load_history if Pry.config.history.should_load #.instance_variable_get("@table")[:load]
@initial_session = false @initial_session = false
end end
@ -196,8 +196,8 @@ class Pry
config.plugins.strict_loading = true config.plugins.strict_loading = true
config.history ||= OpenStruct.new config.history ||= OpenStruct.new
config.history.save = true config.history.should_save = true
config.history.load = true config.history.should_load = true
config.history.file = File.expand_path("~/.pry_history") config.history.file = File.expand_path("~/.pry_history")
config.memory_size = 100 config.memory_size = 100

View File

@ -149,7 +149,7 @@ class Pry
throw :breakout, break_data throw :breakout, break_data
end end
save_history if Pry.config.history.save && finished_top_level_session? save_history if Pry.config.history.should_save && finished_top_level_session?
return_value return_value
end end

View File

@ -1,4 +1,4 @@
require 'helper' require File.dirname(File.expand_path(__FILE__)) + '/helper'
puts "Ruby Version #{RUBY_VERSION}" puts "Ruby Version #{RUBY_VERSION}"
puts "Testing Pry #{Pry::VERSION}" puts "Testing Pry #{Pry::VERSION}"