eras 0.2.3 → 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: 8461f24b4e628c0e2d0c761a59341ffa73f78fba8752d4fc3d9c8fbd3367a722
4
- data.tar.gz: 2ceac24bc81c102a99a61b5d284275fb3be6cf4cbbd97054abac556d853ee214
3
+ metadata.gz: 25d9ab0900627a51927c2a86466fece135b362b1044ae5bd78bc325f954ce538
4
+ data.tar.gz: e26b82a4ba54231398f167240d04dfdcdf01ffc35b3b6c969a53a11b6d885aa5
5
5
  SHA512:
6
- metadata.gz: e9fcda9d56c87bd3538179ac2a6f9fa85b35fa7f30de4b33d6d5a7067e4470d90ccf1ae76934ba5bcdc89a36d3e56d243683c85a185f1ad5a6a36485bc148d4e
7
- data.tar.gz: 55cf81501cd4a81786299c38b1e677d97ec1ec0b028d96f778b360e8e1ed8acb20f5e8ddc7f940efd889f3823b7786ed6045c7964e295e04acd27eef9c1ed6be
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').strip %></code>
15
+ <code class="whitespace-pre-line text-xs"><%= @error.dig('error', 'backtrace')&.strip %></code>
16
16
  </pre>
17
17
  </div>
@@ -9,6 +9,7 @@ module Eras
9
9
  dir = Rails.root.join("tmp", "eras")
10
10
  Dir.mkdir(dir) unless File.exists?(dir)
11
11
  end
12
+ # TODO: Actually use the path
12
13
  @path = Rails.root.join("tmp", "eras", "errors.json")
13
14
  end
14
15
 
@@ -1,6 +1,6 @@
1
1
  module Eras
2
2
  class ErrorReporter
3
- def initialize(adapter: Eras::Adapters::FileSystem.new(::Rails.env))
3
+ def initialize(adapter: Eras::Adapters::FileSystem.new)
4
4
  @adapter = adapter
5
5
  end
6
6
 
data/lib/eras/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Eras
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eras
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bobby McDonald