Git Product home page Git Product logo

pry-coolline's Introduction

pry-coolline

(C) John Mair (banisterfiend) 2012

live syntax-highlighting for the Pry REPL

The pry-coolline plugin provides live syntax highlighting for the Pry REPL for Ruby 1.9.2+ (MRI).

It makes use of the coolline gem and the io/console library.

How to use:

After installing pry-coolline just start Pry as normal, the coolline plugin will be detected and used automatically.

![Alt text](https://dl.dropboxusercontent.com/u/26521875/pics/coolline.png)

Features

Automatic Ruby syntax highlighting

This is the main feature. It is enabled by default, as long as Pry.config.color is true.

Matching of opening and closing parentheses and brackets

pry-coolline allows to match parentheses and brackets automatically. This behavior can be configured and disabled altogether:

# Whether or not to enable this feature. Defaults to true.
Pry.config.coolline_paren_matching = false

# Change the color code inserted when paprens are (mis)matched.
Pry.config.coolline_matched_paren    = "\e[42m"
Pry.config.coolline_mismatched_paren = "\e[41m"

# In case you can't remember ANSI color codes ;)
require 'term/ansicolor'
Pry.config.coolline_matched_paren    = Term::ANSIColor.on_green
Pry.config.coolline_mismatched_paren = Term::ANSIColor.on_red

Limitations

  • No Ruby < 1.9.2 support.
  • MRI only.
  • Poor support for long lines.
  • Pry's automatic indent is not yet compatible.
  • Occasionally has some quirks (hopefully ironed out in future).

Contact

Problems or questions contact me at github

License

(The MIT License)

Copyright (c) 2012 John Mair (banisterfiend)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

pry-coolline's People

Contributors

andrehjr avatar banister avatar conradirwin avatar davidcelis avatar jraregris avatar kyrylo avatar liaden avatar mon-ouie avatar nysalor avatar owst avatar stevenchanin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pry-coolline's Issues

Ctrl-u binding doesnt work with Pry 0.9.9.3

when I installed the pry-coolline after having updated to pry 0.9.9.3 on mac os x the Ctrl-u wouldnt work as expected i.e. it wouldn't clear the line. gem uninstall pry-coolline brought the shortcut back

disable single input line cropping

I don't know how the feature is called, that you always have a single line input which does not break but moves the character inside the visible space.
Instead I prefer the default line wrapping behaviour for two reasons:

  • I want to see the whole line.
  • I want to copy the whole line after heavy experimenting with it in the console.

I did not find any configuration possibilities to disable that feature. Is it just me looking for in the wrong places? :) Kind regard

Improve parentheses matching

First of all, see this comment by @Mon-Ouie:

For the record, there are still things that can be improved:

Properly handling strings, and other things that use the same characters for opening and closing (%w!foo bar!)
Right now, this just inserts a "clear" code after the bracket; one could try checking the ansi codes that currently apply to make sure they aren't cancelled.

Secondly, it would be nice if we had multiline matching. But I'm not sure if that's possible.

pry(main)> def banzai(                                                                                                                              
pry(main)*     :geronimo => true) # This bracket highlights as `coolline_mismatched_paren`.

Matching bracket/parenthesis highlighting

Moved from: pry/pry#283

Description by @jrunning:

A feature I'd love to see in any REPL is IDE-style bracket matching, i.e. as I'm typing or moving the cursor back and forth on the line, if the character under or adjacent to the cursor is a parenthesis or bracket its mate, wherever it is on the line, is highlighted in some way. This would be especially useful when composing and testing complex regular expressions. I don't know how difficult it would be to implement so I don't know how realistic my request is, but it would certainly help set Pry even farther ahead of the pack.

