eras 0.2.4 → 0.2.5
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25d9ab0900627a51927c2a86466fece135b362b1044ae5bd78bc325f954ce538
|
4
|
+
data.tar.gz: e26b82a4ba54231398f167240d04dfdcdf01ffc35b3b6c969a53a11b6d885aa5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 221a381ba04433c98222ee2fbf8e4c07cf8847b8809737e924d3e996bc4b86ef95908c254f607097a3a8c1bf78c11fc3f559d994ff33997fe9e79940454ae8a6
|
7
|
+
data.tar.gz: f8210aefe690c01600831bbe80ff79653b4ae12d41a87a452a08dcc1839bb6e12dd56172b06fdefc225f26eb1bd85dab0eb09ec6287e91d65a8665f15cd178a5
|
@@ -1,9 +1,9 @@
|
|
1
1
|
module Eras
|
2
2
|
class ErrorsController < ApplicationController
|
3
3
|
before_action :set_file_attrs
|
4
|
+
before_action :set_environment, only: [:index, :show]
|
4
5
|
|
5
6
|
def index
|
6
|
-
@environment = params[:environment] || 'development'
|
7
7
|
# TODO: We need to actually respect the adapter that's used,
|
8
8
|
# and not just assume it's the filesystem adapter.
|
9
9
|
@errors = Eras::Adapters::FileSystem.new.read_errors.filter { |e| e['context']['rails_env'] == @environment }
|
@@ -17,6 +17,10 @@ module Eras
|
|
17
17
|
Eras::Adapters::FileSystem.new.destroy_file
|
18
18
|
end
|
19
19
|
|
20
|
+
def set_environment
|
21
|
+
@environment = params[:environment] || 'development'
|
22
|
+
end
|
23
|
+
|
20
24
|
def set_file_attrs
|
21
25
|
# TODO: We need to store the active adapter as a singleton somewhere
|
22
26
|
# so we can use it places instead of creating new ones.
|
@@ -31,7 +31,7 @@
|
|
31
31
|
<%= error.dig("error", "message") %></td>
|
32
32
|
<td>
|
33
33
|
<div class="flex space-x-2 justify-center">
|
34
|
-
<a href="<%= error_path(error['id'])%>"
|
34
|
+
<a href="<%= error_path(id: error['id'], environment: @environment)%>"
|
35
35
|
class="inline-block px-6 py-2.5 bg-blue-600 text-white font-medium text-xs leading-tight uppercase rounded shadow-md hover:bg-blue-700 hover:shadow-lg focus:bg-blue-700 focus:shadow-lg focus:outline-none focus:ring-0 active:bg-blue-800 active:shadow-lg transition duration-150 ease-in-out">View</a>
|
36
36
|
</div>
|
37
37
|
</td>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
<p><%= @error.dig('error', 'message') %></p>
|
5
5
|
<a
|
6
|
-
href="<%= errors_path %>"
|
6
|
+
href="<%= errors_path(environment: @environment) %>"
|
7
7
|
class="inline-block px-6 py-2.5 mt-4 bg-blue-600 text-white font-medium text-xs leading-tight uppercase rounded shadow-md hover:bg-blue-700 hover:shadow-lg focus:bg-blue-700 focus:shadow-lg focus:outline-none focus:ring-0 active:bg-blue-800 active:shadow-lg transition duration-150 ease-in-out"
|
8
8
|
data-mdb-ripple="true"
|
9
9
|
data-mdb-ripple-color="light"
|
@@ -12,6 +12,6 @@
|
|
12
12
|
</a>
|
13
13
|
<hr class="my-6 border-gray-300" />
|
14
14
|
<pre>
|
15
|
-
<code class="whitespace-pre-line text-xs"><%= @error.dig('error', 'backtrace')
|
15
|
+
<code class="whitespace-pre-line text-xs"><%= @error.dig('error', 'backtrace')&.strip %></code>
|
16
16
|
</pre>
|
17
17
|
</div>
|
data/lib/eras/version.rb
CHANGED