pry 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -2
- data/README.md +1 -1
- data/lib/pry/code.rb +7 -2
- data/lib/pry/commands/bang.rb +1 -1
- data/lib/pry/commands/cat/abstract_formatter.rb +1 -1
- data/lib/pry/commands/cat/file_formatter.rb +1 -1
- data/lib/pry/commands/ls/formatter.rb +1 -1
- data/lib/pry/commands/show_source.rb +1 -1
- data/lib/pry/commands/watch_expression.rb +1 -1
- data/lib/pry/commands/watch_expression/expression.rb +2 -2
- data/lib/pry/commands/whereami.rb +1 -1
- data/lib/pry/config/behavior.rb +1 -1
- data/lib/pry/config/convenience.rb +0 -1
- data/lib/pry/config/default.rb +0 -4
- data/lib/pry/editor.rb +3 -1
- data/lib/pry/history.rb +8 -6
- data/lib/pry/method/weird_method_locator.rb +1 -1
- data/lib/pry/pager.rb +2 -1
- data/lib/pry/plugins.rb +1 -1
- data/lib/pry/pry_class.rb +1 -1
- data/lib/pry/pry_instance.rb +12 -2
- data/lib/pry/terminal.rb +1 -1
- data/lib/pry/version.rb +1 -1
- data/lib/pry/wrapped_module.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4b5511a43b1aac132c835425bc30425073db90f
|
4
|
+
data.tar.gz: 9ef96f53b4d97a16d58ee063a6281d94e804ed4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73fc5d3c0d448db136892e2bf0ac917995ca78f4961fa4b5b069a87bac1cdc0c50ba730127e7029f94731dd53cb43bd8bdc7b3c57f3d20c064bba9756bdd22a8
|
7
|
+
data.tar.gz: e94499c0d75d985a4fa22ce04410c5e2972e3b52edb4d567557666536d17bec5378e8d62250bdab7d571699846a9117805633f6f1e37cc93e354f923a897174c
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,11 @@
|
|
1
|
-
### 0.10.
|
1
|
+
### 0.10.1
|
2
|
+
|
3
|
+
* Fix bugs with jruby
|
4
|
+
* Move to rspec for testing (from bacon)
|
5
|
+
* Clean up ruby warnings
|
6
|
+
|
7
|
+
|
8
|
+
### 0.10.0
|
2
9
|
|
3
10
|
#### Features
|
4
11
|
* Added a `watch` command that lets you see how values change over time.
|
@@ -16,7 +23,7 @@
|
|
16
23
|
* See `Pry.config.prompt_safe_objects`
|
17
24
|
* `whereami` is now aliased to `@`
|
18
25
|
* Added arguments to `whereami`:
|
19
|
-
* `-m` shows the
|
26
|
+
* `-m` shows the surrounding method
|
20
27
|
* `-c` shows the surrounding class
|
21
28
|
* `-f` shows the entire file
|
22
29
|
* Lazy load configuration values (Pry.config). (#1096)
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
[![Build Status](https://img.shields.io/travis/pry/pry.svg)](https://travis-ci.org/pry/pry)
|
2
2
|
[![Code Climate](https://img.shields.io/codeclimate/github/pry/pry.svg)](https://codeclimate.com/github/pry/pry)
|
3
|
-
[![Inline docs](http://inch-
|
3
|
+
[![Inline docs](http://inch-ci.org/github/pry/pry.svg)](http://inch-ci.org/github/pry/pry)
|
4
4
|
|
5
5
|
<center>
|
6
6
|
![The Pry Logo](https://dl.dropbox.com/u/26521875/pry%20stuff/logo/pry_logo_350.png)
|
data/lib/pry/code.rb
CHANGED
@@ -253,7 +253,12 @@ class Pry
|
|
253
253
|
# @return [String] a formatted representation (based on the configuration of
|
254
254
|
# the object).
|
255
255
|
def to_s
|
256
|
-
print_to_output("")
|
256
|
+
print_to_output("", false)
|
257
|
+
end
|
258
|
+
|
259
|
+
# @return [String] a (possibly highlighted) copy of the source code.
|
260
|
+
def highlighted
|
261
|
+
print_to_output("", true)
|
257
262
|
end
|
258
263
|
|
259
264
|
# Writes a formatted representation (based on the configuration of the
|
@@ -261,7 +266,7 @@ class Pry
|
|
261
266
|
def print_to_output(output, color=false)
|
262
267
|
@lines.each do |loc|
|
263
268
|
loc = loc.dup
|
264
|
-
loc.colorize(@code_type)
|
269
|
+
loc.colorize(@code_type) if color
|
265
270
|
loc.add_line_number(max_lineno_width, color) if @with_line_numbers
|
266
271
|
loc.add_marker(@marker_lineno) if @with_marker
|
267
272
|
loc.indent(@indentation_num) if @with_indentation
|
data/lib/pry/commands/bang.rb
CHANGED
@@ -40,7 +40,7 @@ class Pry
|
|
40
40
|
# The source for code_object prepared for display.
|
41
41
|
def content_for(code_object)
|
42
42
|
Code.new(code_object.source, start_line_for(code_object)).
|
43
|
-
with_line_numbers(use_line_numbers?)
|
43
|
+
with_line_numbers(use_line_numbers?).highlighted
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
@@ -6,7 +6,7 @@ class Pry
|
|
6
6
|
def initialize(_pry_, target, source)
|
7
7
|
@_pry_ = _pry_
|
8
8
|
@target = target
|
9
|
-
@source = source.strip
|
9
|
+
@source = Code.new(source).strip
|
10
10
|
end
|
11
11
|
|
12
12
|
def eval!
|
@@ -15,7 +15,7 @@ class Pry
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def to_s
|
18
|
-
"#{Code.new(source).strip} => #{value}"
|
18
|
+
"#{Code.new(source).highlighted.strip} => #{value}"
|
19
19
|
end
|
20
20
|
|
21
21
|
# Has the value of the expression changed?
|
@@ -89,7 +89,7 @@ class Pry
|
|
89
89
|
set_file_and_dir_locals(@file)
|
90
90
|
|
91
91
|
out = "\n#{text.bold('From:')} #{location}:\n\n" <<
|
92
|
-
code.with_line_numbers(use_line_numbers?).with_marker(marker) << "\n"
|
92
|
+
code.with_line_numbers(use_line_numbers?).with_marker(marker).highlighted << "\n"
|
93
93
|
|
94
94
|
_pry_.pager.page out
|
95
95
|
end
|
data/lib/pry/config/behavior.rb
CHANGED
@@ -54,7 +54,7 @@ module Pry::Config::Behavior
|
|
54
54
|
value = @default.public_send(name, *args, &block)
|
55
55
|
# FIXME: refactor Pry::Hook so that it stores config on the config object,
|
56
56
|
# so that we can use the normal strategy.
|
57
|
-
self[key] = value.dup if key == 'hooks'
|
57
|
+
self[key] = value = value.dup if key == 'hooks'
|
58
58
|
value
|
59
59
|
else
|
60
60
|
nil
|
data/lib/pry/config/default.rb
CHANGED
data/lib/pry/editor.rb
CHANGED
@@ -84,7 +84,7 @@ class Pry
|
|
84
84
|
'--nofork' if blocking
|
85
85
|
when /^jedit/
|
86
86
|
'-wait' if blocking
|
87
|
-
when /^mate/, /^subl/
|
87
|
+
when /^mate/, /^subl/, /^redcar/
|
88
88
|
'-w' if blocking
|
89
89
|
end
|
90
90
|
end
|
@@ -106,6 +106,8 @@ class Pry
|
|
106
106
|
"#{file_name}/#{line_number}"
|
107
107
|
when /^jedit/
|
108
108
|
"#{file_name} +line:#{line_number}"
|
109
|
+
when /^redcar/
|
110
|
+
"-l#{line_number} #{file_name}"
|
109
111
|
else
|
110
112
|
if windows?
|
111
113
|
"#{file_name}"
|
data/lib/pry/history.rb
CHANGED
@@ -81,10 +81,10 @@ class Pry
|
|
81
81
|
|
82
82
|
# The default loader. Yields lines from `Pry.history.config.file`.
|
83
83
|
def read_from_file
|
84
|
-
|
84
|
+
path = history_file_path
|
85
85
|
|
86
|
-
if File.exists?(
|
87
|
-
File.foreach(
|
86
|
+
if File.exists?(path)
|
87
|
+
File.foreach(path) { |line| yield(line) }
|
88
88
|
end
|
89
89
|
rescue => error
|
90
90
|
warn "History file not loaded: #{error.message}"
|
@@ -111,15 +111,17 @@ class Pry
|
|
111
111
|
if defined?(@history_file)
|
112
112
|
@history_file
|
113
113
|
else
|
114
|
-
@history_file = File.open(
|
114
|
+
@history_file = File.open(history_file_path, 'a', 0600).tap do |file|
|
115
|
+
file.sync = true
|
116
|
+
end
|
115
117
|
end
|
116
118
|
rescue Errno::EACCES
|
117
119
|
warn 'History not saved; unable to open your history file for writing.'
|
118
120
|
@history_file = false
|
119
121
|
end
|
120
122
|
|
121
|
-
def
|
122
|
-
@file_path || Pry.config.history.file
|
123
|
+
def history_file_path
|
124
|
+
File.expand_path(@file_path || Pry.config.history.file)
|
123
125
|
end
|
124
126
|
end
|
125
127
|
end
|
data/lib/pry/pager.rb
CHANGED
@@ -38,9 +38,10 @@ class Pry::Pager
|
|
38
38
|
|
39
39
|
private
|
40
40
|
|
41
|
-
attr_reader :output
|
42
41
|
def enabled?; !!@enabled; end
|
43
42
|
|
43
|
+
def output; @output; end
|
44
|
+
|
44
45
|
# Return an instance of the "best" available pager class -- `SystemPager` if
|
45
46
|
# possible, `SimplePager` if `SystemPager` isn't available, and `NullPager`
|
46
47
|
# if the user has disabled paging. All pagers accept output with `#puts`,
|
data/lib/pry/plugins.rb
CHANGED
@@ -35,7 +35,7 @@ class Pry
|
|
35
35
|
# Load the Command line options defined by this plugin (if they exist)
|
36
36
|
def load_cli_options
|
37
37
|
cli_options_file = File.join(spec.full_gem_path, "lib/#{spec.name}/cli.rb")
|
38
|
-
require cli_options_file if File.
|
38
|
+
require cli_options_file if File.exist?(cli_options_file)
|
39
39
|
end
|
40
40
|
# Activate the plugin (require the gem - enables/loads the
|
41
41
|
# plugin immediately at point of call, even if plugin is
|
data/lib/pry/pry_class.rb
CHANGED
data/lib/pry/pry_instance.rb
CHANGED
@@ -39,7 +39,7 @@ class Pry
|
|
39
39
|
attr_reader :config
|
40
40
|
|
41
41
|
extend Pry::Config::Convenience
|
42
|
-
config_shortcut
|
42
|
+
config_shortcut(*Pry::Config.shortcuts)
|
43
43
|
EMPTY_COMPLETIONS = [].freeze
|
44
44
|
|
45
45
|
# Create a new {Pry} instance.
|
@@ -167,12 +167,14 @@ class Pry
|
|
167
167
|
end
|
168
168
|
end
|
169
169
|
|
170
|
+
undef :memory_size if method_defined? :memory_size
|
170
171
|
# @return [Integer] The maximum amount of objects remembered by the inp and
|
171
172
|
# out arrays. Defaults to 100.
|
172
173
|
def memory_size
|
173
174
|
@output_array.max_size
|
174
175
|
end
|
175
176
|
|
177
|
+
undef :memory_size= if method_defined? :memory_size=
|
176
178
|
def memory_size=(size)
|
177
179
|
@input_array = Pry::HistoryArray.new(size)
|
178
180
|
@output_array = Pry::HistoryArray.new(size)
|
@@ -503,7 +505,7 @@ class Pry
|
|
503
505
|
@input_array << code
|
504
506
|
if code
|
505
507
|
Pry.line_buffer.push(*code.each_line)
|
506
|
-
Pry.current_line += code.
|
508
|
+
Pry.current_line += code.lines.count
|
507
509
|
end
|
508
510
|
end
|
509
511
|
|
@@ -596,6 +598,7 @@ class Pry
|
|
596
598
|
prompt_stack.size > 1 ? prompt_stack.pop : prompt
|
597
599
|
end
|
598
600
|
|
601
|
+
undef :pager if method_defined? :pager
|
599
602
|
# Returns the currently configured pager
|
600
603
|
# @example
|
601
604
|
# _pry_.pager.page text
|
@@ -603,6 +606,7 @@ class Pry
|
|
603
606
|
Pry::Pager.new(self)
|
604
607
|
end
|
605
608
|
|
609
|
+
undef :output if method_defined? :output
|
606
610
|
# Returns an output device
|
607
611
|
# @example
|
608
612
|
# _pry_.output.puts "ohai!"
|
@@ -651,4 +655,10 @@ class Pry
|
|
651
655
|
end
|
652
656
|
def raise_up(*args); raise_up_common(false, *args); end
|
653
657
|
def raise_up!(*args); raise_up_common(true, *args); end
|
658
|
+
|
659
|
+
# Convenience accessor for the `quiet` config key.
|
660
|
+
# @return [Boolean]
|
661
|
+
def quiet?
|
662
|
+
config.quiet
|
663
|
+
end
|
654
664
|
end
|
data/lib/pry/terminal.rb
CHANGED
data/lib/pry/version.rb
CHANGED
data/lib/pry/wrapped_module.rb
CHANGED
@@ -107,6 +107,10 @@ class Pry
|
|
107
107
|
def singleton_class?
|
108
108
|
if Pry::Method.safe_send(wrapped, :respond_to?, :singleton_class?)
|
109
109
|
Pry::Method.safe_send(wrapped, :singleton_class?)
|
110
|
+
elsif defined?(Rubinius)
|
111
|
+
# https://github.com/rubinius/rubinius/commit/2e71722dba53d1a92c54d5e3968d64d1042486fe singleton_class? added 30 Jul 2014
|
112
|
+
# https://github.com/rubinius/rubinius/commit/4310f6b2ef3c8fc88135affe697db4e29e4621c4 has been around since 2011
|
113
|
+
!!Rubinius::Type.singleton_class_object(wrapped)
|
110
114
|
else
|
111
115
|
wrapped != Pry::Method.safe_send(wrapped, :ancestors).first
|
112
116
|
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.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Mair (banisterfiend)
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-
|
13
|
+
date: 2014-08-16 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: coderay
|