web-console 3.1.1 → 3.2.0
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 +4 -4
- data/CHANGELOG.markdown +13 -0
- data/README.markdown +1 -1
- data/lib/web_console/mapper.rb +11 -0
- data/lib/web_console/session.rb +5 -1
- data/lib/web_console/templates/layouts/javascript.erb +1 -1
- data/lib/web_console/testing/fake_middleware.rb +2 -6
- data/lib/web_console/version.rb +1 -1
- data/lib/web_console/view.rb +10 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 940d433552a2c981a254f3af3ff379d66a26f2e4
|
4
|
+
data.tar.gz: 45500122fe48a390b65b22526ba10647c08770e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d74f2c2b0a3f0c8d44e3d8ff2e1b6cff68c8c49e5577d94ab841920915e25a580843e88ac5baa4b3ccd3a3fcc12b75783338dc34efccaf2255095e71486bb445
|
7
|
+
data.tar.gz: 315b4431853bbf0710e6ce7d3e3148ff4665f8f296ba4497436e73efb5e304c3c5e733dc25972fbe6d9b3999641fd55934d9a70db5c98107532f1f1513b4fcc8
|
data/CHANGELOG.markdown
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
## master (unreleased)
|
4
4
|
|
5
|
+
## 3.2.0
|
6
|
+
|
7
|
+
* [#198](https://github.com/rails/web-console/pull/198) Pick the first application trace binding on errors ([@sh19910711])
|
8
|
+
* [#189](https://github.com/rails/web-console/pull/189) Silence ActionView rendering information ([@gsamokovarov])
|
9
|
+
|
5
10
|
## 3.1.1
|
6
11
|
|
7
12
|
* [#185](https://github.com/rails/web-console/pull/185) Fix `rails console` startup ([@gsamokovarov])
|
@@ -19,6 +24,14 @@
|
|
19
24
|
* [#162](https://github.com/rails/web-console/pull/162) Render the console inside the body tag ([@gsamokovarov])
|
20
25
|
* [#165](https://github.com/rails/web-console/pull/165) Revamped integrations for CRuby and Rubinius ([@gsamokovarov])
|
21
26
|
|
27
|
+
## 2.3.0
|
28
|
+
|
29
|
+
This is mainly a Rails 5 compatibility release. If you have the chance, please
|
30
|
+
go to 3.1.0 instead.
|
31
|
+
|
32
|
+
* [#181](https://github.com/rails/web-console/pull/181) Log internal Web Console errors (@schneems)
|
33
|
+
* [#150](https://github.com/rails/web-console/pull/150) Revert #150. (@gsamokovarov)
|
34
|
+
|
22
35
|
## 2.2.1
|
23
36
|
|
24
37
|
* [#150](https://github.com/rails/web-console/pull/150) Change config.development_only default until 4.2.4 is released ([@gsamokovarov])
|
data/README.markdown
CHANGED
data/lib/web_console/session.rb
CHANGED
@@ -43,7 +43,7 @@ module WebConsole
|
|
43
43
|
def initialize(bindings)
|
44
44
|
@id = SecureRandom.hex(16)
|
45
45
|
@bindings = Array(bindings)
|
46
|
-
@evaluator = Evaluator.new(
|
46
|
+
@evaluator = Evaluator.new(initial_binding)
|
47
47
|
|
48
48
|
store_into_memory
|
49
49
|
end
|
@@ -64,6 +64,10 @@ module WebConsole
|
|
64
64
|
|
65
65
|
private
|
66
66
|
|
67
|
+
def initial_binding
|
68
|
+
@bindings.find { |b| b.eval('__FILE__').to_s.start_with?(Rails.root.to_s) }
|
69
|
+
end
|
70
|
+
|
67
71
|
def store_into_memory
|
68
72
|
inmemory_storage[id] = self
|
69
73
|
end
|
@@ -1,11 +1,7 @@
|
|
1
1
|
require 'action_view'
|
2
|
-
require '
|
3
|
-
require 'active_support/core_ext/string/access'
|
4
|
-
require 'json'
|
5
|
-
require 'web_console/whitelist'
|
6
|
-
require 'web_console/request'
|
7
|
-
require 'web_console/view'
|
2
|
+
require 'web_console'
|
8
3
|
require 'web_console/testing/helper'
|
4
|
+
Mime = { web_console_v2: 'fake' }
|
9
5
|
|
10
6
|
module WebConsole
|
11
7
|
module Testing
|
data/lib/web_console/version.rb
CHANGED
data/lib/web_console/view.rb
CHANGED
@@ -5,7 +5,7 @@ module WebConsole
|
|
5
5
|
# The error pages are special, because they are the only pages that
|
6
6
|
# currently require multiple bindings. We get those from exceptions.
|
7
7
|
def only_on_error_page(*args)
|
8
|
-
yield if
|
8
|
+
yield if Thread.current[:__web_console_exception].present?
|
9
9
|
end
|
10
10
|
|
11
11
|
# Render JavaScript inside a script tag and a closure.
|
@@ -14,6 +14,7 @@ module WebConsole
|
|
14
14
|
# script tag and enclosed in a closure, so you don't have to worry for
|
15
15
|
# leaking globals, unless you explicitly want to.
|
16
16
|
def render_javascript(template)
|
17
|
+
assign(template: template)
|
17
18
|
render(template: template, layout: 'layouts/javascript')
|
18
19
|
end
|
19
20
|
|
@@ -25,6 +26,14 @@ module WebConsole
|
|
25
26
|
render(template: template, layout: 'layouts/inlined_string')
|
26
27
|
end
|
27
28
|
|
29
|
+
# Custom ActionView::Base#render wrapper which silences all the log
|
30
|
+
# printings.
|
31
|
+
#
|
32
|
+
# Helps to keep the Rails logs clean during errors.
|
33
|
+
def render(*)
|
34
|
+
WebConsole.logger.silence { super }
|
35
|
+
end
|
36
|
+
|
28
37
|
# Override method for ActionView::Helpers::TranslationHelper#t.
|
29
38
|
#
|
30
39
|
# This method escapes the original return value for JavaScript, since the
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: web-console
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charlie Somerville
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2016-
|
14
|
+
date: 2016-06-06 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: railties
|
@@ -78,6 +78,7 @@ files:
|
|
78
78
|
- lib/web_console/integration/cruby.rb
|
79
79
|
- lib/web_console/integration/rubinius.rb
|
80
80
|
- lib/web_console/locales/en.yml
|
81
|
+
- lib/web_console/mapper.rb
|
81
82
|
- lib/web_console/middleware.rb
|
82
83
|
- lib/web_console/railtie.rb
|
83
84
|
- lib/web_console/request.rb
|