jazzhands 0.0.1
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.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +123 -0
- data/Gemfile +3 -0
- data/LICENSE +20 -0
- data/README.md +100 -0
- data/Rakefile +3 -0
- data/jazzhands.gemspec +33 -0
- data/lib/jazzhands.rb +66 -0
- data/lib/jazzhands/hirb_ext.rb +18 -0
- data/lib/jazzhands/railtie.rb +72 -0
- data/lib/jazzhands/version.rb +3 -0
- metadata +220 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2aa454095e77af750c0166099364e5a644d42f20
|
4
|
+
data.tar.gz: 82a27706513030b5fc11fd590bbfee395c32f15f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 29f85f814339e88aedd402fc1e0ddf3d5953713cbaab36b32001d614ef35533a025cb462847655513f492ace737cd35b5dac0b9faa7899f032c2c0b200eeaf37
|
7
|
+
data.tar.gz: 2ab71691010b194cd8c6a2901e5d636a2a9e691e66fc7b8e7dcda968fdb52178258080e3a1b9a5c668c5b1c3467e506a413744704fd55529f33946549e2cf348
|
data/.gitignore
ADDED
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
jazzhands
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.0.0
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,123 @@
|
|
1
|
+
## 0.5.2 (2013-10-24)
|
2
|
+
|
3
|
+
* Upgrade [pry-rails][pry-rails] to the latest 0.3.2,
|
4
|
+
[awesome_print][awesome_print] to 1.2 and loosen it's dependency, and removed
|
5
|
+
[coderay][coderay] as an explicit dependency since [pry][pry] already includes
|
6
|
+
it.
|
7
|
+
|
8
|
+
## 0.5.1 (2013-06-28)
|
9
|
+
|
10
|
+
* Upgrade [pry-rails][pry-rails] to the latest 0.3.1, [pry-doc][pry-doc] 0.4.6,
|
11
|
+
[coolline][coolline] 0.4.2.
|
12
|
+
|
13
|
+
|
14
|
+
## 0.5.0 (2013-03-13)
|
15
|
+
|
16
|
+
* Rails 4, Ruby 2.0.0 compatibility.
|
17
|
+
* Upgrade [pry][pry] to the latest 0.9.12,
|
18
|
+
[pry-stack_explorer][pry-stack_explorer] 0.4.9, [pry-remote][pry-remote]
|
19
|
+
0.1.7, [pry-debugger][pry-debugger] 0.2.2, [hirb][hirb] 0.7.1,
|
20
|
+
[coderay][coderay] 1.0.9.
|
21
|
+
|
22
|
+
|
23
|
+
## 0.4.0 (2012-12-27)
|
24
|
+
|
25
|
+
* Add [pry-rails][pry-rails] 0.2.2 for maintained console hooks and new
|
26
|
+
`show-routes`, `show-models`, and `show-middleware` commands.
|
27
|
+
* Add `JazzHands.colored_prompt` and `JazzHands.prompt_separator` options.
|
28
|
+
Detect readline library to turn off incompatible colored prompt or Unicode
|
29
|
+
prompt separator where appropriate. Fixes #1 and #2.
|
30
|
+
* Upgrade [pry][pry] to the latest 0.9.10, [pry-doc][pry-doc] 0.4.4,
|
31
|
+
[pry-stack_explorer][pry-stack_explorer] 0.4.7, [pry-remote][pry-remote]
|
32
|
+
0.1.6, [pry-debugger][pry-debugger] 0.2.1, [hirb][hirb] 0.7.0,
|
33
|
+
[Coolline][coolline] 0.4.0, [coderay][coderay] 1.0.8,
|
34
|
+
[awesome_print][awesome_print] 1.1.0. Fixes #4.
|
35
|
+
|
36
|
+
## 0.3.1 (2012-06-11)
|
37
|
+
|
38
|
+
* Upgrade [pry-debugger][pry-debugger] to 0.2.0.
|
39
|
+
|
40
|
+
## 0.3.0 (2012-06-07)
|
41
|
+
|
42
|
+
* Replace [pry-nav][pry-nav] with [pry-debugger][pry-debugger] for improved
|
43
|
+
performance and no segfaults. `JazzHands.enable_pry_nav` removed.
|
44
|
+
* Upgrade [pry][pry] to the latest 0.9.9, [pry-doc][pry-doc] 0.4.2,
|
45
|
+
[pry-git][pry-git] 0.2.3, [pry-stack_explorer][pry-stack_explorer] 0.4.2,
|
46
|
+
[pry-remote][pry-remote] 0.1.4, [coderay][coderay] 1.0.6.
|
47
|
+
|
48
|
+
## 0.2.0 (2012-03-19)
|
49
|
+
|
50
|
+
* Add [pry-stack_explorer][pry-stack_explorer] 0.4.1.
|
51
|
+
* Upgrade [pry-remote][pry-remote] to 0.1.1 and [pry-nav][pry-nav] to 0.2.0.
|
52
|
+
* Upgrade recommended gem minor versions: [pry][pry] 0.9.8.4, [pry-doc][pry-doc]
|
53
|
+
0.4.1, [hirb][hirb] 0.6.2, and [coderay][coderay] 1.0.5.
|
54
|
+
|
55
|
+
## 0.1.2 (2012-01-23)
|
56
|
+
|
57
|
+
* Improved Rails 3.2 compatibility. Console methods like `app`, `new_session`,
|
58
|
+
`reload!`, `helper`, and `controller` work as expected.
|
59
|
+
|
60
|
+
## 0.1.1 (2012-01-20)
|
61
|
+
|
62
|
+
* Rails 3.2 compatibility
|
63
|
+
|
64
|
+
## 0.1.0 (2012-01-04)
|
65
|
+
|
66
|
+
* For performance, enable [pry-nav][pry-nav] only on MRI 1.9.3 by default. To
|
67
|
+
use on MRI 1.9.2, add `JazzHands.enable_pry_nav` to a Rails initializer.
|
68
|
+
* Due to buggy behavior, syntax highlighting as you type via
|
69
|
+
[Coolline][coolline] and [Coderay][coderay] is disabled by default. Enable
|
70
|
+
with `JazzHands.enable_syntax_highlighting_as_you_type` in a Rails
|
71
|
+
initializer. MRI 1.9.3 only.
|
72
|
+
* Fix [Hirb][hirb] support.
|
73
|
+
* Upgrade [awesome_print][awesome_print] to 1.0.2.
|
74
|
+
|
75
|
+
## 0.0.6 (2011-12-03)
|
76
|
+
|
77
|
+
* Add line numbers to the prompt for easy reference when using `_in_` and
|
78
|
+
`_out`.
|
79
|
+
* Upgrade [pry-nav][pry-nav] to 0.0.4.
|
80
|
+
|
81
|
+
|
82
|
+
## 0.0.5 (2011-12-01)
|
83
|
+
|
84
|
+
* Add [Hirb][hirb] support. Enable with `Hirb.enable` in the console.
|
85
|
+
* Upgrade [pry-nav][pry-nav] to 0.0.3.
|
86
|
+
|
87
|
+
|
88
|
+
## 0.0.4 (2011-11-30)
|
89
|
+
|
90
|
+
* Add explicit requires for pry plugin gems.
|
91
|
+
|
92
|
+
|
93
|
+
## 0.0.3 (2011-11-30)
|
94
|
+
|
95
|
+
* Add [pry-nav][pry-nav].
|
96
|
+
* Upgrade [awesome_print][awesome_print] to 1.0.1.
|
97
|
+
|
98
|
+
|
99
|
+
## 0.0.2 (2011-11-25)
|
100
|
+
|
101
|
+
* Add [pry-doc][pry-doc].
|
102
|
+
|
103
|
+
|
104
|
+
## 0.0.1 (2011-11-25)
|
105
|
+
|
106
|
+
* First release. Combine [pry][pry], [awesome_print][awesome_print],
|
107
|
+
[coolline][coolline] + [coderay][coderay], [pry-remote][pry-remote],
|
108
|
+
[pry-git][pry-git]. Bit of glue to replace IRB with pry in Rails console,
|
109
|
+
pretty colors.
|
110
|
+
|
111
|
+
|
112
|
+
[pry]: http://pry.github.com
|
113
|
+
[awesome_print]: https://github.com/michaeldv/awesome_print
|
114
|
+
[pry-doc]: https://github.com/pry/pry-doc
|
115
|
+
[pry-git]: https://github.com/pry/pry-git
|
116
|
+
[pry-nav]: https://github.com/nixme/pry-nav
|
117
|
+
[pry-remote]: https://github.com/Mon-Ouie/pry-remote
|
118
|
+
[coolline]: https://github.com/Mon-Ouie/coolline
|
119
|
+
[coderay]: https://github.com/rubychan/coderay
|
120
|
+
[hirb]: https://github.com/cldwalker/hirb
|
121
|
+
[pry-stack_explorer]: https://github.com/pry/pry-stack_explorer
|
122
|
+
[pry-debugger]: https://github.com/nixme/pry-debugger
|
123
|
+
[pry-rails]: https://github.com/rweng/pry-rails
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
MIT License
|
2
|
+
Copyright (C) 2011 by Gopal Patel
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
6
|
+
in the Software without restriction, including without limitation the rights
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
9
|
+
furnished to do so, subject to the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be included in
|
12
|
+
all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
Jazz Hands [](https://bitdeli.com/free "Bitdeli Badge")
|
2
|
+
==========
|
3
|
+
|
4
|
+
Spending hours in the rails console? Spruce it up and show off those
|
5
|
+
hard-working hands!
|
6
|
+
|
7
|
+
**jazz_hands** is an opinionated set of console-related gems and a bit of glue:
|
8
|
+
|
9
|
+
* [**Pry**][pry] for a powerful shell alternative to IRB.
|
10
|
+
* [**Awesome Print**][awesome_print] for stylish pretty print.
|
11
|
+
* [**Hirb**][hirb] for tabular collection output.
|
12
|
+
* [**Pry Rails**][pry-rails] for additional commands (`show-routes`,
|
13
|
+
`show-models`, `show-middleware`) in the Rails console.
|
14
|
+
* [**Pry Doc**][pry-doc] to browse Ruby source, including C, directly from the
|
15
|
+
console.
|
16
|
+
* [**Pry Git**][pry-git] to teach the console about git. Diffs, blames, and
|
17
|
+
commits on methods and classes, not just files.
|
18
|
+
* [**Pry Remote**][pry-remote] to connect remotely to a Pry console.
|
19
|
+
* [**Pry Debugger**][pry-debugger] to turn the console into a simple debugger.
|
20
|
+
* [**Pry Stack Explorer**][pry-stack_explorer] to navigate the call stack and
|
21
|
+
frames.
|
22
|
+
* [**Coolline**][coolline] and [**Coderay**][coderay] for syntax highlighting as
|
23
|
+
you type. _Optional. MRI 1.9.3/2.0.0 only_
|
24
|
+
|
25
|
+
|
26
|
+
## Usage
|
27
|
+
|
28
|
+
Ruby 1.9.2+, Rails 3 or 4 only. Add to your project Gemfile:
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
group :development, :test do
|
32
|
+
gem 'jazz_hands'
|
33
|
+
end
|
34
|
+
```
|
35
|
+
|
36
|
+
That's it. Run `rails console` as usual.
|
37
|
+
|
38
|
+
[Hirb][hirb] isn't enabled by default. To use, run `Hirb.enable` in the console.
|
39
|
+
|
40
|
+
Ruby compiled against a proper readline library, ideally GNU readline, is
|
41
|
+
recommended. Alternatively, [`gem install rb-readline`][rb-readline] for an
|
42
|
+
acceptible backup. Using ruby compiled against a `libedit` wrapper (primarily OS
|
43
|
+
X) will work but is not recommended.
|
44
|
+
|
45
|
+
|
46
|
+
## Options
|
47
|
+
|
48
|
+
Change the following options by creating an initializer in your Rails project
|
49
|
+
Example `config/initializers/jazz_hands.rb`:
|
50
|
+
|
51
|
+
```ruby
|
52
|
+
if defined?(JazzHands)
|
53
|
+
JazzHands.colored_prompt = false
|
54
|
+
JazzHands.enable_syntax_highlighting_as_you_type!
|
55
|
+
end
|
56
|
+
```
|
57
|
+
|
58
|
+
### `colored_prompt`
|
59
|
+
|
60
|
+
Color the console prompt? Defaults to `true` when the current ruby is compiled
|
61
|
+
against GNU readline or `rb-readline`, which don't have issues counting
|
62
|
+
characters in colored prompts. `false` for libedit.
|
63
|
+
|
64
|
+
Note: `Pry.color = false` trumps this setting and disables all console coloring.
|
65
|
+
|
66
|
+
### `prompt_separator`
|
67
|
+
|
68
|
+
Separator string between the application name and line input. Defaults to `»`
|
69
|
+
for GNU readline or libedit. Defaults to `>` for `rb-readline` which fails on
|
70
|
+
mixed encodings.
|
71
|
+
|
72
|
+
### Syntax highlighting
|
73
|
+
|
74
|
+
Syntax highlighting as you type via [Coolline][coolline] and [Coderay][coderay]
|
75
|
+
is disabled by default due to slightly buggy behavior. To enable, add
|
76
|
+
`JazzHands.enable_syntax_highlighting_as_you_type!` to the initializer. Only
|
77
|
+
works with MRI 1.9.3 or 2.0.0.
|
78
|
+
|
79
|
+
|
80
|
+
## Contributing
|
81
|
+
|
82
|
+
Patches and bug reports are welcome. Just send a [pull request][pullrequests] or
|
83
|
+
file an [issue][issues]. [Project changelog][changelog].
|
84
|
+
|
85
|
+
|
86
|
+
[pry]: http://pry.github.com
|
87
|
+
[awesome_print]: https://github.com/michaeldv/awesome_print
|
88
|
+
[hirb]: https://github.com/cldwalker/hirb
|
89
|
+
[pry-rails]: https://github.com/rweng/pry-rails
|
90
|
+
[pry-doc]: https://github.com/pry/pry-doc
|
91
|
+
[pry-git]: https://github.com/pry/pry-git
|
92
|
+
[pry-debugger]: https://github.com/nixme/pry-debugger
|
93
|
+
[pry-remote]: https://github.com/Mon-Ouie/pry-remote
|
94
|
+
[pry-stack_explorer]: https://github.com/pry/pry-stack_explorer
|
95
|
+
[coolline]: https://github.com/Mon-Ouie/coolline
|
96
|
+
[coderay]: https://github.com/rubychan/coderay
|
97
|
+
[rb-readline]: https://github.com/luislavena/rb-readline
|
98
|
+
[pullrequests]: https://github.com/nixme/jazz_hands/pulls
|
99
|
+
[issues]: https://github.com/nixme/jazz_hands/issues
|
100
|
+
[changelog]: https://github.com/nixme/jazz_hands/blob/master/CHANGELOG.md
|
data/Rakefile
ADDED
data/jazzhands.gemspec
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
require File.expand_path('../lib/jazzhands/version', __FILE__)
|
4
|
+
|
5
|
+
Gem::Specification.new do |gem|
|
6
|
+
gem.name = 'jazzhands'
|
7
|
+
gem.version = Jazzhands::VERSION
|
8
|
+
gem.author = 'David Davis'
|
9
|
+
gem.email = 'david@memorious.net'
|
10
|
+
gem.license = 'MIT'
|
11
|
+
gem.homepage = 'https://github.com/daviddavis/jazzhands'
|
12
|
+
gem.summary = 'Exercise those fingers. Pry-based enhancements for the default Rails console. Based on the jazz_hands gem but updated for ruby 2.0 and 2.1.'
|
13
|
+
gem.description = "Spending hours in the rails console? Spruce it up and show off those hard-working hands! jazzhands replaces IRB with Pry, improves output through awesome_print, and has some other goodies up its sleeves."
|
14
|
+
|
15
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
16
|
+
gem.files = `git ls-files`.split("\n")
|
17
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
gem.require_paths = ['lib']
|
19
|
+
|
20
|
+
# Dependencies
|
21
|
+
gem.required_ruby_version = '>= 2.0'
|
22
|
+
gem.add_runtime_dependency 'pry'
|
23
|
+
gem.add_runtime_dependency 'pry-rails'
|
24
|
+
gem.add_runtime_dependency 'pry-doc'
|
25
|
+
gem.add_runtime_dependency 'pry-git'
|
26
|
+
gem.add_runtime_dependency 'pry-stack_explorer'
|
27
|
+
gem.add_runtime_dependency 'pry-remote', '>= 0.1.7'
|
28
|
+
gem.add_runtime_dependency 'pry-byebug'
|
29
|
+
gem.add_runtime_dependency 'hirb'
|
30
|
+
gem.add_runtime_dependency 'coolline'
|
31
|
+
gem.add_runtime_dependency 'awesome_print'
|
32
|
+
gem.add_runtime_dependency 'railties', '>= 3.0', '< 5.0'
|
33
|
+
end
|
data/lib/jazzhands.rb
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
require 'jazzhands/version'
|
2
|
+
require 'jazzhands/railtie' if defined?(Rails)
|
3
|
+
require 'active_support'
|
4
|
+
require 'readline'
|
5
|
+
|
6
|
+
module Jazzhands
|
7
|
+
|
8
|
+
### Options ###
|
9
|
+
|
10
|
+
# Color the prompt?
|
11
|
+
#
|
12
|
+
# A different setting than Pry.color since some may like colored output, but a
|
13
|
+
# plain prompt.
|
14
|
+
#
|
15
|
+
# Default: 'true' for GNU readline or rb-readline which correctly count line
|
16
|
+
# widths with color codes when using \001 and \002 hints. 'false' for
|
17
|
+
# libedit-based wrapper (standard on OS X unless ruby is explicitly compiled
|
18
|
+
# otherwise).
|
19
|
+
#
|
20
|
+
mattr_accessor :colored_prompt
|
21
|
+
self.colored_prompt = (Readline::VERSION !~ /EditLine/)
|
22
|
+
|
23
|
+
# Separator between application name and input in the prompt.
|
24
|
+
#
|
25
|
+
# Default: right angle quote, or '>' when using rb-readline which doesn't
|
26
|
+
# handle mixed encodings well.
|
27
|
+
#
|
28
|
+
mattr_accessor :prompt_separator
|
29
|
+
self.prompt_separator = defined?(RbReadline) ? '>' : "\u00BB"
|
30
|
+
|
31
|
+
|
32
|
+
class << self
|
33
|
+
# Enable syntax highlighting as you type in the Rails console via coolline and
|
34
|
+
# coderay (MRI 1.9.3+ only). Disabled by default as it's a bit buggy.
|
35
|
+
#
|
36
|
+
# Call from a Rails initializer:
|
37
|
+
#
|
38
|
+
# Jazzhands.enable_syntax_highlighting_as_you_type!
|
39
|
+
#
|
40
|
+
def enable_syntax_highlighting_as_you_type!
|
41
|
+
raise 'Syntax highlighting only supported on 1.9.3+' unless RUBY_VERSION >= '1.9.3'
|
42
|
+
|
43
|
+
# Use coolline with CodeRay for syntax highlighting as you type.
|
44
|
+
# Only works on >= 1.9.3 because coolline depends on io/console.
|
45
|
+
|
46
|
+
require 'coolline'
|
47
|
+
require 'coderay'
|
48
|
+
|
49
|
+
Pry.config.input = Coolline.new do |c|
|
50
|
+
c.transform_proc = proc do
|
51
|
+
CodeRay.scan(c.line, :ruby).term
|
52
|
+
end
|
53
|
+
|
54
|
+
c.completion_proc = proc do
|
55
|
+
word = c.completed_word
|
56
|
+
Object.constants.map(&:to_s).select { |w| w.start_with? word }
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
alias :enable_syntax_highlighting_as_you_type :enable_syntax_highlighting_as_you_type!
|
61
|
+
end
|
62
|
+
|
63
|
+
### Internal methods ###
|
64
|
+
|
65
|
+
mattr_accessor :_hirb_output
|
66
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'hirb'
|
2
|
+
require 'pry'
|
3
|
+
|
4
|
+
class << Hirb::View
|
5
|
+
alias_method :enable_output_method_existing, :enable_output_method
|
6
|
+
alias_method :disable_output_method_existing, :disable_output_method
|
7
|
+
|
8
|
+
def enable_output_method
|
9
|
+
@output_method = true
|
10
|
+
Jazzhands._hirb_output = true
|
11
|
+
enable_output_method_existing
|
12
|
+
end
|
13
|
+
|
14
|
+
def disable_output_method
|
15
|
+
Jazzhands._hirb_output = false
|
16
|
+
disable_output_method_existing
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require 'pry'
|
2
|
+
require 'pry-rails'
|
3
|
+
require 'pry-doc'
|
4
|
+
require 'pry-git'
|
5
|
+
require 'pry-remote'
|
6
|
+
require 'pry-stack_explorer'
|
7
|
+
require 'awesome_print'
|
8
|
+
require 'jazz_hands/hirb_ext'
|
9
|
+
require 'pry-debugger'
|
10
|
+
|
11
|
+
|
12
|
+
module Jazzhands
|
13
|
+
class Railtie < Rails::Railtie
|
14
|
+
initializer 'jazz_hands.initialize' do |app|
|
15
|
+
silence_warnings do
|
16
|
+
# We're managing the loading of plugins. So don't let pry autoload them.
|
17
|
+
Pry.config.should_load_plugins = false
|
18
|
+
|
19
|
+
# Use awesome_print for output, but keep pry's pager. If Hirb is
|
20
|
+
# enabled, try printing with it first.
|
21
|
+
Pry.config.print = ->(output, value) do
|
22
|
+
return if Jazzhands._hirb_output && Hirb::View.view_or_page_output(value)
|
23
|
+
pretty = value.ai(indent: 2)
|
24
|
+
Pry::Helpers::BaseHelpers.stagger_output("=> #{pretty}", output)
|
25
|
+
end
|
26
|
+
|
27
|
+
# Friendlier prompt - line number, app name, nesting levels look like
|
28
|
+
# directory paths.
|
29
|
+
#
|
30
|
+
# Heavy use of lazy lambdas so configuration (like Pry.color) can be
|
31
|
+
# changed later or even during console usage.
|
32
|
+
#
|
33
|
+
# Custom color helpers using hints \001 and \002 so that good readline
|
34
|
+
# libraries (GNU, rb-readline) correctly ignore color codes when
|
35
|
+
# calculating line length.
|
36
|
+
|
37
|
+
color = -> { Pry.color && Jazzhands.colored_prompt }
|
38
|
+
red = ->(text) { color[] ? "\001\e[0;31m\002#{text}\001\e[0m\002" : text.to_s }
|
39
|
+
blue = ->(text) { color[] ? "\001\e[0;34m\002#{text}\001\e[0m\002" : text.to_s }
|
40
|
+
bold = ->(text) { color[] ? "\001\e[1m\002#{text}\001\e[0m\002" : text.to_s }
|
41
|
+
|
42
|
+
separator = -> { red.(Jazzhands.prompt_separator) }
|
43
|
+
name = app.class.parent_name.underscore
|
44
|
+
colored_name = -> { blue.(name) }
|
45
|
+
|
46
|
+
line = ->(pry) { "[#{bold.(pry.input_array.size)}] " }
|
47
|
+
target_string = ->(object, level) do
|
48
|
+
level = 0 if level < 0
|
49
|
+
unless (string = Pry.view_clip(object)) == 'main'
|
50
|
+
"(#{'../' * level}#{string})"
|
51
|
+
else
|
52
|
+
''
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
Pry.config.prompt = [
|
57
|
+
->(object, level, pry) do # Main prompt
|
58
|
+
"#{line.(pry)}#{colored_name.()}#{target_string.(object, level)} #{separator.()} "
|
59
|
+
end,
|
60
|
+
->(object, level, pry) do # Wait prompt in multiline input
|
61
|
+
spaces = ' ' * (
|
62
|
+
"[#{pry.input_array.size}] ".size + # Uncolored `line.(pry)`
|
63
|
+
name.size +
|
64
|
+
target_string.(object, level).size
|
65
|
+
)
|
66
|
+
"#{spaces} #{separator.()} "
|
67
|
+
end
|
68
|
+
]
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
metadata
ADDED
@@ -0,0 +1,220 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jazzhands
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- David Davis
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-11-26 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: pry
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pry-rails
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pry-doc
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry-git
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: pry-stack_explorer
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: pry-remote
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.1.7
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.1.7
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: pry-byebug
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: hirb
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: coolline
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - '>='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - '>='
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: awesome_print
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - '>='
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :runtime
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - '>='
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: railties
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - '>='
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '3.0'
|
160
|
+
- - <
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: '5.0'
|
163
|
+
type: :runtime
|
164
|
+
prerelease: false
|
165
|
+
version_requirements: !ruby/object:Gem::Requirement
|
166
|
+
requirements:
|
167
|
+
- - '>='
|
168
|
+
- !ruby/object:Gem::Version
|
169
|
+
version: '3.0'
|
170
|
+
- - <
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: '5.0'
|
173
|
+
description: Spending hours in the rails console? Spruce it up and show off those
|
174
|
+
hard-working hands! jazzhands replaces IRB with Pry, improves output through awesome_print,
|
175
|
+
and has some other goodies up its sleeves.
|
176
|
+
email: david@memorious.net
|
177
|
+
executables: []
|
178
|
+
extensions: []
|
179
|
+
extra_rdoc_files: []
|
180
|
+
files:
|
181
|
+
- .gitignore
|
182
|
+
- .ruby-gemset
|
183
|
+
- .ruby-version
|
184
|
+
- CHANGELOG.md
|
185
|
+
- Gemfile
|
186
|
+
- LICENSE
|
187
|
+
- README.md
|
188
|
+
- Rakefile
|
189
|
+
- jazzhands.gemspec
|
190
|
+
- lib/jazzhands.rb
|
191
|
+
- lib/jazzhands/hirb_ext.rb
|
192
|
+
- lib/jazzhands/railtie.rb
|
193
|
+
- lib/jazzhands/version.rb
|
194
|
+
homepage: https://github.com/daviddavis/jazzhands
|
195
|
+
licenses:
|
196
|
+
- MIT
|
197
|
+
metadata: {}
|
198
|
+
post_install_message:
|
199
|
+
rdoc_options: []
|
200
|
+
require_paths:
|
201
|
+
- lib
|
202
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
203
|
+
requirements:
|
204
|
+
- - '>='
|
205
|
+
- !ruby/object:Gem::Version
|
206
|
+
version: '2.0'
|
207
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
208
|
+
requirements:
|
209
|
+
- - '>='
|
210
|
+
- !ruby/object:Gem::Version
|
211
|
+
version: '0'
|
212
|
+
requirements: []
|
213
|
+
rubyforge_project:
|
214
|
+
rubygems_version: 2.2.2
|
215
|
+
signing_key:
|
216
|
+
specification_version: 4
|
217
|
+
summary: Exercise those fingers. Pry-based enhancements for the default Rails console.
|
218
|
+
Based on the jazz_hands gem but updated for ruby 2.0 and 2.1.
|
219
|
+
test_files: []
|
220
|
+
has_rdoc:
|