rack-webconsole-pry 0.1.5 → 0.1.6
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/Gemfile.lock +1 -1
- data/Readme.md +5 -5
- data/lib/rack/webconsole/repl.rb +5 -1
- data/lib/rack/webconsole/version.rb +1 -1
- data/public/webconsole.js +1 -1
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/Readme.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
#rack-webconsole [](http://travis-ci.org/mrbrdo/rack-webconsole.png)
|
1
|
+
#rack-webconsole-pry [](http://travis-ci.org/mrbrdo/rack-webconsole.png)
|
2
2
|
|
3
|
-
|
3
|
+
rack-webconsole-pry is a Rack-based interactive console (à la Rails console) in
|
4
4
|
your web application's frontend. That means you can interact with your
|
5
5
|
application's backend from within the browser itself!
|
6
6
|
|
@@ -8,7 +8,7 @@ To get a clearer idea, you can check out this video showing a live example :)
|
|
8
8
|
|
9
9
|
[](http://youtu.be/yKK5J01Dqts?hd=1)
|
10
10
|
|
11
|
-
|
11
|
+
rack-webconsole-pry is a Rack middleware designed to be unobtrusive. With Rails 3,
|
12
12
|
for example, you only have to include the gem in your Gemfile and it already
|
13
13
|
works. Without any configuration.
|
14
14
|
|
@@ -37,9 +37,9 @@ In your Gemfile:
|
|
37
37
|
gem 'rack-webconsole-pry', :require => 'rack-webconsole'
|
38
38
|
```
|
39
39
|
|
40
|
-
|
40
|
+
rack-webconsole-pry **needs JQuery**. If you are using Rails 3, JQuery is loaded by
|
41
41
|
default. In case you don't want to use JQuery in your application,
|
42
|
-
**rack-webconsole can inject it for you** only when it needs it. To do that you
|
42
|
+
**rack-webconsole-pry can inject it for you** only when it needs it. To do that you
|
43
43
|
should put this line somewhere in your application (a Rails initializer, or
|
44
44
|
some configuration file):
|
45
45
|
|
data/lib/rack/webconsole/repl.rb
CHANGED
@@ -78,7 +78,11 @@ module Rack
|
|
78
78
|
pry = $pry
|
79
79
|
|
80
80
|
# repl loop
|
81
|
-
|
81
|
+
if pry.binding_stack.last
|
82
|
+
target = Pry.binding_for(pry.binding_stack.last)
|
83
|
+
else
|
84
|
+
target = Pry.binding_for(TOPLEVEL_BINDING)
|
85
|
+
end
|
82
86
|
pry.repl_prologue(target) unless pry.binding_stack.last == target
|
83
87
|
pry.inject_sticky_locals(target)
|
84
88
|
code = params['query']
|
data/public/webconsole.js
CHANGED
@@ -151,7 +151,7 @@
|
|
151
151
|
|
152
152
|
$(document).ready(function() {
|
153
153
|
$(this).keypress(function(event) {
|
154
|
-
if (event.which
|
154
|
+
if ($KEY_CODE.indexOf(event.which) >= 0) {
|
155
155
|
$("#rack-webconsole").slideToggle('fast', function() {
|
156
156
|
if ($(this).is(':visible')) {
|
157
157
|
$("#rack-webconsole form input").focus();
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-webconsole-pry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -203,7 +203,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
203
203
|
version: '0'
|
204
204
|
segments:
|
205
205
|
- 0
|
206
|
-
hash:
|
206
|
+
hash: 3719169181226662823
|
207
207
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
208
208
|
none: false
|
209
209
|
requirements:
|
@@ -212,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
212
212
|
version: '0'
|
213
213
|
segments:
|
214
214
|
- 0
|
215
|
-
hash:
|
215
|
+
hash: 3719169181226662823
|
216
216
|
requirements: []
|
217
217
|
rubyforge_project: rack-webconsole-pry
|
218
218
|
rubygems_version: 1.8.24
|