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 +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +6 -0
- data/lib/rails_schema_excel/exporter.rb +7 -0
- data/lib/rails_schema_excel/version.rb +1 -1
- metadata +5 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8873c5c552e34a0edc344911f53a942980c1573bc6da5b6a210e52b357f15d6b
|
|
4
|
+
data.tar.gz: f6ad576146ab2c1d7c85a1ce4ed7cb3ca371068a0844ac0df89537e72b10f361
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
+
[](https://badge.fury.io/rb/rails_schema_excel)
|
|
4
|
+
|
|
5
|
+
[](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)
|
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.
|
|
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:
|
|
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
|
-
|
|
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.
|
|
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: []
|