super_tools 2.1.0 → 4.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.
Files changed (48) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/test.yml +43 -0
  3. data/.gitignore +6 -0
  4. data/.ruby-version +1 -0
  5. data/Appraisals +29 -0
  6. data/Gemfile +2 -0
  7. data/Gemfile.lock +166 -150
  8. data/MULTI_RUBY_TESTING.md +170 -0
  9. data/bin/test_all +35 -0
  10. data/dependabot.yml +7 -0
  11. data/gemfiles/.bundle/config +2 -0
  12. data/gemfiles/ruby_2.7_rails_6.gemfile +8 -0
  13. data/gemfiles/ruby_2.7_rails_7.gemfile +8 -0
  14. data/gemfiles/ruby_3.0_rails_6.gemfile +8 -0
  15. data/gemfiles/ruby_3.0_rails_7.gemfile +8 -0
  16. data/gemfiles/ruby_3.1_rails_6.gemfile +8 -0
  17. data/gemfiles/ruby_3.1_rails_7.gemfile +8 -0
  18. data/lib/super_form/basic.rb +2 -7
  19. data/lib/super_form/concerns/atomic_save.rb +3 -3
  20. data/lib/super_form/reform.rb +28 -6
  21. data/lib/super_formatter/ecan/head.rb +4 -4
  22. data/lib/super_formatter/ecan/import.rb +4 -3
  23. data/lib/super_formatter/ecan/row.rb +3 -2
  24. data/lib/super_formatter/hct/head.rb +5 -5
  25. data/lib/super_formatter/hct/import.rb +4 -3
  26. data/lib/super_formatter/hct/row.rb +4 -3
  27. data/lib/super_formatter/shopline/head.rb +16 -16
  28. data/lib/super_formatter/shopline/import.rb +5 -6
  29. data/lib/super_formatter/shopline/order.rb +9 -8
  30. data/lib/super_formatter/shopline/row.rb +2 -2
  31. data/lib/super_formatter/tcat/head.rb +4 -4
  32. data/lib/super_formatter/tcat/import.rb +4 -4
  33. data/lib/super_formatter/tcat/row.rb +5 -4
  34. data/lib/super_interaction/beyond.rb +1 -1
  35. data/lib/super_interaction/engine.rb +2 -0
  36. data/lib/super_process/basic.rb +12 -0
  37. data/lib/super_process/core.rb +26 -25
  38. data/lib/super_search/scroll.rb +11 -8
  39. data/lib/super_spreadsheet/loader.rb +14 -14
  40. data/lib/super_table/action_view.rb +4 -4
  41. data/lib/super_table/builder.rb +5 -4
  42. data/lib/super_table/record.rb +1 -1
  43. data/lib/super_tools/version.rb +2 -2
  44. data/lib/super_tools.rb +42 -30
  45. data/lib/super_zipcode/taiwan.rb +131 -102
  46. data/super_tools.gemspec +18 -22
  47. metadata +111 -59
  48. data/lib/super_logger/formatter.rb +0 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 248f805a4956e73dcc11f4623ebfeb7f124c0d49
4
- data.tar.gz: f24028ac4d9d1a4f80f8bd0e5552174fc735f4da
2
+ SHA256:
3
+ metadata.gz: c307e44d3f7362a213998c9c174923bab9771ff144c67d7a3bbe4271c9533cfe
4
+ data.tar.gz: 5ad16bfd50ada78a6b6931f54b1cabfa57eb403d9172ee6c2dbd39b437bbc4e5
5
5
  SHA512:
