pry 0.10.0.rc1-i386-mswin32 → 0.10.1-i386-mswin32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c25e785cb82c5bd694de4aa302e4c55a7b4c8a72
4
- data.tar.gz: 29d7b3767d43fc77c757df6c2e9519ce527b1de8
3
+ metadata.gz: 1db3c1ccb6e3fd47c39e030194679feb2b841726
4
+ data.tar.gz: 9ef96f53b4d97a16d58ee063a6281d94e804ed4b
5
5
  SHA512:
6
- metadata.gz: a8e0cf3919af47fe9fe54a89d3bc1fb38e162fd0bef88052492ba8e5bfd0bfe0f69d0a8bd0723b8814d985df419694339ddf25cf28a31d7f3975ea88e88ddf6e
7
- data.tar.gz: 5460d0bd1d017c69d98d855484fe514345e77649008c92794769ed916fc7db0f81331c7c5c0ca00dbf732c405c67506b0c6a1447f3f330f2feb012e5c7e3fc11
6
+ metadata.gz: 14c46f7611b85e274adb5ef107490b6d8eaef7d8aafd07a41c595a3195db58d5f5e70fdae9817befba0a15b8f82b1b357f6bf490679d79a1aef1bc53d366230f
7
+ data.tar.gz: e94499c0d75d985a4fa22ce04410c5e2972e3b52edb4d567557666536d17bec5378e8d62250bdab7d571699846a9117805633f6f1e37cc93e354f923a897174c
data/CHANGELOG.md CHANGED
@@ -1,4 +1,11 @@
1
- ### 0.10.0.pre2 (2014/??/??)
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 surroungind method
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-pages.github.io/github/pry/pry.svg)](http://inch-pages.github.io/github/pry/pry)
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
@@ -1,6 +1,6 @@
1
1
  class Pry
2
2
  class Command::Bang < Pry::ClassCommand
3
- match /^\s*!\s*$/
3
+ match(/^\s*!\s*$/)
4
4
  group 'Editing'
5
5
  description 'Clear the input buffer.'
6
6
  command_options :use_prefix => false
@@ -8,7 +8,7 @@ class Pry
8
8
  def decorate(content)
9
9
  content.code_type = code_type
10
10
  content.between(*between_lines).
11
- with_line_numbers(use_line_numbers?)
11
+ with_line_numbers(use_line_numbers?).highlighted
12
12
  end
13
13
 
14
14
  def code_type
@@ -51,7 +51,7 @@ class Pry
51
51
  code_type = @code_from_file.code_type
52
52
 
53
53
  if code_type == :unknown
54
- name, ext = File.basename(file_name).split('.', 2)
54
+ name = File.basename(file_name).split('.', 2).first
55
55
  case name
56
56
  when "Rakefile", "Gemfile"
57
57
  :ruby
@@ -1,7 +1,7 @@
1
1
  class Pry
2
2
  class Command::Ls < Pry::ClassCommand
3
3
  class Formatter
4
- attr_accessor :grep
4
+ attr_writer :grep
5
5
  attr_reader :_pry_
6
6
 
7
7
  def initialize(_pry_)
@@ -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
 
@@ -88,7 +88,7 @@ class Pry
88
88
 
89
89
  def add_expression(arguments)
90
90
  expressions << Expression.new(_pry_, target, arg_string)
91
- output.puts "Watching #{Code.new(arg_string)}"
91
+ output.puts "Watching #{Code.new(arg_string).highlighted}"
92
92
  end
93
93
 
94
94
  def add_hook
@@ -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
@@ -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
@@ -5,7 +5,6 @@ module Pry::Config::Convenience
5
5
  :commands,
6
6
  :print,
7
7
  :exception_handler,
8
- :quiet?,
9
8
  :hooks,
10
9
  :color,
11
10
  :pager,
@@ -119,10 +119,6 @@ class Pry::Config::Default
119
119
  configure_history
120
120
  end
121
121
 
122
- def quiet?
123
- quiet
124
- end
125
-
126
122
  default.each do |key, value|
127
123
  define_method(key) do
128
124
  if default[key].equal?(value)
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
- filename = File.expand_path(Pry.config.history.file)
84
+ path = history_file_path
85
85
 
86
- if File.exists?(filename)
87
- File.foreach(filename) { |line| yield(line) }
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(file_path, 'a', 0600).tap { |f| f.sync = true }
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 file_path
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
@@ -164,7 +164,7 @@ class Pry
164
164
  end
165
165
 
166
166
  def valid_file?(file)
167
- (File.exists?(file) && !File.directory?(file)) || Pry.eval_path == file
167
+ (File.exist?(file) && !File.directory?(file)) || Pry.eval_path == file
168
168
  end
169
169
 
170
170
  def lines_for_file(file)
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.exists?(cli_options_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
@@ -19,7 +19,7 @@ class Pry
19
19
  def_delegators :@plugin_manager, :plugins, :load_plugins, :locate_plugins
20
20
 
21
21
  extend Pry::Config::Convenience
22
- config_shortcut *Pry::Config.shortcuts
22
+ config_shortcut(*Pry::Config.shortcuts)
23
23
 
24
24
  def prompt=(value)
25
25
  config.prompt = value
@@ -39,7 +39,7 @@ class Pry
39
39
  attr_reader :config
40
40
 
41
41
  extend Pry::Config::Convenience
42
- config_shortcut *Pry::Config.shortcuts
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.each_line.count
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
@@ -5,7 +5,7 @@ class Pry::Terminal
5
5
  # If the window size cannot be determined, return nil.
6
6
  def screen_size
7
7
  rows, cols = actual_screen_size
8
- if rows && cols
8
+ if rows.to_i != 0 && cols.to_i != 0
9
9
  [rows.to_i, cols.to_i]
10
10
  else
11
11
  nil
data/lib/pry/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Pry
2
- VERSION = "0.10.0.rc1"
2
+ VERSION = "0.10.1"
3
3
  end
@@ -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.0.rc1
4
+ version: 0.10.1
5
5
  platform: i386-mswin32
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-05-29 00:00:00.000000000 Z
13
+ date: 2014-08-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: coderay
@@ -236,9 +236,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
236
236
  version: '0'
237
237
  required_rubygems_version: !ruby/object:Gem::Requirement
238
238
  requirements:
239
- - - ">"
239
+ - - ">="
240
240
  - !ruby/object:Gem::Version
241
- version: 1.3.1
241
+ version: '0'
242
242
  requirements: []
243
243
  rubyforge_project:
244
244
  rubygems_version: 2.2.2