solid_errors 0.2.5 → 0.2.6

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
  SHA256:
3
- metadata.gz: 2d0aea2d7de1780988fcaf95076ac3c904d4808cfaf452fa0af6db797ad50742
4
- data.tar.gz: 4bfd4cb85b34faa643c68812b96df4b33b6ff672f5275ddeb9cf986e0e85efdc
3
+ metadata.gz: e69dbe088ff461a32c395c79dff5d4d6ccfef5d3afebd2edd32cad153f7e8a02
4
+ data.tar.gz: 205c26874a40a3e4427051709e0217b5dd6c5d8bf32abc343150754b69b13d31
5
5
  SHA512:
6
- metadata.gz: cbb8af32ae976df7a3086b8a5a7ea3bb9472e3d198c660b2c564c25a4a90005a5d2d37a50ee3d4408f0bcaa86ab5ad983d0c4b504ddf4bd85460a53327aa2f30
7
- data.tar.gz: 12645a08d974dbe867527051cee97d48eb152f0d044469663ac24549f88321dba547edff5048afb621e872662b537a0056735c7be9ba7912f83ed60759efb413
6
+ metadata.gz: 07ac740b18e82c3f8cbe0a0df520e0b48daa5cd3db100b39787c78e9c87b17e7e0a139b799aa9111d13613e96b1f6af67ce7dc9cacb90fb2333175aca03f5216
7
+ data.tar.gz: 2c89cb709d53fc8cbbdff2e1f9db2d3ade809e206a747a8d2c2bbfdc2144f394d4c8f731c6f6fa94979359a0f6a8690f23f305ed6714ca2f657fcc3f1667ade4
@@ -0,0 +1,4 @@
1
+ module SolidErrors
2
+ class ApplicationController < ActionController::Base
3
+ end
4
+ end
@@ -1,13 +1,32 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class SolidErrors::InstallGenerator < Rails::Generators::Base
4
- source_root File.expand_path("templates", __dir__)
3
+ require 'rails/generators'
4
+ require 'rails/generators/active_record'
5
5
 
6
- class_option :skip_migrations, type: :boolean, default: nil, desc: "Skip migrations"
6
+ module SolidErrors
7
+ #
8
+ # Rails generator used for setting up SolidErrors in a Rails application.
9
+ # Run it with +bin/rails g solid_errors:install+ in your console.
10
+ #
11
+ class InstallGenerator < Rails::Generators::Base
12
+ include ActiveRecord::Generators::Migration
7
13
 
8
- def create_migrations
9
- unless options[:skip_migrations]
10
- rails_command "railties:install:migrations FROM=solid_errors", inline: true
14
+ source_root File.expand_path("templates", __dir__)
15
+
16
+ class_option :database, type: :string, aliases: %i(--db), desc: "The database for your migration. By default, the current environment's primary database is used."
17
+ class_option :skip_migrations, type: :boolean, default: nil, desc: "Skip migrations"
18
+
19
+ # Generates monolithic migration file that contains all database changes.
20
+ def create_migration_file
21
+ return if options[:skip_migrations]
22
+
23
+ migration_template 'create_solid_errors_tables.rb.erb', File.join(db_migrate_path, "create_solid_errors_tables.rb")
24
+ end
25
+
26
+ private
27
+
28
+ def migration_version
29
+ "[#{ActiveRecord::VERSION::STRING.to_f}]"
11
30
  end
12
31
  end
13
32
  end
@@ -1,4 +1,6 @@
1
- class CreateSolidErrorsTables < ActiveRecord::Migration[7.1]
1
+ # frozen_string_literal: true
2
+
3
+ class CreateSolidErrorsTables < ActiveRecord::Migration<%= migration_version %>
2
4
  def change
3
5
  create_table :solid_errors do |t|
4
6
  t.string :exception_class, null: false
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidErrors
4
- VERSION = "0.2.5"
4
+ VERSION = "0.2.6"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solid_errors
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Margheim
@@ -33,6 +33,7 @@ extra_rdoc_files: []
33
33
  files:
34
34
  - README.md
35
35
  - Rakefile
36
+ - app/controllers/solid_errors/application_controller.rb
36
37
  - app/controllers/solid_errors/errors_controller.rb
37
38
  - app/models/solid_errors/error.rb
38
39
  - app/models/solid_errors/occurrence.rb
@@ -45,9 +46,9 @@ files:
45
46
  - app/views/solid_errors/occurrences/_collection.html.erb
46
47
  - app/views/solid_errors/occurrences/_occurrence.html.erb
47
48
  - config/routes.rb
48
- - db/migrate/20240112191645_create_solid_errors_tables.rb
49
49
  - lib/generators/solid_errors/install/USAGE
50
50
  - lib/generators/solid_errors/install/install_generator.rb
51
+ - lib/generators/solid_errors/install/templates/create_solid_errors_tables.rb.erb
51
52
  - lib/solid_errors.rb
52
53
  - lib/solid_errors/backtrace.rb
53
54
  - lib/solid_errors/backtrace_line.rb