pry 0.9.11.3-i386-mswin32 → 0.9.11.4-i386-mswin32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ 20/01/2012 version 0.9.11.4
2
+ * fixed pager bug (wouldn't render color codes in some circumstances)
3
+ * added Pry.last_internal_error, useful for devs debugging commands
4
+
1
5
  17/01/2012 version 0.9.11.3
2
6
  * fix Pry.run_command
3
7
  * improve `ls` output
data/lib/pry/pager.rb CHANGED
@@ -24,7 +24,12 @@ class Pry::Pager
24
24
  end
25
25
 
26
26
  def self.page_size
27
- 27
27
+ @page_size ||= begin
28
+ require 'io/console'
29
+ $stdout.winsize.first
30
+ rescue LoadError
31
+ 27
32
+ end
28
33
  end
29
34
 
30
35
  def initialize(text)
@@ -47,13 +52,27 @@ class Pry::Pager
47
52
 
48
53
  class SystemPager < Pry::Pager
49
54
  def self.default_pager
50
- ENV["PAGER"] || "less -R -S -F -X"
55
+ pager = ENV["PAGER"] || ""
56
+
57
+ # Default to less, and make sure less is being passed the correct options
58
+ if pager.strip.empty? or pager =~ /^less\s*/
59
+ pager = "less -R -S -F -X"
60
+ end
61
+
62
+ pager
51
63
  end
52
64
 
53
65
  def self.available?
54
- pager_executable = default_pager.split(' ').first
55
- `which #{ pager_executable }`
56
- rescue
66
+ if @system_pager.nil?
67
+ @system_pager = begin
68
+ pager_executable = default_pager.split(' ').first
69
+ `which #{ pager_executable }`
70
+ rescue
71
+ false
72
+ end
73
+ else
74
+ @system_pager
75
+ end
57
76
  end
58
77
 
59
78
  def initialize(*)
data/lib/pry/pry_class.rb CHANGED
@@ -55,6 +55,10 @@ class Pry
55
55
  # @return [Binding] A top level binding with no local variables
56
56
  attr_accessor :toplevel_binding
57
57
 
58
+ # @return [Exception, nil] The last pry internal error.
59
+ # (a CommandError in most cases)
60
+ attr_accessor :last_internal_error
61
+
58
62
  # plugin forwardables
59
63
  def_delegators :@plugin_manager, :plugins, :load_plugins, :locate_plugins
60
64
 
@@ -300,6 +300,7 @@ class Pry
300
300
  # eval_string will probably be mutated by this method
301
301
  retrieve_line(eval_string, target)
302
302
  rescue CommandError, Slop::InvalidOptionError, MethodSource::SourceNotFoundError => e
303
+ Pry.last_internal_error = e
303
304
  output.puts "Error: #{e.message}"
304
305
  end
305
306
 
data/lib/pry/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Pry
2
- VERSION = "0.9.11.3"
2
+ VERSION = "0.9.11.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.11.3
4
+ version: 0.9.11.4
5
5
  prerelease:
6
6
  platform: i386-mswin32
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-01-18 00:00:00.000000000 Z
14
+ date: 2013-01-20 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: coderay