rubymine_heaven 0.0.2 → 0.0.3

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.md CHANGED
@@ -38,6 +38,7 @@ that's all...
38
38
 
39
39
  * Mac OS X
40
40
  * IntelliJ RubyMine (http://www.jetbrains.com/ruby/index.html)
41
+ * Rails >= 3.2 (for older Rails please use version 0.0.2)
41
42
 
42
43
  ## Bugs and Feedback
43
44
 
@@ -2,7 +2,3 @@ require "rubymine_heaven/version"
2
2
  require "rubymine_heaven/linkable_errors"
3
3
  require "rubymine_heaven/linkable_errors_railtie"
4
4
 
5
- module RubymineHeaven
6
- puts "Rybumine Heaven loading..."
7
- # Your code goes here...
8
- end
@@ -6,6 +6,7 @@ module RubymineHeaven
6
6
 
7
7
  private
8
8
 
9
+
9
10
  def link_to_code(text)
10
11
  # we must create new String, because SafeBuffer#gsub don't set $1, $2, ... variables !!
11
12
  String.new(text).gsub(/(\/?[\w\/\.@-]+)\:(\d+)/) do |match|
@@ -16,21 +17,37 @@ module RubymineHeaven
16
17
  end
17
18
  end
18
19
 
19
- def rescue_action_locally(request, exception)
20
- template = ActionView::Base.new([RESCUES_TEMPLATE_PATH],
21
- :request => request,
22
- :exception => exception,
23
- :application_trace => application_trace(exception),
24
- :framework_trace => framework_trace(exception),
25
- :full_trace => full_trace(exception)
26
- )
27
- file = "rescues/#{@@rescue_templates[exception.class.name]}.erb"
28
- body = template.render(:file => file, :layout => 'rescues/layout.erb')
29
- body = link_to_code(body)
30
- render(status_code(exception), body)
20
+ def render_exception(env, exception)
21
+
22
+ begin
23
+ wrapper = ActionDispatch::ExceptionWrapper.new(env, exception)
24
+ log_error(env, wrapper)
25
+
26
+
27
+ if env['action_dispatch.show_detailed_exceptions']
28
+ template = ActionView::Base.new([RESCUES_TEMPLATE_PATH],
29
+ :request => ActionDispatch::Request.new(env),
30
+ :exception => wrapper.exception,
31
+ :application_trace => wrapper.application_trace,
32
+ :framework_trace => wrapper.framework_trace,
33
+ :full_trace => wrapper.full_trace
34
+ )
35
+
36
+ file = "rescues/#{wrapper.rescue_template}"
37
+ body = template.render(:template => file, :layout => 'rescues/layout')
38
+ body = link_to_code(body)
39
+
40
+ render(wrapper.status_code, body)
41
+ else
42
+ raise exception
43
+ end
44
+ rescue => e
45
+ p e
46
+
47
+ end
31
48
  end
32
- end
33
49
 
50
+ end
34
51
  end
35
52
  end
36
53
 
@@ -6,7 +6,7 @@ module RubymineHeaven
6
6
  Rails.backtrace_cleaner.add_filter { |line| line.sub("#{Rails.root}/", '') }
7
7
 
8
8
  # point links on rails error pages to rubymine
9
- ActionDispatch::ShowExceptions.send(:include, LinkableErrors)
9
+ ActionDispatch::DebugExceptions.send(:include, LinkableErrors)
10
10
 
11
11
  # point footnotes links to rubymine
12
12
  if defined?(Footnotes)
@@ -1,3 +1,3 @@
1
1
  module RubymineHeaven
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubymine_heaven
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-24 00:00:00.000000000Z
12
+ date: 2012-03-06 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &70219712914560 !ruby/object:Gem::Requirement
16
+ requirement: &70303737709920 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 3.0.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70219712914560
24
+ version_requirements: *70303737709920
25
25
  description: ! 'This gem connects stack trace on rails error page to rubymine (when
26
26
  you click on stack trace line
27
27