pry-editline 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.markdown +36 -50
- data/lib/pry-editline.rb +8 -2
- data/pry-editline.gemspec +2 -2
- metadata +16 -14
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 58c27d48c49c57ed98ee7b4237f1056294d8eaf8
|
4
|
+
data.tar.gz: 7df6e7b2dae2e00fe388dd1aa0a372ce81d571ee
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e5e101bb98b9ca2ddb0043ab52de630680a8cdb5a052773c9032c085f6f2b83e0800653f8cf7321fcef8237534e3c942adace7bf6d48694e1408f0098d66e381
|
7
|
+
data.tar.gz: d7042182de2f989dab8f12abc582847ac08d116305d846b033bf6a1cee5a31149c79aaec2cfcb3c41486b44d8f84abecac8a0929c54903633e34144d0e462328
|
data/README.markdown
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
pry-editline
|
2
|
-
------------
|
1
|
+
# pry-editline
|
3
2
|
|
4
3
|
Whenever I'm using IRB or [Pry][], my editor always feels too far away.
|
5
4
|
Yes, there are [various gems](http://utilitybelt.rubyforge.org/) out
|
@@ -7,7 +6,7 @@ there that will let me spawn an editor and evaluate the result, but
|
|
7
6
|
that's not what I need. Usually I'm about 80 characters or so into a
|
8
7
|
hairy one-liner when I think, "you know, I really wish I was in Vim
|
9
8
|
right about now." In Bash, one can load the current command line into
|
10
|
-
an editor with `C-x C-e`. And now, you can do
|
9
|
+
an editor with `C-x C-e`. And now, you can do the same in IRB and Pry.
|
11
10
|
|
12
11
|
The gem is named after [Pry][] so that it will be automatically loaded
|
13
12
|
as a Pry plugin (and because, let's face it, that's a good train to
|
@@ -16,8 +15,7 @@ hitch our wagon to). But it also works in IRB if you add `require
|
|
16
15
|
|
17
16
|
[Pry]: http://pry.github.com/
|
18
17
|
|
19
|
-
FAQ
|
20
|
-
---
|
18
|
+
## FAQ
|
21
19
|
|
22
20
|
> `C-x C-e` is too hard to type.
|
23
21
|
|
@@ -30,73 +28,61 @@ You can add an alias for it in `~/.inputrc`. Observe:
|
|
30
28
|
Actually, I already added `C-o` for you. So don't add that one. It
|
31
29
|
already works. It stands for "open".
|
32
30
|
|
33
|
-
> What about vi
|
31
|
+
> What about vi Readline bindings?
|
34
32
|
|
35
33
|
They're supported, too. In addition to `C-x C-e` and `C-o` in insert
|
36
34
|
mode, you can use `o` or `v` in normal mode.
|
37
35
|
|
38
|
-
> It's not working
|
36
|
+
> It's not working in REE.
|
39
37
|
|
40
|
-
|
41
|
-
|
42
|
-
doesn't work with pry-editline. To link against a different readline,
|
43
|
-
pass the `--with-readline-dir=` flag to `./configure`. If you're using
|
44
|
-
RVM, pass it to `rvm install`. Or better yet, make it the default:
|
38
|
+
REE seems to have an incomplete Readline implementation. See [this
|
39
|
+
issue](https://github.com/tpope/pry-editline/pull/2).
|
45
40
|
|
46
|
-
|
41
|
+
> It's not working on OS X.
|
47
42
|
|
48
|
-
|
49
|
-
|
50
|
-
|
43
|
+
OS X ships with the Readline replacement Editline rather than GNU Readline.
|
44
|
+
It's a horribly crippled replacement, and it won't work with pry-editline.
|
45
|
+
The simplest way to get a proper Readline is with [Homebrew][]:
|
51
46
|
|
52
47
|
brew install readline
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
Error: readline has multiple installed versions
|
69
|
-
Use `brew remove --force readline` to remove all versions.
|
70
|
-
$ brew remove -v6.1 readline
|
71
|
-
Error: readline has multiple installed versions
|
72
|
-
Use `brew remove --force readline` to remove all versions.
|
73
|
-
$ brew remove --force readline
|
74
|
-
Uninstalling readline...
|
75
|
-
$ brew install readline
|
76
|
-
...
|
77
|
-
$ brew link readline
|
78
|
-
|
79
|
-
Yeah, it's a bit of a pain. Sorry your OS hates you. :(
|
48
|
+
|
49
|
+
You'll need to tell Ruby to use this Readline when configuring it. If you're
|
50
|
+
compiling by hand, give it as an option to `./configure`:
|
51
|
+
|
52
|
+
./configure --with-readline-dir=$(brew --prefix readline)
|
53
|
+
|
54
|
+
If you use rbenv, check out the [rbenv-readline][] plugin to automatically
|
55
|
+
pass this option when compiling. If you're using RVM, you can set configure
|
56
|
+
options in your `.rvmrc`:
|
57
|
+
|
58
|
+
echo rvm_configure_flags=--with-readline-dir=$(brew --prefix readline) \
|
59
|
+
>> ~/.rvmrc
|
60
|
+
|
61
|
+
[Homebrew]: http://mxcl.github.com/homebrew/
|
62
|
+
[rbenv-readline]: https://github.com/tpope/rbenv-readline
|
80
63
|
|
81
64
|
> It's not working with `rails console`/my Bundler setup.
|
82
65
|
|
83
|
-
|
84
|
-
|
66
|
+
If you can't/won't add it to your `Gemfile`, try this hack in your `.pryrc`:
|
67
|
+
|
68
|
+
Gem.path.each do |gemset|
|
69
|
+
$:.concat(Dir.glob("#{gemset}/gems/pry-*/lib"))
|
70
|
+
end if defined?(Bundler)
|
71
|
+
$:.uniq!
|
72
|
+
require 'pry-editline'
|
85
73
|
|
86
|
-
|
74
|
+
Let me know if you come up with something better.
|
87
75
|
|
88
76
|
> How does it work?
|
89
77
|
|
90
78
|
Well first, it overrides `ENV['INPUTRC']` so it can do some magic. And
|
91
79
|
then, it does some magic!
|
92
80
|
|
93
|
-
Self Promotion
|
94
|
-
--------------
|
81
|
+
## Self Promotion
|
95
82
|
|
96
83
|
Follow [tpope](http://tpo.pe/) on [GitHub](https://github.com/tpope),
|
97
84
|
[Twitter](http://twitter.com/tpope), and [Google+](http://tpo.pe/plus).
|
98
85
|
|
99
|
-
License
|
100
|
-
-------
|
86
|
+
## License
|
101
87
|
|
102
88
|
Copyright (c) Tim Pope. MIT License.
|
data/lib/pry-editline.rb
CHANGED
@@ -48,7 +48,9 @@ EOF
|
|
48
48
|
|
49
49
|
def self.completion_proc
|
50
50
|
lambda do |s|
|
51
|
-
if Readline.point
|
51
|
+
if Readline.respond_to?(:point) && Readline.respond_to?(:line_buffer) &&
|
52
|
+
Readline.point == 0 && Readline.line_buffer =~ / $/
|
53
|
+
then
|
52
54
|
require 'tempfile'
|
53
55
|
Tempfile.open(['readline-','.rb']) do |f|
|
54
56
|
f.puts(Readline.line_buffer[0..-3])
|
@@ -66,7 +68,11 @@ end
|
|
66
68
|
|
67
69
|
if defined?(Pry::InputCompleter)
|
68
70
|
PryEditline.hijack_inputrc
|
69
|
-
|
71
|
+
# Pry 0.9.10 way:
|
72
|
+
completer = Pry::InputCompleter
|
73
|
+
# Pry >0.9.10 way:
|
74
|
+
completer = Pry.config.completer if Pry.config.respond_to? :completer
|
75
|
+
class << completer
|
70
76
|
unless method_defined?(:build_completion_proc_without_edit)
|
71
77
|
alias build_completion_proc_without_edit build_completion_proc
|
72
78
|
|
data/pry-editline.gemspec
CHANGED
@@ -3,9 +3,9 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = 'pry-editline'
|
6
|
-
s.version = '1.1.
|
6
|
+
s.version = '1.1.2'
|
7
7
|
s.authors = ['Tim Pope']
|
8
|
-
s.email = ["
|
8
|
+
s.email = ["code@tpop"+'e.net']
|
9
9
|
s.homepage = 'https://github.com/tpope/pry-editline'
|
10
10
|
s.summary = 'C-x C-e to invoke an editor on the current pry (or irb) line'
|
11
11
|
|
metadata
CHANGED
@@ -1,30 +1,32 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pry-editline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.1.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Tim Pope
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2013-03-02 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rake
|
16
|
-
requirement:
|
17
|
-
none: false
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
|
-
version_requirements:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
25
27
|
description:
|
26
28
|
email:
|
27
|
-
-
|
29
|
+
- code@tpope.net
|
28
30
|
executables: []
|
29
31
|
extensions: []
|
30
32
|
extra_rdoc_files: []
|
@@ -38,26 +40,26 @@ files:
|
|
38
40
|
- pry-editline.gemspec
|
39
41
|
homepage: https://github.com/tpope/pry-editline
|
40
42
|
licenses: []
|
43
|
+
metadata: {}
|
41
44
|
post_install_message:
|
42
45
|
rdoc_options: []
|
43
46
|
require_paths:
|
44
47
|
- lib
|
45
48
|
required_ruby_version: !ruby/object:Gem::Requirement
|
46
|
-
none: false
|
47
49
|
requirements:
|
48
|
-
- -
|
50
|
+
- - '>='
|
49
51
|
- !ruby/object:Gem::Version
|
50
52
|
version: '0'
|
51
53
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
52
|
-
none: false
|
53
54
|
requirements:
|
54
|
-
- -
|
55
|
+
- - '>='
|
55
56
|
- !ruby/object:Gem::Version
|
56
57
|
version: '0'
|
57
58
|
requirements: []
|
58
59
|
rubyforge_project:
|
59
|
-
rubygems_version:
|
60
|
+
rubygems_version: 2.0.0
|
60
61
|
signing_key:
|
61
|
-
specification_version:
|
62
|
+
specification_version: 4
|
62
63
|
summary: C-x C-e to invoke an editor on the current pry (or irb) line
|
63
64
|
test_files: []
|
65
|
+
has_rdoc:
|