actual_db_schema 0.8.3 → 0.8.4

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: d78699aee32920e20a6dd084512949d9cc88e7878531de087295d43833463193
4
- data.tar.gz: 1e55c7f7b15e0a2fbace58cc80c32deb2061bbe6cd8d8da69f8f35682e9d5b75
3
+ metadata.gz: 57bacb613dd91545ec81f35215b6b019b1ccdf3fc758aff3d1d23e2ebcf81e05
4
+ data.tar.gz: ec97e40937a883297bc8cbf40afd554d4df5ef1729fc525121f3a18816fdd753
5
5
  SHA512:
6
- metadata.gz: df1251d4d45888438f9e5ab3585eafa2f2eec2ace597ec0b6985479dc835a67460990e5b6e67534bfeceb779f088b64c65fcff0c9a7b7e16007a90c365f7d93e
7
- data.tar.gz: 94a00404bb421f3b3a1124c456358003da71762a652cca2d6e89763bdbc872ddf3f86c2c68ca9b5cc26e12a514869f9c11aba972dfb705f816dc3d43200e63a1
6
+ metadata.gz: 69824d842bb1fbccc684c288f6eff66aa5c63920f902b890bc979806af3b44c90718c7e9cb8c31f6dbb41d4613c54e67eaf52551478211b31534e20a02cfff11
7
+ data.tar.gz: e2e1038125ca13c16775be2b1954fa2f8a39902f8ac0d137e582bdb36c7740a7b5c3c438f2dd72eb6197e1500473ccc6b649324ae3b1f9e08a01ad0eada0d24e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [0.8.4] - 2025-03-20
2
+
3
+ - Fix initializer file that can break other bundle groups that development
4
+ - Use prism gem instead of parser for Ruby 3.4 compatibility
5
+
1
6
  ## [0.8.3] - 2025-03-03
2
7
 
3
8
  - View Schema with Migration Annotations in the UI
data/Gemfile.lock CHANGED
@@ -1,12 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- actual_db_schema (0.8.3)
4
+ actual_db_schema (0.8.4)
5
5
  activerecord
6
6
  activesupport
7
7
  ast
8
8
  csv
9
9
  parser
10
+ prism
10
11
 
11
12
  GEM
12
13
  remote: https://rubygems.org/
@@ -95,7 +96,7 @@ GEM
95
96
  concurrent-ruby (1.2.2)
96
97
  connection_pool (2.4.1)
97
98
  crass (1.0.6)
98
- csv (3.3.2)
99
+ csv (3.3.3)
99
100
  date (3.3.3)
100
101
  debug (1.8.0)
101
102
  irb (>= 1.5.0)
@@ -145,6 +146,7 @@ GEM
145
146
  parser (3.2.2.4)
146
147
  ast (~> 2.4.1)
147
148
  racc
149
+ prism (1.4.0)
148
150
  psych (5.1.1.1)
149
151
  stringio
150
152
  racc (1.7.3)
@@ -40,6 +40,7 @@ Gem::Specification.new do |spec|
40
40
  spec.add_runtime_dependency "ast"
41
41
  spec.add_runtime_dependency "csv"
42
42
  spec.add_runtime_dependency "parser"
43
+ spec.add_runtime_dependency "prism"
43
44
 
44
45
  spec.add_development_dependency "appraisal"
45
46
  spec.add_development_dependency "debug"
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "parser/current"
4
3
  require "ast"
4
+ require "prism"
5
5
 
6
6
  module ActualDbSchema
7
7
  # Parses migration files in a Rails application into a structured hash representation.
@@ -41,9 +41,7 @@ module ActualDbSchema
41
41
  private
42
42
 
43
43
  def parse_file(file_path)
44
- buffer = Parser::Source::Buffer.new(file_path)
45
- buffer.source = File.read(file_path, encoding: "UTF-8")
46
- Parser::CurrentRuby.parse(buffer.source)
44
+ Prism::Translation::Parser.parse_file(file_path)
47
45
  end
48
46
 
49
47
  def find_migration_changes(node)
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "parser/current"
4
3
  require "parser/ast/processor"
4
+ require "prism"
5
5
 
