web-console 3.2.0 → 3.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 940d433552a2c981a254f3af3ff379d66a26f2e4
4
- data.tar.gz: 45500122fe48a390b65b22526ba10647c08770e6
3
+ metadata.gz: cccaecbc9077b0e460d946cc12b7a740c1832885
4
+ data.tar.gz: a554f379e1a93e39794530da43da5964da36a074
5
5
  SHA512:
6
- metadata.gz: d74f2c2b0a3f0c8d44e3d8ff2e1b6cff68c8c49e5577d94ab841920915e25a580843e88ac5baa4b3ccd3a3fcc12b75783338dc34efccaf2255095e71486bb445
7
- data.tar.gz: 315b4431853bbf0710e6ce7d3e3148ff4665f8f296ba4497436e73efb5e304c3c5e733dc25972fbe6d9b3999641fd55934d9a70db5c98107532f1f1513b4fcc8
6
+ metadata.gz: 552ed1aca142857e5bb4d6e21b50c151348b9538018ed4464cf3c0b00d016272db4758cfbd0d96ee2c603f998536e8ab8f71e9a345f2d423d1fd2cbdebbd3335
7
+ data.tar.gz: 81df2259f8350875c61108d8edb3a274d4a169e91dd67a874d5b4dd32c2629fe17b7aaa1135fcd65c54b5316892aa83b61cab272c9df004986bfdfd53cd53ad7
data/CHANGELOG.markdown CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## master (unreleased)
4
4
 
5
+ ## 3.2.1
6
+
7
+ * [#202](https://github.com/rails/web-console/pull/202) Use first binding when there is no application binding ([@sh19910711])
8
+
5
9
  ## 3.2.0
6
10
 
7
11
  * [#198](https://github.com/rails/web-console/pull/198) Pick the first application trace binding on errors ([@sh19910711])
@@ -2,10 +2,13 @@ module WebConsole
2
2
  class Mapper
3
3
  def initialize(exception)
4
4
  @exception = exception
5
+ @bindings = exception.bindings
5
6
  end
6
7
 
7
8
  def [](index)
8
- @exception.backtrace[index]
9
+ trace = @exception.backtrace[index]
10
+ file, line = trace.to_s.strip(':')
11
+ @bindings.find { |b| b.eval('__FILE__') == file && b.eval('__LINE__') == line }
9
12
  end
10
13
  end
11
14
  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(initial_binding)
46
+ @evaluator = Evaluator.new(application_binding || @bindings.first)
47
47
 
48
48
  store_into_memory
49
49
  end
@@ -64,7 +64,7 @@ module WebConsole
64
64
 
65
65
  private
66
66
 
67
- def initial_binding
67
+ def application_binding
68
68
  @bindings.find { |b| b.eval('__FILE__').to_s.start_with?(Rails.root.to_s) }
69
69
  end
70
70
 
@@ -1,3 +1,3 @@
1
1
  module WebConsole
2
- VERSION = '3.2.0'
2
+ VERSION = '3.2.1'
3
3
  end
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.2.0
4
+ version: 3.2.1
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-06-06 00:00:00.000000000 Z
14
+ date: 2016-06-14 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: railties