rack-webconsole 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,8 @@
2
2
  rvm:
3
3
  - 1.8.7 # (current default)
4
4
  - 1.9.2
5
+ - 1.9.3
5
6
  - ree
6
7
  - ruby-head
7
- - rbx
8
- - rbx-2.0
8
+ - rbx-18mode
9
+ - rbx-19mode
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rack-webconsole (0.1.3)
4
+ rack-webconsole (0.1.4)
5
5
  multi_json (~> 1.0.3)
6
6
  rack
7
7
  ripl (~> 0.5.1)
data/History CHANGED
@@ -1,3 +1,7 @@
1
+ === 0.1.4 / 2012-09-14
2
+
3
+ + Prepend custom context to the route (Tobias Crawley)
4
+
1
5
  === 0.1.3 / 2012-03-22
2
6
 
3
7
  + Make keycode configurable (Roger Leite)
@@ -39,7 +39,7 @@ module Rack
39
39
  Webconsole::Repl.request = Rack::Request.new(env)
40
40
 
41
41
  # Inject the html, css and js code to the view
42
- response_body.gsub!('</body>', "#{code}</body>")
42
+ response_body.gsub!('</body>', "#{code(env)}</body>")
43
43
 
44
44
  headers['Content-Length'] = response_body.bytesize.to_s
45
45
 
@@ -53,10 +53,13 @@ module Rack
53
53
  # secure.
54
54
  #
55
55
  # @return [String] the injectable code.
56
- def code
56
+ def code(env)
57
57
  html_code <<
58
58
  css_code <<
59
- render(js_code, :TOKEN => Webconsole::Repl.token, :KEY_CODE => Webconsole.key_code)
59
+ render(js_code,
60
+ :TOKEN => Webconsole::Repl.token,
61
+ :KEY_CODE => Webconsole.key_code,
62
+ :CONTEXT => env['SCRIPT_NAME'] || "")
60
63
  end
61
64
 
62
65
  private
@@ -2,6 +2,6 @@
2
2
  module Rack
3
3
  class Webconsole
4
4
  # rack-webconsole version number.
5
- VERSION = "0.1.3"
5
+ VERSION = "0.1.4"
6
6
  end
7
7
  end
@@ -24,7 +24,7 @@
24
24
  webconsole.history.push(webconsole.query.val());
25
25
  webconsole.pointer = webconsole.history.length - 1;
26
26
  $.ajax({
27
- url: '/webconsole',
27
+ url: '$CONTEXT/webconsole',
28
28
  type: 'POST',
29
29
  dataType: 'json',
30
30
  data: ({query: webconsole.query.val(), token: "$TOKEN"}),
@@ -12,16 +12,18 @@ module Rack
12
12
  end
13
13
 
14
14
  describe "#code" do
15
- it 'injects the token and key_code' do
15
+ it 'injects the token, key_code, and context path' do
16
16
  Webconsole::Repl.stubs(:token).returns('fake_generated_token')
17
17
  Webconsole.key_code = "96"
18
18
 
19
19
  @assets = Webconsole::Assets.new(nil)
20
- assets_code = @assets.code
20
+ assets_code = @assets.code('SCRIPT_NAME' => '/hambiscuit')
21
21
 
22
22
  assets_code.must_match /fake_generated_token/
23
23
  assets_code.must_match /event\.which == 96/
24
+ assets_code.must_match %r{/hambiscuit/webconsole}
24
25
  end
26
+
25
27
  end
26
28
 
27
29
  describe "#call" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-webconsole
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-03-22 00:00:00.000000000 Z
14
+ date: 2012-09-14 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rack
@@ -205,15 +205,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
205
205
  - - ! '>='
206
206
  - !ruby/object:Gem::Version
207
207
  version: '0'
208
+ segments:
209
+ - 0
210
+ hash: 1337753541622784127
208
211
  required_rubygems_version: !ruby/object:Gem::Requirement
209
212
  none: false
210
213
  requirements:
211
214
  - - ! '>='
212
215
  - !ruby/object:Gem::Version
213
216
  version: '0'
217
+ segments:
218
+ - 0
219
+ hash: 1337753541622784127
214
220
  requirements: []
215
221
  rubyforge_project: rack-webconsole
216
- rubygems_version: 1.8.19
222
+ rubygems_version: 1.8.24
217
223
  signing_key:
218
224
  specification_version: 3
219
225
  summary: Rack-based console inside your web applications