6
6
  module ActualDbSchema
7
7
  # Parses the content of a `schema.rb` file into a structured hash representation.
@@ -9,10 +9,7 @@ module ActualDbSchema
9
9
  module_function
10
10
 
11
11
  def parse_string(schema_content)
12
- buffer = Parser::Source::Buffer.new("(schema)")
13
- buffer.source = schema_content
14
- parser = Parser::CurrentRuby.new
15
- ast = parser.parse(buffer)
12
+ ast = Prism::Translation::Parser.parse(schema_content)
16
13
 
17
14
  collector = SchemaCollector.new
18
15
  collector.process(ast)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActualDbSchema
4
- VERSION = "0.8.3"
4
+ VERSION = "0.8.4"
5
5
  end
@@ -3,29 +3,31 @@
3
3
  # ActualDbSchema initializer
4
4
  # Adjust the configuration as needed.
5
5
 
6
- ActualDbSchema.configure do |config|
7
- # Enable the gem.
8
- config.enabled = Rails.env.development?
6
+ if defined?(ActualDbSchema)
7
+ ActualDbSchema.configure do |config|
8
+ # Enable the gem.
9
+ config.enabled = Rails.env.development?
9
10
 
10
- # Disable automatic rollback of phantom migrations.
11
- # config.auto_rollback_disabled = true
12
- config.auto_rollback_disabled = ENV["ACTUAL_DB_SCHEMA_AUTO_ROLLBACK_DISABLED"].present?
11
+ # Disable automatic rollback of phantom migrations.
12
+ # config.auto_rollback_disabled = true
13
+ config.auto_rollback_disabled = ENV["ACTUAL_DB_SCHEMA_AUTO_ROLLBACK_DISABLED"].present?
13
14
 
14
- # Enable the UI for managing migrations.
15
- config.ui_enabled = Rails.env.development? || ENV["ACTUAL_DB_SCHEMA_UI_ENABLED"].present?
15
+ # Enable the UI for managing migrations.
16
+ config.ui_enabled = Rails.env.development? || ENV["ACTUAL_DB_SCHEMA_UI_ENABLED"].present?
16
17
 
17
- # Enable automatic phantom migration rollback on branch switch,
18
- # config.git_hooks_enabled = true
19
- config.git_hooks_enabled = ENV["ACTUAL_DB_SCHEMA_GIT_HOOKS_ENABLED"].present?
18
+ # Enable automatic phantom migration rollback on branch switch,
19
+ # config.git_hooks_enabled = true
20
+ config.git_hooks_enabled = ENV["ACTUAL_DB_SCHEMA_GIT_HOOKS_ENABLED"].present?
20
21
 
21
- # If your application leverages multiple schemas for multi-tenancy, define the active schemas.
22
- # config.multi_tenant_schemas = -> { ["public", "tenant1", "tenant2"] }
22
+ # If your application leverages multiple schemas for multi-tenancy, define the active schemas.
23
+ # config.multi_tenant_schemas = -> { ["public", "tenant1", "tenant2"] }
23
24
 
24
- # Enable console migrations.
25
- # config.console_migrations_enabled = true
26
- config.console_migrations_enabled = ENV["ACTUAL_DB_SCHEMA_CONSOLE_MIGRATIONS_ENABLED"].present?
25
+ # Enable console migrations.
26
+ # config.console_migrations_enabled = true
27
+ config.console_migrations_enabled = ENV["ACTUAL_DB_SCHEMA_CONSOLE_MIGRATIONS_ENABLED"].present?
27
28
 
28
- # Define the migrated folder location.
29
- # config.migrated_folder = Rails.root.join("custom", "migrated")
30
- config.migrated_folder = Rails.root.join("tmp", "migrated")
29
+ # Define the migrated folder location.
30
+ # config.migrated_folder = Rails.root.join("custom", "migrated")
31
+ config.migrated_folder = Rails.root.join("tmp", "migrated")
32
+ end
31
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actual_db_schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrei Kaleshka
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-03-03 00:00:00.000000000 Z
11
+ date: 2025-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: prism
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: appraisal
85
99
  requirement: !ruby/object:Gem::Requirement