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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 35b84addef5e3e76f47e06e3c18582721dd344f1
4
- data.tar.gz: 2089aca773c3f118ef93ecea2084838da6c69951
3
+ metadata.gz: 940d433552a2c981a254f3af3ff379d66a26f2e4
4
+ data.tar.gz: 45500122fe48a390b65b22526ba10647c08770e6
5
5
  SHA512:
6
- metadata.gz: 3d9e288ce24ad68f578d87bc9a5de25678defe0e82b1af6e3d22adc0d4aee394df5f369f0eb8c036bf437b24103db2086c97abe8aaf2b98a5690c416daf2abe4
7
- data.tar.gz: deb6c9fb3bce25afbc4e446b660a8b6dc7d47698fd8dae4933be7b96080d00115940a3b614e9eec822563da4fef800037fc9db7768bfad34b856eabbe04776f7
6
+ metadata.gz: d74f2c2b0a3f0c8d44e3d8ff2e1b6cff68c8c49e5577d94ab841920915e25a580843e88ac5baa4b3ccd3a3fcc12b75783338dc34efccaf2255095e71486bb445
7
+ data.tar.gz: 315b4431853bbf0710e6ce7d3e3148ff4665f8f296ba4497436e73efb5e304c3c5e733dc25972fbe6d9b3999641fd55934d9a70db5c98107532f1f1513b4fcc8
@@ -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])
@@ -37,7 +37,7 @@ restart your server for the _Web Console_ to kick in.
37
37
 
38
38
  ### CRuby
39
39
 
40
- CRuby 2.2 and below is **not** supported.
40
+ CRuby 2.2 and above is required.
41
41
 
42
42
  ### Rubinius
43
43
 
@@ -0,0 +1,11 @@
1
+ module WebConsole
2
+ class Mapper
3
+ def initialize(exception)
4
+ @exception = exception
5
+ end
6
+
7
+ def [](index)
8
+ @exception.backtrace[index]
9
+ end
10
+ end
11
+ end
@@ -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(@bindings[0])
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,4 +1,4 @@
1
- <script type="text/javascript">
1
+ <script type="text/javascript" data-template="<%= @template %>">
2
2
  (function() {
3
3
  <%= yield %>
4
4
  }).call(this);
@@ -1,11 +1,7 @@
1
1
  require 'action_view'
2
- require 'action_dispatch'
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
@@ -1,3 +1,3 @@
1
1
  module WebConsole
2
- VERSION = '3.1.1'
2
+ VERSION = '3.2.0'
3
3
  end
@@ -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 @env['web_console.exception'].present?
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.1.1
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-01-28 00:00:00.000000000 Z
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