pry-coolline with pry 0.13.1 gives undefined method `file' for #<Pry::History:...>

Attempting to use pry-coolline with pry 0.13.1 gives: undefined method 'file' for #<Pry::History:0x00007fc0d148a578> (NoMethodError)

Reproduction

Save the following in foo.rb:

require 'bundler/inline'

gemfile do
  source 'https://rubygems.org'
  gem 'pry', '= 0.13.1'
  gem 'pry-coolline' 
end

binding.pry

p 42

Running ruby foo.rb gives:

$ ruby /tmp/foo.rb
Traceback (most recent call last):
	13: from /tmp/foo.rb:3:in `<main>'
	12: from /Users/owen/.rbenv/versions/2.5.5/lib/ruby/site_ruby/2.5.0/bundler/inline.rb:70:in `gemfile'
	11: from /Users/owen/.rbenv/versions/2.5.5/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:65:in `require'
	10: from /Users/owen/.rbenv/versions/2.5.5/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:65:in `each'
	 9: from /Users/owen/.rbenv/versions/2.5.5/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:76:in `block in require'
	 8: from /Users/owen/.rbenv/versions/2.5.5/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:76:in `each'
	 7: from /Users/owen/.rbenv/versions/2.5.5/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:81:in `block (2 levels) in require'
	 6: from /Users/owen/.rbenv/versions/2.5.5/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:81:in `require'
	 5: from /Users/owen/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/pry-coolline-0.2.5/lib/pry-coolline.rb:18:in `<top (required)>'
	 4: from /Users/owen/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/pry-coolline-0.2.5/lib/pry-coolline/wrapper.rb:55:in `make_input'
	 3: from /Users/owen/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/pry-coolline-0.2.5/lib/pry-coolline/wrapper.rb:26:in `make_coolline'
	 2: from /Users/owen/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/pry-coolline-0.2.5/lib/pry-coolline/wrapper.rb:26:in `new'
	 1: from /Users/owen/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/coolline-0.5.0/lib/coolline/coolline.rb:138:in `initialize'
/Users/owen/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/pry-coolline-0.2.5/lib/pry-coolline/wrapper.rb:35:in `block in make_coolline': undefined method `file' for #<Pry::History:0x00007ff490122528> (NoMethodError)
Did you mean?  filter

Abort rails console with `def method`

Hello,

When define a method on rails console with name method close session with a abort message

def method
  puts "Hello Pry"
end

Abort message:

 output error: #<NoMethodError: private method `method' called for ":method":String>
