rails-web-console 0.0.1 → 0.0.2
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/README.markdown +33 -0
- data/app/views/console/index.html.erb +1 -1
- data/lib/console.rb +3 -3
- data/public/javascripts/console.js +4 -0
- metadata +5 -5
- data/README +0 -12
data/README.markdown
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
Console
|
2
|
+
=======
|
3
|
+
|
4
|
+
A Rails 3 engine for running Ruby scripts on the browser in the context of a controller action.
|
5
|
+
|
6
|
+
You can install it as a gem or putting it in your vendor/plugins/console directory.
|
7
|
+
|
8
|
+
Installing as a Gem (preferred method)
|
9
|
+
-------------------------------------
|
10
|
+
|
11
|
+
In your Gemfile, put the dependency like this:
|
12
|
+
|
13
|
+
<pre>
|
14
|
+
gem 'rails-web-console', :require => 'console', :group => :development
|
15
|
+
</pre>
|
16
|
+
|
17
|
+
If you intend to use this in production environment (strongly discouraged), be sure to protect console routes. Do it on your own risk!
|
18
|
+
|
19
|
+
Installing with a clone
|
20
|
+
-----------------------
|
21
|
+
|
22
|
+
Just put it in your vendor/plugins/console. For instance:
|
23
|
+
|
24
|
+
<pre>
|
25
|
+
git submodule add git://github.com/rosenfeld/rails-web-console.git vendor/plugins/console
|
26
|
+
</pre>
|
27
|
+
|
28
|
+
Usage
|
29
|
+
-----
|
30
|
+
|
31
|
+
Just access "/console" in your browser.
|
32
|
+
|
33
|
+
Copyright (c) 2010 [Rodrigo Rosenfeld Rosas], released under the MIT license
|
@@ -1,3 +1,3 @@
|
|
1
1
|
<textarea id="script" rows="10" cols="80"><%= session[:script] %></textarea>
|
2
|
-
<div><input type="button" value="Clear" id="clearResults" /><input type="button" value="Run" id="runScript" /></div>
|
2
|
+
<div><input type="button" value="Clear (Ctrl+Delete)" id="clearResults" /><input type="button" value="Run (Ctrl+Enter)" id="runScript" /></div>
|
3
3
|
<div id="results"></div>
|
data/lib/console.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Console
|
2
2
|
class Engine < Rails::Engine
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
initializer "static assets" do |app|
|
4
|
+
app.middleware.use ::ActionDispatch::Static, "#{root}/public"
|
5
|
+
end
|
6
6
|
end
|
7
7
|
end
|
@@ -5,4 +5,8 @@ jQuery(function($) {
|
|
5
5
|
$('<div/>').attr('class', 'console_result').html(data).appendTo('#results')
|
6
6
|
})
|
7
7
|
})
|
8
|
+
$('#script').keydown(function(ev) {
|
9
|
+
if (ev.ctrlKey && ev.keyCode == 13) $('#runScript').click() // Ctrl + Enter
|
10
|
+
if (ev.ctrlKey && ev.keyCode == 46) $('#clearResults').click() // Ctrl + Delete
|
11
|
+
})
|
8
12
|
})
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 2
|
9
|
+
version: 0.0.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Rodrigo Rosenfeld Rosas
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-11-
|
17
|
+
date: 2010-11-07 00:00:00 -02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|
@@ -25,7 +25,7 @@ executables: []
|
|
25
25
|
extensions: []
|
26
26
|
|
27
27
|
extra_rdoc_files:
|
28
|
-
- README
|
28
|
+
- README.markdown
|
29
29
|
files:
|
30
30
|
- app/controllers/console_controller.rb
|
31
31
|
- app/views/console/index.html.erb
|
@@ -34,7 +34,7 @@ files:
|
|
34
34
|
- lib/console.rb
|
35
35
|
- public/javascripts/console.js
|
36
36
|
- public/stylesheets/console.css
|
37
|
-
- README
|
37
|
+
- README.markdown
|
38
38
|
has_rdoc: true
|
39
39
|
homepage:
|
40
40
|
licenses: []
|
data/README
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
Console
|
2
|
-
=======
|
3
|
-
|
4
|
-
A Rails 3 plugin for running Ruby scripts on the browser in the context of a controller action.
|
5
|
-
|
6
|
-
Just put it in your vendor/plugins/console. For instance:
|
7
|
-
|
8
|
-
git submodule add git://github.com/rosenfeld/rails-web-console.git vendor/plugins/console
|
9
|
-
|
10
|
-
Then, access "/console" in your browser.
|
11
|
-
|
12
|
-
Copyright (c) 2010 [Rodrigo Rosenfeld Rosas], released under the MIT license
|