rails_schema_excel 0.2.0 → 1.0.0

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: ffda178abb54e4ecfb57eaf09f395905bd093d8e96628e46c67685e976b728ff
4
- data.tar.gz: 8404809de92962a09cf9da2a8b7e57c361fb6c3b2b6d53dc7c49dc27ce70a065
3
+ metadata.gz: 8873c5c552e34a0edc344911f53a942980c1573bc6da5b6a210e52b357f15d6b
4
+ data.tar.gz: f6ad576146ab2c1d7c85a1ce4ed7cb3ca371068a0844ac0df89537e72b10f361
5
5
  SHA512:
6
- metadata.gz: 85f0740990d69e34cecb425f8893e35ab6b7fa3a96ff7ea54679e78fcb5498bfbbea9aee2ac0f4e42a1fe47c10fa05146bb3bfdfba97f2a77a6cefb943263b46
7
- data.tar.gz: d5d20e8bb7610892e77eedb9f54d4408ae6ec4e52bd96f6cab5d77c66e65dad59edc7e2fa1f9ff14a6d4ee38c351e6966d32edfec9b46eb3fd75366e845b5959
6
+ metadata.gz: dca17c2fa8f7121f63e108edc5013a61470bcebc782b92281473966348cb9a74588bc70e69922b20b0afb1a788edb34c4b88cbb354f330cda958ce094f376b04
7
+ data.tar.gz: b209c61a9c32a2dcc109e37e0ec6d542fd7f56b7318fd0dab87b8f1467062b105611606c75a31fe822a87ef068d119d77481e34a0071ebf9ede246296529df51
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.0.0] - 2025-11-03
6
+
7
+ ### Changed
8
+ - Remove any previously generated worksheet with the same truncated name and emit a warning before recreating it, preventing export failures.
9
+ - Bump gem version to `1.0.0`.
10
+
5
11
  ## [0.1.0] - 2025-10-08
6
12
 
7
13
  ### Added
data/README.md CHANGED
@@ -1,7 +1,13 @@
1
1
  # Rails Schema to Excel Converter
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/rails_schema_excel.svg)](https://badge.fury.io/rb/rails_schema_excel)
4
+
5
+ [!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/ojisanchamchi)
6
+
3
7
  Convert Rails database schema to Excel format with each table as a separate sheet in A5:SQL Mk-2 style.
4
8
 
9
+ <img width="798" height="637" alt="image" src="https://github.com/user-attachments/assets/d538365c-f83d-4536-890b-a0e7c28da534" />
10
+
5
11
  ## Installation
6
12
 
7
13
  Add this line to your application's Gemfile:
@@ -8,14 +8,21 @@ module RailsSchemaExcel
8
8
  GREEN = 'FF92D050'
9
9
 
10
10
  def self.export(tables, output_file, locale: :ja)
11
+ sheet_sources = {}
11
12
  Axlsx::Package.new do |p|
12
13
  tables.each do |table_name, table_data|
13
14
  next if table_data[:columns].empty?
14
15
 
15
16
  sheet_name = table_name[0..30]
17
+ if (existing_sheet = p.workbook.worksheets.find { |ws| ws.name == sheet_name })
18
+ original_table = sheet_sources[sheet_name]
19
+ warn "Duplicate sheet name '#{sheet_name}' detected. Dropping sheet for table '#{original_table}' before adding '#{table_name}'." if original_table
20
+ p.workbook.worksheets.delete(existing_sheet)
21
+ end
16
22
  p.workbook.add_worksheet(name: sheet_name) do |sheet|
17
23
  create_a5_format(sheet, table_name, table_data, locale)
18
24
  end
25
+ sheet_sources[sheet_name] = table_name
19
26
  end
20
27
 
21
28
  p.serialize(output_file)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsSchemaExcel
4
- VERSION = "0.2.0"
4
+ VERSION = '1.0.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_schema_excel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dang Quang Minh
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-10-08 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: caxlsx
@@ -40,8 +39,7 @@ dependencies:
40
39
  version: '0.6'
41
40
  description: 'Convert Rails database schema to Excel format with each table as a separate
42
41
  sheet in A5:SQL Mk-2 style. Usage: rails_schema_excel -i schema.rb -o out.xlsx'
43
- email:
44
- - d-minh@ruby-dev.vn
42
+ email: ojisanchamchi@gmail.com
45
43
  executables:
46
44
  - rails_schema_excel
47
45
  extensions: []
@@ -62,7 +60,7 @@ metadata:
62
60
  homepage_uri: https://github.com/ojisanchamchi/rails_schema_excel
63
61
  source_code_uri: https://github.com/ojisanchamchi/rails_schema_excel
64
62
  changelog_uri: https://github.com/ojisanchamchi/rails_schema_excel/blob/main/CHANGELOG.md
65
- post_install_message:
63
+ github_repo: https://github.com/ojisanchamchi/rails_schema_excel
66
64
  rdoc_options: []
67
65
  require_paths:
68
66
  - lib
@@ -77,8 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
75
  - !ruby/object:Gem::Version
78
76
  version: '0'
79
77
  requirements: []
80
- rubygems_version: 3.3.3
81
- signing_key:
78
+ rubygems_version: 3.6.7
82
79
  specification_version: 4
83
80
  summary: Export Rails schema to Excel with A5:SQL Mk-2 format
84
81
  test_files: []