Error: private method `method' called for #<PryCoolline::Wrapper:0x00000007b61f00>
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:187:in `block in read_line'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:129:in `handle_read_errors'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:170:in `read_line'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:98:in `read'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:68:in `block in repl'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:67:in `loop'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:67:in `repl'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:38:in `block in start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/input_lock.rb:61:in `call'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/input_lock.rb:61:in `__with_ownership'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/input_lock.rb:79:in `with_ownership'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:38:in `start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:15:in `start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/pry_class.rb:169:in `start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-byebug-3.3.0/lib/pry-byebug/pry_ext.rb:11:in `start_with_pry_byebug'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/railties-4.2.5/lib/rails/commands/console.rb:110:in `start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/railties-4.2.5/lib/rails/commands/console.rb:9:in `start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:68:in `console'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Error: private method `method' called for #<PryCoolline::Wrapper:0x00000007b61f00>
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:187:in `block in read_line'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:129:in `handle_read_errors'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:170:in `read_line'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:98:in `read'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:68:in `block in repl'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:67:in `loop'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:67:in `repl'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:38:in `block in start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/input_lock.rb:61:in `call'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/input_lock.rb:61:in `__with_ownership'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/input_lock.rb:79:in `with_ownership'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:38:in `start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:15:in `start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/pry_class.rb:169:in `start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-byebug-3.3.0/lib/pry-byebug/pry_ext.rb:11:in `start_with_pry_byebug'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/railties-4.2.5/lib/rails/commands/console.rb:110:in `start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/railties-4.2.5/lib/rails/commands/console.rb:9:in `start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:68:in `console'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Error: private method `method' called for #<PryCoolline::Wrapper:0x00000007b61f00>
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:187:in `block in read_line'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:129:in `handle_read_errors'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:170:in `read_line'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:98:in `read'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:68:in `block in repl'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:67:in `loop'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:67:in `repl'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:38:in `block in start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/input_lock.rb:61:in `call'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/input_lock.rb:61:in `__with_ownership'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/input_lock.rb:79:in `with_ownership'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:38:in `start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:15:in `start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/pry_class.rb:169:in `start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-byebug-3.3.0/lib/pry-byebug/pry_ext.rb:11:in `start_with_pry_byebug'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/railties-4.2.5/lib/rails/commands/console.rb:110:in `start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/railties-4.2.5/lib/rails/commands/console.rb:9:in `start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:68:in `console'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Error: private method `method' called for #<PryCoolline::Wrapper:0x00000007b61f00>
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:187:in `block in read_line'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:129:in `handle_read_errors'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:170:in `read_line'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:98:in `read'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:68:in `block in repl'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:67:in `loop'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:67:in `repl'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:38:in `block in start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/input_lock.rb:61:in `call'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/input_lock.rb:61:in `__with_ownership'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/input_lock.rb:79:in `with_ownership'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:38:in `start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:15:in `start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/pry_class.rb:169:in `start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-byebug-3.3.0/lib/pry-byebug/pry_ext.rb:11:in `start_with_pry_byebug'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/railties-4.2.5/lib/rails/commands/console.rb:110:in `start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/railties-4.2.5/lib/rails/commands/console.rb:9:in `start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:68:in `console'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
Error: private method `method' called for #<PryCoolline::Wrapper:0x00000007b61f00>
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:187:in `block in read_line'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:129:in `handle_read_errors'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:170:in `read_line'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:98:in `read'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:68:in `block in repl'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:67:in `loop'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:67:in `repl'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:38:in `block in start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/input_lock.rb:61:in `call'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/input_lock.rb:61:in `__with_ownership'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/input_lock.rb:79:in `with_ownership'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:38:in `start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/repl.rb:15:in `start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-0.10.3/lib/pry/pry_class.rb:169:in `start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/pry-byebug-3.3.0/lib/pry-byebug/pry_ext.rb:11:in `start_with_pry_byebug'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/railties-4.2.5/lib/rails/commands/console.rb:110:in `start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/railties-4.2.5/lib/rails/commands/console.rb:9:in `start'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:68:in `console'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
/home/maximiliano/.rvm/gems/ruby-2.2.2@pow/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'
FATAL: Pry failed to get user input using `#<struct PryCoolline::Wrapper cool=#<Coolline:0x0000000830bb70 @input=#<IO:<STDIN>>,
...

[BUG] Ctrl + arrows hotkey

When you try to navigate with ctrl+left or ctrl+right you get 5D or 5C printed in the type sting and cursor will be at the end of the string like [1] pry(main)> 1.class5D

Breaks Readline's editing-mode vi

Not sure what's up, and I don't have enough time at the moment to really debug
it, but if you do:

echo "set editing-mode vi" > ~/.inputrc; pry --no-plugins

...then type 123<Enter><Esc>k
...you'll see 123 again.

Now run pry again with the coolline plugin enabled, and the vi keys will be
disabled.

Thanks!
-rking

New Gem version?

Hi, the current released gem version depends on an old version io-console which is problematic. Any chance of a new gem cut? Thanks!

display issues when combined with pry-theme

When I have pry-theme installed and using the railscasts theme I get some syntax i get some display issues, see below:

def test(a,b,c)
  puts a,b,c
end

test("a","b","c

When I go to type double quotes and ')' after the "c" on the last line it doesn't show up until I hit enter. When I disable coolline it works without any issues.

Pry's Highlighting Only Shows After Finishing Line

I was under the impression that Pry would syntax highlight lines as you typed them, but I can only see it highlighting lines after I've finished them. Am I missing a configuration knob somewhere, or is this how pry-coolline is intended to work?

Will not build on 2.0.0-p0 (w/ 2.0.0-p0 from rbenv)

gem install io-console
Fetching: io-console-0.4.2.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing io-console:
    ERROR: Failed to build gem native extension.

    ~/.rbenv/versions/2.0.0-p0/bin/ruby extconf.rb
checking for termios.h... yes
checking for cfmakeraw() in termios.h... yes
checking for sys/ioctl.h... yes
checking for rb_check_hash_type() in ruby.h... yes
checking for rb_io_get_write_io() in ruby/io.h... yes
checking for rb_cloexec_open() in ruby/io.h... yes
creating Makefile

make
compiling console.c
linking shared-object io/console.bundle

make install
/usr/bin/install -c -m 0755 console.bundle ~/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/io-console-0.4.2/./io
installing default console libraries
install: ~/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/io-console-0.4.2/./io/console: Not a directory
make: *** [~/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/io-console-0.4.2/./io/console/size.rb] Error 71


Gem files will remain installed in ~/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/io-console-0.4.2 for inspection.
Results logged to ~/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/io-console-0.4.2/./gem_make.out

Tab-completing leaves an extra newline

When tab-completing with pry-coolline installed, the cursor is being placed a couple of lines down inside the tab-complete items instead of in the correct location at the end of the line. It's corrected after typing any additional characters. This happens no matter how many items are being tab-completed, and happens even if there's only one candidate.

newline

I'm using Ruby 2.1.2 on OS X 10.9.3 with the builtin io-console installed.

tab completion doesn't work

Hi Mon,

Tab completion doesn't work when I am using pry-coolline with the latest version of pry. I like using coolline but will need to stop until this is fixed. Hopefully you can fix this ASAP as tab completion is very needed.

Thanks,
Jay

new pry-coolline & pry are unusable.

$ pry
from /Users/robert/.gem/ruby/2.1.0/gems/pry-0.9.12.4/lib/pry/pry_instance.rb:376:in `retrieve_line'
NoMethodError: undefined method `build_completion_proc' for true:TrueClass
from /Users/robert/.gem/ruby/2.1.0/gems/pry-0.9.12.4/lib/pry/pry_instance.rb:376:in `retrieve_line'
NoMethodError: undefined method `build_completion_proc' for true:TrueClass
from /Users/robert/.gem/ruby/2.1.0/gems/pry-0.9.12.4/lib/pry/pry_instance.rb:376:in `retrieve_line'
NoMethodError: undefined method `build_completion_proc' for true:TrueClass
from /Users/robert/.gem/ruby/2.1.0/gems/pry-0.9.12.4/lib/pry/pry_instance.rb:376:in `retrieve_line'
NoMethodError: undefined method `build_completion_proc' for true:TrueClass
from /Users/robert/.gem/ruby/2.1.0/gems/pry-0.9.12.4/lib/pry/pry_instance.rb:376:in `retrieve_line'
NoMethodError: undefined method `build_completion_proc' for true:TrueClass
from /Users/robert/.gem/ruby/2.1.0/gems/pry-0.9.12.4/lib/pry/pry_instance.rb:376:in `retrieve_line'
NoMethodError: undefined method `build_completion_proc' for true:TrueClass
...etc
$ pry < foo.rb
# same thing

Bond compatibility

Trying to use bond completion with coolline results in the following:

[1] pry(main)>                                                                                                                                                                 
Bond Error: Failed internally with 'undefined method `match' for nil:NilClass'. Please report this issue with debug on: Bond.config[:debug] = true.
[1] pry(main)> Bond.config[:debug] = true                                                                                                                                      
true
[2] pry(main)> Process.Error: invalid slice size                                                                                                                               
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/coolline-0.4.0/lib/coolline/menu.rb:96:in `each_slice'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/coolline-0.4.0/lib/coolline/menu.rb:96:in `format_columns'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/coolline-0.4.0/lib/coolline/menu.rb:34:in `list='
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/coolline-0.4.0/lib/coolline/coolline.rb:394:in `complete'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/coolline-0.4.0/lib/coolline/handler.rb:14:in `call'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/coolline-0.4.0/lib/coolline/handler.rb:14:in `call'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/coolline-0.4.0/lib/coolline/coolline.rb:420:in `handle'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/coolline-0.4.0/lib/coolline/coolline.rb:205:in `readline'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/pry-coolline-0.2.2/lib/pry-coolline/wrapper.rb:4:in `readline'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/pry-0.9.12/lib/pry/pry_instance.rb:629:in `block in readline'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/pry-0.9.12/lib/pry/pry_instance.rb:564:in `handle_read_errors'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/pry-0.9.12/lib/pry/pry_instance.rb:609:in `readline'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/pry-0.9.12/lib/pry/pry_instance.rb:384:in `retrieve_line'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/pry-0.9.12/lib/pry/pry_instance.rb:301:in `block in r'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/pry-0.9.12/lib/pry/pry_instance.rb:298:in `loop'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/pry-0.9.12/lib/pry/pry_instance.rb:298:in `r'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/pry-0.9.12/lib/pry/pry_instance.rb:276:in `re'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/pry-0.9.12/lib/pry/pry_instance.rb:254:in `rep'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/pry-0.9.12/lib/pry/pry_instance.rb:234:in `block (3 levels) in repl'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/pry-0.9.12/lib/pry/pry_instance.rb:232:in `loop'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/pry-0.9.12/lib/pry/pry_instance.rb:232:in `block (2 levels) in repl'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/pry-0.9.12/lib/pry/pry_instance.rb:231:in `catch'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/pry-0.9.12/lib/pry/pry_instance.rb:231:in `block in repl'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/pry-0.9.12/lib/pry/pry_instance.rb:230:in `catch'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/pry-0.9.12/lib/pry/pry_instance.rb:230:in `repl'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/pry-0.9.12/lib/pry/pry_class.rb:170:in `start'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/pry-0.9.12/lib/pry/cli.rb:201:in `block in <top (required)>'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/pry-0.9.12/lib/pry/cli.rb:70:in `call'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/pry-0.9.12/lib/pry/cli.rb:70:in `block in parse_options'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/pry-0.9.12/lib/pry/cli.rb:70:in `each'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/pry-0.9.12/lib/pry/cli.rb:70:in `parse_options'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/gems/pry-0.9.12/bin/pry:16:in `<top (required)>'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/bin/pry:19:in `load'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/bin/pry:19:in `<main>'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/bin/ruby_noexec_wrapper:14:in `eval'
/home/user/.rvm/gems/ruby-1.9.3-p392@default/bin/ruby_noexec_wrapper:14:in `<main>'

Pry's command history malfunctions when pry-coolline's active

Where using pry (0.10.0) with pry-coolline (0.2.4) and cooline (0.4.4), you need to push the up arrow button twice (instead of once) to get the last entered expression, like there was always an extra empty entry at the command history.

This is happening to me using ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux].

Odd output when `Pry.color` is false

[1] pry(main)> Pry.color = false                                                                                                                               
[2] pry(main)> def geronimo 
[2] pry(main)* end                                                                                                                                             
  ] pry(main)*   end                                                                                                                                           
=> nil
[3] pry(main)>  
[4] pry(main)> class Banzai       
[4] pry(main)*   def huzzah                  
[4] pry(main)*     puts "Huzzah!"      
[4] pry(main)*   end                                                                                                                                           
[4] pry(main)* end                                                                                                                                             
  ] pry(main)*   end                                                                                                                                           
=> nil
[5] pry(main)>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.