jazz_hands 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.
- data/.gitignore +17 -0
- data/.rbenv-version +1 -0
- data/Gemfile +3 -0
- data/LICENSE +20 -0
- data/Rakefile +3 -0
- data/jazz_hands.gemspec +27 -0
- data/lib/jazz_hands.rb +2 -0
- data/lib/jazz_hands/railtie.rb +55 -0
- data/lib/jazz_hands/version.rb +3 -0
- metadata +122 -0
data/.gitignore
ADDED
data/.rbenv-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.9.3-p0
|
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/Rakefile
ADDED
data/jazz_hands.gemspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
require File.expand_path('../lib/jazz_hands/version', __FILE__)
|
4
|
+
|
5
|
+
Gem::Specification.new do |gem|
|
6
|
+
gem.name = 'jazz_hands'
|
7
|
+
gem.version = JazzHands::VERSION
|
8
|
+
gem.authors = ['Gopal Patel']
|
9
|
+
gem.email = ['nixme@stillhope.com']
|
10
|
+
gem.summary = 'Exercise those fingers. Pry-based enhancements for the default Rails console.'
|
11
|
+
gem.homepage = 'https://github.com/nixme/jazz_hands'
|
12
|
+
gem.description = "Spending hours in the rails console? Spruce it up and show off those hard-working hands! jazz_hands replaces IRB with Pry, improves output through awesome_print and has some other goodies up it's sleeve."
|
13
|
+
|
14
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
15
|
+
gem.files = `git ls-files`.split("\n")
|
16
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
17
|
+
gem.require_paths = ['lib']
|
18
|
+
|
19
|
+
# Dependencies
|
20
|
+
gem.required_ruby_version = '>= 1.9.2'
|
21
|
+
gem.add_runtime_dependency 'pry', ['~> 0.9.7.4']
|
22
|
+
gem.add_runtime_dependency 'pry-git', ['~> 0.2.2']
|
23
|
+
gem.add_runtime_dependency 'pry-remote', ['>= 0.1.0']
|
24
|
+
gem.add_runtime_dependency 'coolline', ['>= 0.1.0']
|
25
|
+
gem.add_runtime_dependency 'coderay', ['>= 0.9.8']
|
26
|
+
gem.add_runtime_dependency 'awesome_print', ['~> 0.4.0']
|
27
|
+
end
|
data/lib/jazz_hands.rb
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'pry'
|
2
|
+
require 'coolline' if RUBY_VERSION >= '1.9.3'
|
3
|
+
require 'coderay'
|
4
|
+
require 'awesome_print'
|
5
|
+
|
6
|
+
module JazzHands
|
7
|
+
class Railtie < Rails::Railtie
|
8
|
+
initializer 'jazz_hands.initialize' do |app|
|
9
|
+
silence_warnings do
|
10
|
+
::IRB = Pry # Replace IRB with Pry completely
|
11
|
+
|
12
|
+
# Use coolline with CodeRay for syntax highlighting as you type
|
13
|
+
# Only works on >= 1.9.3 because coolline depends on io/console
|
14
|
+
if RUBY_VERSION >= '1.9.3'
|
15
|
+
Pry.config.input = Coolline.new do |c|
|
16
|
+
c.transform_proc = proc do
|
17
|
+
CodeRay.scan(c.line, :ruby).term
|
18
|
+
end
|
19
|
+
|
20
|
+
c.completion_proc = proc do
|
21
|
+
word = c.completed_word
|
22
|
+
Object.constants.map(&:to_s).select { |w| w.start_with? word }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
# Use awesome_print for output, but keep pry's pager
|
28
|
+
Pry.config.print = ->(output, value) do
|
29
|
+
pretty = value.ai(indent: 2)
|
30
|
+
Pry::Helpers::BaseHelpers.stagger_output("=> #{pretty}", output)
|
31
|
+
end
|
32
|
+
|
33
|
+
# Friendlier prompt - nesting levels look like directory paths
|
34
|
+
name = app.class.parent_name.underscore
|
35
|
+
colored_name = Pry::Helpers::Text.blue(name)
|
36
|
+
raquo = Pry::Helpers::Text.red("\u00BB")
|
37
|
+
target_string = ->(object, level) do
|
38
|
+
unless (string = Pry.view_clip(object)) == 'main'
|
39
|
+
"(#{'../' * level}#{string})"
|
40
|
+
else
|
41
|
+
''
|
42
|
+
end
|
43
|
+
end
|
44
|
+
Pry.config.prompt = [
|
45
|
+
->(object, level, _) do
|
46
|
+
"#{colored_name}#{target_string.(object, level)} #{raquo} "
|
47
|
+
end,
|
48
|
+
->(object, level, _) do
|
49
|
+
"#{' ' * (name.size + target_string.(object, level).size)} #{raquo} "
|
50
|
+
end
|
51
|
+
]
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
metadata
ADDED
@@ -0,0 +1,122 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jazz_hands
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Gopal Patel
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-11-25 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: pry
|
16
|
+
requirement: &70303753588620 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.9.7.4
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70303753588620
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: pry-git
|
27
|
+
requirement: &70303753588080 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ~>
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 0.2.2
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70303753588080
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: pry-remote
|
38
|
+
requirement: &70303753587420 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 0.1.0
|
44
|
+
type: :runtime
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70303753587420
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: coolline
|
49
|
+
requirement: &70303753586780 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.1.0
|
55
|
+
type: :runtime
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *70303753586780
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: coderay
|
60
|
+
requirement: &70303753586220 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: 0.9.8
|
66
|
+
type: :runtime
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *70303753586220
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: awesome_print
|
71
|
+
requirement: &70303753585520 !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ~>
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 0.4.0
|
77
|
+
type: :runtime
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: *70303753585520
|
80
|
+
description: Spending hours in the rails console? Spruce it up and show off those
|
81
|
+
hard-working hands! jazz_hands replaces IRB with Pry, improves output through awesome_print
|
82
|
+
and has some other goodies up it's sleeve.
|
83
|
+
email:
|
84
|
+
- nixme@stillhope.com
|
85
|
+
executables: []
|
86
|
+
extensions: []
|
87
|
+
extra_rdoc_files: []
|
88
|
+
files:
|
89
|
+
- .gitignore
|
90
|
+
- .rbenv-version
|
91
|
+
- Gemfile
|
92
|
+
- LICENSE
|
93
|
+
- Rakefile
|
94
|
+
- jazz_hands.gemspec
|
95
|
+
- lib/jazz_hands.rb
|
96
|
+
- lib/jazz_hands/railtie.rb
|
97
|
+
- lib/jazz_hands/version.rb
|
98
|
+
homepage: https://github.com/nixme/jazz_hands
|
99
|
+
licenses: []
|
100
|
+
post_install_message:
|
101
|
+
rdoc_options: []
|
102
|
+
require_paths:
|
103
|
+
- lib
|
104
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 1.9.2
|
110
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
|
+
none: false
|
112
|
+
requirements:
|
113
|
+
- - ! '>='
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: '0'
|
116
|
+
requirements: []
|
117
|
+
rubyforge_project:
|
118
|
+
rubygems_version: 1.8.11
|
119
|
+
signing_key:
|
120
|
+
specification_version: 3
|
121
|
+
summary: Exercise those fingers. Pry-based enhancements for the default Rails console.
|
122
|
+
test_files: []
|