6
- metadata.gz: 9ec67d9425ff7fa208a0cadd4682eb4a0e1b63dde2eb3e22b9715f679d9a3bd22534b56e65a7f8e792061a8e97686ceccd7f2b78b21afabcfb5e1cacfd93a59d
7
- data.tar.gz: 6447defbdd74912a56d187406c3d80e0890b037062c96d06a3d02ac7f6c4074949772321d24ad85b8147908e5def0ff5cdd5340a387c085bd3cabcadaac16847
6
+ metadata.gz: 04bdb21b6fe4db79fbc9577f3625c5845bc2df314bd798f441c5e3df82928ed75aef392a460a4a576dca7497b078997a41912093ebf79fddada8838db6f0ab8d
7
+ data.tar.gz: 6de91347858c30e2786ee3e0cc0d4f8425f7be18d2977a7e8aa2bd87841ab456cccf06b9001011692a8d3e5890f865626deb18bfde3737e16ed68680d20f4d9d
@@ -0,0 +1,43 @@
1
+ name: Test
2
+ on:
3
+ push:
4
+ branches:
5
+ - 'fix-**'
6
+ - 'feat-**'
7
+ - develop
8
+ - master
9
+ pull_request:
10
+
11
+ jobs:
12
+ test:
13
+ runs-on: ubuntu-latest
14
+ strategy:
15
+ fail-fast: false
16
+ matrix:
17
+ include:
18
+ # Ruby 2.7.6
19
+ - ruby: '2.7.6'
20
+ gemfile: gemfiles/ruby_2.7_rails_6.gemfile
21
+ - ruby: '2.7.6'
22
+ gemfile: gemfiles/ruby_2.7_rails_7.gemfile
23
+ # Ruby 3.0.7
24
+ - ruby: '3.0.7'
25
+ gemfile: gemfiles/ruby_3.0_rails_6.gemfile
26
+ - ruby: '3.0.7'
27
+ gemfile: gemfiles/ruby_3.0_rails_7.gemfile
28
+ # Ruby 3.1.7
29
+ - ruby: '3.1.7'
30
+ gemfile: gemfiles/ruby_3.1_rails_6.gemfile
31
+ - ruby: '3.1.7'
32
+ gemfile: gemfiles/ruby_3.1_rails_7.gemfile
33
+ env:
34
+ BUNDLE_GEMFILE: ${{ matrix.gemfile }}
35
+ steps:
36
+ - uses: actions/checkout@v3
37
+ with:
38
+ fetch-depth: 1
39
+ - uses: ruby/setup-ruby@v1
40
+ with:
41
+ ruby-version: ${{ matrix.ruby }}
42
+ bundler-cache: true
43
+ - run: bundle exec rake t
data/.gitignore CHANGED
@@ -6,3 +6,9 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ vendor
10
+ *.*.sw?
11
+ .DS_Store
12
+ db/
13
+ log/
14
+ /gemfiles/*.lock
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.7.6
data/Appraisals ADDED
@@ -0,0 +1,29 @@
1
+ # Ruby 2.7.6 with Rails 6
2
+ appraise "ruby-2.7-rails-6" do
3
+ gem "rails", "~> 6.1.0"
4
+ end
5
+
6
+ # Ruby 2.7.6 with Rails 7
7
+ appraise "ruby-2.7-rails-7" do
8
+ gem "rails", "~> 7.0.0"
9
+ end
10
+
11
+ # Ruby 3.0.7 with Rails 6
12
+ appraise "ruby-3.0-rails-6" do
13
+ gem "rails", "~> 6.1.0"
14
+ end
15
+
16
+ # Ruby 3.0.7 with Rails 7
17
+ appraise "ruby-3.0-rails-7" do
18
+ gem "rails", "~> 7.0.0"
19
+ end
20
+
21
+ # Ruby 3.1.7 with Rails 6
22
+ appraise "ruby-3.1-rails-6" do
23
+ gem "rails", "~> 6.1.0"
24
+ end
25
+
26
+ # Ruby 3.1.7 with Rails 7
27
+ appraise "ruby-3.1-rails-7" do
28
+ gem "rails", "~> 7.0.0"
29
+ end
data/Gemfile CHANGED
@@ -4,3 +4,5 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
5
  # Specify your gem's dependencies in super_tools.gemspec
6
6
  gemspec
7
+
8
+ gem "reform-rails", github: "superlanding/reform-rails", tag: "v0.2.6.f"
data/Gemfile.lock CHANGED
@@ -1,18 +1,26 @@
1
+ GIT
2
+ remote: https://github.com/superlanding/reform-rails
3
+ revision: 9309677a20293133167fe992e9795f367732b08f
4
+ tag: v0.2.6.f
5
+ specs:
6
+ reform-rails (0.2.6)
7
+ activemodel (>= 5.0)
8
+ reform (>= 2.3.1, < 3.0.0)
9
+
1
10
  PATH
2
11
  remote: .
3
12
  specs:
4
- super_tools (0.0.8)
5
- dry-logic (~> 0.4.2)
6
- dry-types (~> 0.13.2)
13
+ super_tools (3.0.0)
14
+ dry-logic (= 1.2.0)
15
+ dry-types (= 1.5.1)
7
16
  fast_excel
8
17
  forwardable
9
- iconv
10
- nokogiri (>= 1.6, <= 1.9.1)
11
- rails (>= 4)
12
- reform (~> 2.2.4)
18
+ nokogiri (>= 1.6)
19
+ rails (>= 6.1, < 8)
20
+ reform (= 2.6.2)
13
21
  reform-rails
14
22
  roo
15
- roo-xls
23
+ roo-xls (= 1.2.0)
16
24
  searchkick
17
25
  spreadsheet
18
26
  virtus (~> 1.0.5)
@@ -21,194 +29,195 @@ PATH
21
29
  GEM
22
30
  remote: https://rubygems.org/
23
31
  specs:
24
- actioncable (5.2.3)
25
- actionpack (= 5.2.3)
32
+ actioncable (6.1.6)
33
+ actionpack (= 6.1.6)
34
+ activesupport (= 6.1.6)
26
35
  nio4r (~> 2.0)
27
36
  websocket-driver (>= 0.6.1)
28
- actionmailer (5.2.3)
29
- actionpack (= 5.2.3)
30
- actionview (= 5.2.3)
31
- activejob (= 5.2.3)
37
+ actionmailbox (6.1.6)
38
+ actionpack (= 6.1.6)
39
+ activejob (= 6.1.6)
40
+ activerecord (= 6.1.6)
41
+ activestorage (= 6.1.6)
42
+ activesupport (= 6.1.6)
43
+ mail (>= 2.7.1)
44
+ actionmailer (6.1.6)
45
+ actionpack (= 6.1.6)
46
+ actionview (= 6.1.6)
47
+ activejob (= 6.1.6)
48
+ activesupport (= 6.1.6)
32
49
  mail (~> 2.5, >= 2.5.4)
33
50
  rails-dom-testing (~> 2.0)
34
- actionpack (5.2.3)
35
- actionview (= 5.2.3)
36
- activesupport (= 5.2.3)
37
- rack (~> 2.0)
51
+ actionpack (6.1.6)
52
+ actionview (= 6.1.6)
53
+ activesupport (= 6.1.6)
54
+ rack (~> 2.0, >= 2.0.9)
38
55
  rack-test (>= 0.6.3)
39
56
  rails-dom-testing (~> 2.0)
40
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
41
- actionview (5.2.3)
42
- activesupport (= 5.2.3)
57
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
58
+ actiontext (6.1.6)
59
+ actionpack (= 6.1.6)
60
+ activerecord (= 6.1.6)
61
+ activestorage (= 6.1.6)
62
+ activesupport (= 6.1.6)
63
+ nokogiri (>= 1.8.5)
64
+ actionview (6.1.6)
65
+ activesupport (= 6.1.6)
43
66
  builder (~> 3.1)
44
67
  erubi (~> 1.4)
45
68
  rails-dom-testing (~> 2.0)
46
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
47
- activejob (5.2.3)
48
- activesupport (= 5.2.3)
69
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
70
+ activejob (6.1.6)
71
+ activesupport (= 6.1.6)
49
72
  globalid (>= 0.3.6)
50
- activemodel (5.2.3)
51
- activesupport (= 5.2.3)
52
- activerecord (5.2.3)
53
- activemodel (= 5.2.3)
54
- activesupport (= 5.2.3)
55
- arel (>= 9.0)
56
- activestorage (5.2.3)
57
- actionpack (= 5.2.3)
58
- activerecord (= 5.2.3)
59
- marcel (~> 0.3.1)
60
- activesupport (5.2.3)
73
+ activemodel (6.1.6)
74
+ activesupport (= 6.1.6)
75
+ activerecord (6.1.6)
76
+ activemodel (= 6.1.6)
77
+ activesupport (= 6.1.6)
78
+ activestorage (6.1.6)
79
+ actionpack (= 6.1.6)
80
+ activejob (= 6.1.6)
81
+ activerecord (= 6.1.6)
82
+ activesupport (= 6.1.6)
83
+ marcel (~> 1.0)
84
+ mini_mime (>= 1.1.0)
85
+ activesupport (6.1.6)
61
86
  concurrent-ruby (~> 1.0, >= 1.0.2)
62
- i18n (>= 0.7, < 2)
63
- minitest (~> 5.1)
64
- tzinfo (~> 1.1)
65
- arel (9.0.0)
87
+ i18n (>= 1.6, < 2)
88
+ minitest (>= 5.1)
89
+ tzinfo (~> 2.0)
90
+ zeitwerk (~> 2.3)
91
+ appraisal (2.5.0)
92
+ bundler
93
+ rake
94
+ thor (>= 0.14.0)
66
95
  axiom-types (0.1.1)
67
96
  descendants_tracker (~> 0.0.4)
68
97
  ice_nine (~> 0.11.0)
69
98
  thread_safe (~> 0.3, >= 0.3.1)
70
- builder (3.2.3)
99
+ builder (3.2.4)
71
100
  coercible (1.0.0)
72
101
  descendants_tracker (~> 0.0.1)
73
- concurrent-ruby (1.1.5)
74
- crass (1.0.4)
75
- declarative (0.0.10)
76
- declarative-builder (0.1.0)
77
- declarative-option (< 0.2.0)
78
- declarative-option (0.1.0)
102
+ concurrent-ruby (1.3.6)
103
+ crass (1.0.6)
104
+ declarative (0.0.20)
79
105
  descendants_tracker (0.0.4)
80
106
  thread_safe (~> 0.3, >= 0.3.1)
81
- disposable (0.4.5)
107
+ disposable (0.6.3)
82
108
  declarative (>= 0.0.9, < 1.0.0)
83
- declarative-builder (< 0.2.0)
84
- declarative-option (< 0.2.0)
85
- representable (>= 2.4.0, <= 3.1.0)
86
- uber (< 0.2.0)
87
- dry-configurable (0.7.0)
109
+ representable (>= 3.1.1, < 4)
110
+ dry-configurable (0.15.0)
88
111
  concurrent-ruby (~> 1.0)
89
- dry-container (0.6.0)
112
+ dry-core (~> 0.6)
113
+ dry-container (0.9.0)
90
114
  concurrent-ruby (~> 1.0)
91
- dry-configurable (~> 0.1, >= 0.1.3)
92
- dry-core (0.4.7)
115
+ dry-configurable (~> 0.13, >= 0.13.0)
116
+ dry-core (0.7.1)
93
117
  concurrent-ruby (~> 1.0)
94
- dry-equalizer (0.2.2)
95
- dry-inflector (0.1.2)
96
- dry-logic (0.4.2)
97
- dry-container (~> 0.2, >= 0.2.6)
98
- dry-core (~> 0.2)
99
- dry-equalizer (~> 0.2)
100
- dry-types (0.13.4)
118
+ dry-inflector (0.2.1)
119
+ dry-logic (1.2.0)
120
+ concurrent-ruby (~> 1.0)
121
+ dry-core (~> 0.5, >= 0.5)
122
+ dry-types (1.5.1)
101
123
  concurrent-ruby (~> 1.0)
102
124
  dry-container (~> 0.3)
103
- dry-core (~> 0.4, >= 0.4.4)
104
- dry-equalizer (~> 0.2)
125
+ dry-core (~> 0.5, >= 0.5)
105
126
  dry-inflector (~> 0.1, >= 0.1.2)
106
- dry-logic (~> 0.4, >= 0.4.2)
107
- elasticsearch (7.0.0)
108
- elasticsearch-api (= 7.0.0)
109
- elasticsearch-transport (= 7.0.0)
110
- elasticsearch-api (7.0.0)
111
- multi_json
112
- elasticsearch-transport (7.0.0)
113
- faraday
114
- multi_json
127
+ dry-logic (~> 1.0, >= 1.0.2)
115
128
  equalizer (0.0.11)
116
- erubi (1.8.0)
117
- faraday (0.15.4)
118
- multipart-post (>= 1.2, < 3)
119
- fast_excel (0.2.6)
129
+ erubi (1.10.0)
130
+ fast_excel (0.4.0)
120
131
  ffi (> 1.9, < 2)
121
- ffi (1.10.0)
122
- forwardable (1.2.0)
123
- globalid (0.4.2)
124
- activesupport (>= 4.2.0)
125
- hashie (3.6.0)
126
- i18n (1.5.1)
132
+ ffi (1.15.5)
133
+ forwardable (1.3.2)
134
+ globalid (1.0.0)
135
+ activesupport (>= 5.0)
136
+ hashie (5.0.0)
137
+ i18n (1.14.8)
127
138
  concurrent-ruby (~> 1.0)
128
139
  ice_nine (0.11.2)
129
- iconv (1.0.8)
130
- loofah (2.2.3)
140
+ loofah (2.18.0)
131
141
  crass (~> 1.0.2)
132
142
  nokogiri (>= 1.5.9)
133
143
  mail (2.7.1)
134
144
  mini_mime (>= 0.1.1)
135
- marcel (0.3.3)
136
- mimemagic (~> 0.3.2)
137
- method_source (0.9.2)
138
- mimemagic (0.3.3)
139
- mini_mime (1.0.1)
140
- mini_portile2 (2.4.0)
141
- minitest (5.11.3)
142
- multi_json (1.13.1)
143
- multipart-post (2.0.0)
144
- nio4r (2.3.1)
145
- nokogiri (1.9.1)
146
- mini_portile2 (~> 2.4.0)
147
- rack (2.0.8)
148
- rack-test (1.1.0)
149
- rack (>= 1.0, < 3)
150
- rails (5.2.3)
151
- actioncable (= 5.2.3)
152
- actionmailer (= 5.2.3)
153
- actionpack (= 5.2.3)
154
- actionview (= 5.2.3)
155
- activejob (= 5.2.3)
156
- activemodel (= 5.2.3)
157
- activerecord (= 5.2.3)
158
- activestorage (= 5.2.3)
159
- activesupport (= 5.2.3)
160
- bundler (>= 1.3.0)
161
- railties (= 5.2.3)
145
+ marcel (1.0.2)
146
+ method_source (1.0.0)
147
+ mini_mime (1.1.2)
148
+ minitest (5.26.1)
149
+ nio4r (2.5.8)
150
+ nokogiri (1.13.6-arm64-darwin)
151
+ racc (~> 1.4)
152
+ nokogiri (1.13.6-x86_64-linux)
153
+ racc (~> 1.4)
154
+ racc (1.6.0)
155
+ rack (2.2.4)
156
+ rack-test (2.0.2)
157
+ rack (>= 1.3)
158
+ rails (6.1.6)
159
+ actioncable (= 6.1.6)
160
+ actionmailbox (= 6.1.6)
161
+ actionmailer (= 6.1.6)
162
+ actionpack (= 6.1.6)
163
+ actiontext (= 6.1.6)
164
+ actionview (= 6.1.6)
165
+ activejob (= 6.1.6)
166
+ activemodel (= 6.1.6)
167
+ activerecord (= 6.1.6)
168
+ activestorage (= 6.1.6)
169
+ activesupport (= 6.1.6)
170
+ bundler (>= 1.15.0)
171
+ railties (= 6.1.6)
162
172
  sprockets-rails (>= 2.0.0)
163
173
  rails-dom-testing (2.0.3)
164
174
  activesupport (>= 4.2.0)
165
175
  nokogiri (>= 1.6)
166
- rails-html-sanitizer (1.0.4)
167
- loofah (~> 2.2, >= 2.2.2)
168
- railties (5.2.3)
169
- actionpack (= 5.2.3)
170
- activesupport (= 5.2.3)
176
+ rails-html-sanitizer (1.4.3)
177
+ loofah (~> 2.3)
178
+ railties (6.1.6)
179
+ actionpack (= 6.1.6)
180
+ activesupport (= 6.1.6)
171
181
  method_source
172
- rake (>= 0.8.7)
173
- thor (>= 0.19.0, < 2.0)
174
- rake (10.5.0)
175
- reform (2.2.4)
176
- disposable (>= 0.4.1)
177
- representable (>= 2.4.0, < 3.1.0)
178
- reform-rails (0.1.7)
179
- activemodel (>= 3.2)
180
- reform (>= 2.2.0)
181
- representable (3.0.4)
182
+ rake (>= 12.2)
183
+ thor (~> 1.0)
184
+ rake (13.0.6)
185
+ reform (2.6.2)
186
+ disposable (>= 0.5.0, < 1.0.0)
187
+ representable (>= 3.1.1, < 4)
188
+ uber (< 0.2.0)
189
+ representable (3.2.0)
182
190
  declarative (< 0.1.0)
183
- declarative-option (< 0.2.0)
191
+ trailblazer-option (>= 0.1.1, < 0.2.0)
184
192
  uber (< 0.2.0)
185
- roo (2.7.1)
193
+ roo (2.9.0)
186
194
  nokogiri (~> 1)
187
- rubyzip (~> 1.1, < 2.0.0)
195
+ rubyzip (>= 1.3.0, < 3.0.0)
188
196
  roo-xls (1.2.0)
189
197
  nokogiri
190
198
  roo (>= 2.0.0, < 3)
191
199
  spreadsheet (> 0.9.0)
192
200
  ruby-ole (1.2.12.2)
193
- rubyzip (1.2.2)
194
- searchkick (3.1.3)
195
- activemodel (>= 4.2)
196
- elasticsearch (>= 5)
201
+ rubyzip (2.3.2)
202
+ searchkick (5.0.4)
203
+ activemodel (>= 5.2)
197
204
  hashie
198
- shoulda-context (1.2.2)
199
- spreadsheet (1.2.3)
200
- ruby-ole (>= 1.0)
201
- sprockets (3.7.2)
205
+ shoulda-context (2.0.0)
206
+ spreadsheet (1.3.0)
207
+ ruby-ole
208
+ sprockets (4.1.1)
202
209
  concurrent-ruby (~> 1.0)
203
210
  rack (> 1, < 3)
204
- sprockets-rails (3.2.1)
205
- actionpack (>= 4.0)
206
- activesupport (>= 4.0)
211
+ sprockets-rails (3.4.2)
212
+ actionpack (>= 5.2)
213
+ activesupport (>= 5.2)
207
214
  sprockets (>= 3.0.0)
208
- thor (0.20.3)
215
+ sqlite3 (1.4.4)
216
+ thor (1.2.1)
209
217
  thread_safe (0.3.6)
210
- tzinfo (1.2.5)
211
- thread_safe (~> 0.1)
218
+ trailblazer-option (0.1.2)
219
+ tzinfo (2.0.6)
220
+ concurrent-ruby (~> 1.0)
212
221
  uber (0.1.0)
213
222
  virtus (1.0.5)
214
223
  axiom-types (~> 0.1)
@@ -217,19 +226,26 @@ GEM
217
226
  equalizer (~> 0.0, >= 0.0.9)
218
227
  warehouse_items (0.3.0)
219
228
  activesupport
220
- websocket-driver (0.7.0)
229
+ warning (1.2.1)
230
+ websocket-driver (0.7.5)
221
231
  websocket-extensions (>= 0.1.0)
222
- websocket-extensions (0.1.3)
232
+ websocket-extensions (0.1.5)
233
+ zeitwerk (2.6.18)
223
234
 
224
235
  PLATFORMS
225
- ruby
236
+ arm64-darwin-21
237
+ x86_64-linux
226
238
 
227
239
  DEPENDENCIES
228
- bundler (~> 1.16)
240
+ appraisal
241
+ bundler (>= 2, < 3)
229
242
  minitest (~> 5.0)
230
- rake (~> 10.0)
243
+ rake (>= 12.2)
244
+ reform-rails!
231
245
  shoulda-context
246
+ sqlite3 (= 1.4.4)
232
247
  super_tools!
248
+ warning
233
249
 
234
250
  BUNDLED WITH
235
- 1.17.1
251
+ 2.3.14
@@ -0,0 +1,170 @@
1
+ # Multi-Ruby Version Testing Guide
2
+
3
+ 本專案已設定支援多個 Ruby 版本(2.7.6, 3.0.7, 3.1.7)與 Rails 版本(6.x, 7.x)的測試環境。
4
+
5
+ ## 支援的版本組合
6
+
7
+ ### Ruby 版本
8
+ - **Ruby 2.7.6**
9
+ - **Ruby 3.0.7**
10
+ - **Ruby 3.1.7**
11
+
12
+ ### Rails 版本
13
+ - **Rails 6.1.x**
14
+ - **Rails 7.0.x**
15
+
16
+ ### 測試矩陣(共 6 個組合)
17
+ 1. Ruby 2.7.6 + Rails 6.1
18
+ 2. Ruby 2.7.6 + Rails 7.0
19
+ 3. Ruby 3.0.7 + Rails 6.1
20
+ 4. Ruby 3.0.7 + Rails 7.0
21
+ 5. Ruby 3.1.7 + Rails 6.1
22
+ 6. Ruby 3.1.7 + Rails 7.0
23
+
24
+ ## 專案結構
25
+
26
+ ```
27
+ .
28
+ ├── Appraisals # Appraisal 設定檔
29
+ ├── gemfiles/ # 各版本組合的 Gemfile
30
+ │ ├── ruby_2.7_rails_6.gemfile
31
+ │ ├── ruby_2.7_rails_7.gemfile
32
+ │ ├── ruby_3.0_rails_6.gemfile
33
+ │ ├── ruby_3.0_rails_7.gemfile
34
+ │ ├── ruby_3.1_rails_6.gemfile
35
+ │ └── ruby_3.1_rails_7.gemfile
36
+ ├── bin/test_all # 本地測試所有版本的腳本
37
+ └── .github/workflows/test.yml # GitHub Actions 設定
38
+ ```
39
+
40
+ ## 本地測試
41
+
42
+ ### 測試所有組合
43
+
44
+ ```bash
45
+ bin/test_all
46
+ ```
47
+
48
+ 此腳本會依序測試所有 6 個 Ruby + Rails 版本組合。
49
+
50
+ ### 測試特定組合
51
+
52
+ ```bash
53
+ # Ruby 2.7.6 + Rails 6
54
+ bundle exec appraisal ruby-2.7-rails-6 rake t
55
+
56
+ # Ruby 2.7.6 + Rails 7
57
+ bundle exec appraisal ruby-2.7-rails-7 rake t
58
+
59
+ # Ruby 3.0.7 + Rails 6
60
+ bundle exec appraisal ruby-3.0-rails-6 rake t
61
+
62
+ # Ruby 3.0.7 + Rails 7
63
+ bundle exec appraisal ruby-3.0-rails-7 rake t
64
+
65
+ # Ruby 3.1.7 + Rails 6
66
+ bundle exec appraisal ruby-3.1-rails-6 rake t
67
+
68
+ # Ruby 3.1.7 + Rails 7
69
+ bundle exec appraisal ruby-3.1-rails-7 rake t
70
+ ```
71
+
72
+ ### 安裝所有版本的依賴
73
+
74
+ ```bash
75
+ bundle install
76
+ bundle exec appraisal install
77
+ ```
78
+
79
+ ## GitHub Actions
80
+
81
+ 當你推送程式碼到以下分支時,GitHub Actions 會自動測試所有版本組合:
82
+ - `fix-**`
83
+ - `feat-**`
84
+ - `develop`
85
+ - `master`
86
+ - Pull Requests
87
+
88
+ 測試矩陣會執行所有 6 個 Ruby + Rails 版本組合測試。
89
+
90
+ ### CI 配置
91
+
92
+ GitHub Actions 使用明確的版本號:
93
+ - Ruby: `2.7.6`, `3.0.7`, `3.1.7`
94
+ - Rails: `~> 6.1.0`, `~> 7.0.0`
95
+
96
+ ## 依賴套件相容性
97
+
98
+ 所有主要依賴套件都支援 Ruby 2.7+ 和 Rails 6/7:
99
+
100
+ ### 核心依賴
101
+ - **Rails** - 支援 6.1.x 和 7.0.x
102
+ - **nokogiri** >= 1.6 - 支援 Ruby 2.7+
103
+ - **fast_excel** - 支援 Ruby 2.5+
104
+ - **roo** - 支援 Ruby 2.5+
105
+ - **dry-types** 1.5.1 - 支援 Ruby 2.7+
106
+ - **dry-logic** 1.2.0 - 支援 Ruby 2.7+
107
+ - **reform** 2.6.2 - 支援 Ruby 2.5+
108
+ - **reform-rails** - 支援 Rails 6/7
109
+ - **searchkick** - 支援 Ruby 2.6+
110
+ - **virtus** ~> 1.0.5 - 支援 Ruby 2.7+
111
+
112
+ ### Rails 7 特定依賴
113
+ Rails 7 會自動引入以下額外依賴:
114
+ - `benchmark`
115
+ - `drb`
116
+ - `mutex_m`
117
+ - `securerandom`
118
+
119
+ ## 更新依賴
120
+
121
+ 當你需要更新 gemfiles 時:
122
+
123
+ ```bash
124
+ # 編輯 Appraisals 檔案
125
+ # 然後重新生成 gemfiles
126
+ bundle exec appraisal install
127
+ ```
128
+
129
+ 如需更新某個特定組合的依賴:
130
+
131
+ ```bash
132
+ bundle exec appraisal ruby-3.1-rails-7 bundle update
133
+ ```
134
+
135
+ ## 開發建議
136
+
137
+ 1. **本地開發環境**:建議使用 Ruby 2.7.6 作為預設開發版本(見 `.ruby-version`)
138
+
139
+ 2. **提交前測試**:在提交 PR 前,建議至少測試以下組合:
140
+ - 最低版本:Ruby 2.7.6 + Rails 6.1
141
+ - 最高版本:Ruby 3.1.7 + Rails 7.0
142
+
143
+ 3. **新增依賴**:確保新增的依賴套件都支援:
144
+ - Ruby >= 2.7.0
145
+ - Rails >= 6.1, < 8
146
+
147
+ ## 注意事項
148
+
149
+ - `gemfiles/*.lock` 檔案已加入 `.gitignore`,不會被 commit
150
+ - `gemfiles/*.gemfile` 檔案會被 commit,確保 CI/CD 環境一致性
151
+ - gemspec 中 Rails 版本範圍設定為 `">= 6.1", "< 8"`,支援 Rails 6 和 7
152
+ - 確保新增的依賴套件都支援 Ruby 2.7+ 和 Rails 6/7
153
+
154
+ ## 疑難排解
155
+
156
+ ### 問題:bundle install 失敗
157
+
158
+ ```bash
159
+ # 清理並重新安裝
160
+ rm -rf gemfiles/.bundle
161
+ bundle exec appraisal install
162
+ ```
163
+
164
+ ### 問題:某個組合測試失敗
165
+
166
+ ```bash
167
+ # 重新安裝該組合的依賴
168
+ bundle exec appraisal ruby-3.1-rails-7 bundle install
169
+ bundle exec appraisal ruby-3.1-rails-7 rake t
170
+ ```