active_admin_import 7.0.0 → 8.0.1
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/README.md +37 -3
- data/lib/active_admin_import/importer.rb +23 -20
- data/lib/active_admin_import/version.rb +1 -1
- metadata +3 -39
- data/.github/workflows/test.yml +0 -211
- data/.gitignore +0 -19
- data/.rubocop.yml +0 -43
- data/Gemfile +0 -37
- data/Rakefile +0 -5
- data/active_admin_import.gemspec +0 -22
- data/spec/fixtures/files/author.csv +0 -2
- data/spec/fixtures/files/author_broken_header.csv +0 -2
- data/spec/fixtures/files/author_invalid.csv +0 -2
- data/spec/fixtures/files/author_invalid_format.txt +0 -2
- data/spec/fixtures/files/authors.csv +0 -3
- data/spec/fixtures/files/authors_bom.csv +0 -3
- data/spec/fixtures/files/authors_invalid_db.csv +0 -3
- data/spec/fixtures/files/authors_invalid_model.csv +0 -3
- data/spec/fixtures/files/authors_no_headers.csv +0 -2
- data/spec/fixtures/files/authors_values_exceeded_headers.csv +0 -3
- data/spec/fixtures/files/authors_win1251_win_endline.csv +0 -3
- data/spec/fixtures/files/authors_with_ids.csv +0 -3
- data/spec/fixtures/files/authors_with_semicolons.csv +0 -3
- data/spec/fixtures/files/authors_with_tabs.tsv +0 -3
- data/spec/fixtures/files/empty.csv +0 -0
- data/spec/fixtures/files/only_headers.csv +0 -1
- data/spec/fixtures/files/post_comments.csv +0 -3
- data/spec/fixtures/files/posts.csv +0 -4
- data/spec/fixtures/files/posts_for_author.csv +0 -3
- data/spec/fixtures/files/posts_for_author_no_headers.csv +0 -2
- data/spec/import_result_spec.rb +0 -39
- data/spec/import_spec.rb +0 -734
- data/spec/model_spec.rb +0 -6
- data/spec/spec_helper.rb +0 -54
- data/spec/support/active_model_lint.rb +0 -15
- data/spec/support/admin.rb +0 -32
- data/spec/support/import_form_selectors.rb +0 -24
- data/spec/support/rails_template.rb +0 -71
- data/spec/support/test_app_paths.rb +0 -14
- data/tasks/test.rake +0 -30
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 819977aed599842eef5880ab33a1c266653ba87b940e622eb0f94d14441333db
|
|
4
|
+
data.tar.gz: aca4a062d3febdafe940182362fbd2405f2f9d7a38bd9bc0b7e8f482bbb14a99
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '096418fa77f5de062e20f395d973edf6b342240bc050ebcf8a08abf616ce7aab293cac48d4cfb87d80a9a55f0dccf32534c28c3432c9c95f1281b215e3a7b670'
|
|
7
|
+
data.tar.gz: 706bb15939f91914f40965820296d27cb0db8cdef876882f6b2fe94c94c8ddf9d3decae457278d7e7a124910c5ba602337ea3eef2ac4a97a461011038077c256
|
data/README.md
CHANGED
|
@@ -225,7 +225,43 @@ end
|
|
|
225
225
|
|
|
226
226
|
##### Update existing records by id
|
|
227
227
|
|
|
228
|
-
|
|
228
|
+
Two strategies, depending on your database and whether you need validations.
|
|
229
|
+
|
|
230
|
+
###### Native upsert (recommended where supported)
|
|
231
|
+
|
|
232
|
+
On databases that support upserts (MySQL, PostgreSQL 9.5+, SQLite 3.24+),
|
|
233
|
+
`:on_duplicate_key_update` updates colliding rows and inserts new ones in a
|
|
234
|
+
single statement — no extra delete. The option is passed straight to
|
|
235
|
+
`activerecord-import`, so its shape depends on the adapter:
|
|
236
|
+
|
|
237
|
+
```ruby
|
|
238
|
+
# PostgreSQL / SQLite
|
|
239
|
+
on_duplicate_key_update: { conflict_target: [:id], columns: %i[name last_name birthday] }
|
|
240
|
+
|
|
241
|
+
# MySQL (infers the key from the columns)
|
|
242
|
+
on_duplicate_key_update: %i[name last_name birthday]
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
```ruby
|
|
246
|
+
ActiveAdmin.register Author do
|
|
247
|
+
active_admin_import validate: false,
|
|
248
|
+
on_duplicate_key_update: { conflict_target: [:id], columns: %i[name last_name birthday] }
|
|
249
|
+
end
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
Notes:
|
|
253
|
+
|
|
254
|
+
* Only the columns you list are updated; other columns on the existing row keep their values.
|
|
255
|
+
* Use `validate: false` — `activerecord-import` runs uniqueness validations against the very rows the upsert is about to overwrite, so `validates_uniqueness_of` would otherwise reject the update.
|
|
256
|
+
* Active Record callbacks are not fired for bulk imports.
|
|
257
|
+
|
|
258
|
+
###### Delete-then-insert (any database)
|
|
259
|
+
|
|
260
|
+
When you can't rely on upsert support — an older database, or you need your model
|
|
261
|
+
validations to run — delete the colliding rows just before each batch insert.
|
|
262
|
+
The old row is gone before the insert, so `validates_uniqueness_of` doesn't trip,
|
|
263
|
+
at the cost of a second query and full-row **replacement** (columns absent from
|
|
264
|
+
the CSV are reset, not preserved):
|
|
229
265
|
|
|
230
266
|
```ruby
|
|
231
267
|
ActiveAdmin.register Post do
|
|
@@ -235,8 +271,6 @@ ActiveAdmin.register Post do
|
|
|
235
271
|
end
|
|
236
272
|
```
|
|
237
273
|
|
|
238
|
-
For databases that support upserts you can use `:on_duplicate_key_update` instead.
|
|
239
|
-
|
|
240
274
|
##### Tune batch size
|
|
241
275
|
|
|
242
276
|
```ruby
|
|
@@ -82,23 +82,15 @@ module ActiveAdminImport
|
|
|
82
82
|
# end
|
|
83
83
|
#
|
|
84
84
|
def batch_slice_columns(slice_columns)
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
@use_indexes = []
|
|
89
|
-
headers.values.each_with_index do |val, index|
|
|
90
|
-
@use_indexes << index if val.in?(slice_columns)
|
|
91
|
-
end
|
|
92
|
-
return csv_lines if @use_indexes.empty?
|
|
93
|
-
|
|
94
|
-
# slice CSV headers
|
|
95
|
-
@headers = headers.to_a.values_at(*@use_indexes).to_h
|
|
96
|
-
end
|
|
85
|
+
columns = headers.values
|
|
86
|
+
indexes = columns.each_index.select { |i| columns[i].in?(slice_columns) }
|
|
87
|
+
return csv_lines if indexes.empty?
|
|
97
88
|
|
|
98
|
-
#
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
89
|
+
# @headers is reset to the full set at the start of every batch (see
|
|
90
|
+
# #batch_import), so each call narrows the previous call's result and every
|
|
91
|
+
# batch slices the same way — calling this more than once now composes (#186).
|
|
92
|
+
@headers = headers.to_a.values_at(*indexes).to_h
|
|
93
|
+
csv_lines.map! { |line| line.values_at(*indexes) }
|
|
102
94
|
end
|
|
103
95
|
|
|
104
96
|
def values_at(header_key)
|
|
@@ -129,10 +121,18 @@ module ActiveAdminImport
|
|
|
129
121
|
end
|
|
130
122
|
|
|
131
123
|
def prepare_headers
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
124
|
+
names = self.headers.present? ? self.headers : yield
|
|
125
|
+
blank_positions = names.each_index.select { |i| names[i].to_s.strip.empty? }
|
|
126
|
+
unless blank_positions.empty?
|
|
127
|
+
raise ActiveAdminImport::Exception,
|
|
128
|
+
"blank column header at column #{blank_positions.map { |i| i + 1 }.join(', ')}"
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
names = names.map(&:to_s)
|
|
132
|
+
# @source_headers is the complete parsed header row; batch_import copies it
|
|
133
|
+
# into the per-batch working @headers (see #batch_import).
|
|
134
|
+
@source_headers = Hash[names.zip(names.map { |el| el.underscore.gsub(/\s+/, '_') })].with_indifferent_access
|
|
135
|
+
@source_headers.merge!(options[:headers_rewrites].symbolize_keys.slice(*@source_headers.symbolize_keys.keys))
|
|
136
136
|
end
|
|
137
137
|
|
|
138
138
|
def run_callback(name)
|
|
@@ -141,6 +141,9 @@ module ActiveAdminImport
|
|
|
141
141
|
|
|
142
142
|
def batch_import
|
|
143
143
|
batch_result = nil
|
|
144
|
+
# Every batch re-parses full-width rows, so restore the full header set
|
|
145
|
+
# before slicing; batch_slice_columns then narrows this working copy.
|
|
146
|
+
@headers = @source_headers.dup
|
|
144
147
|
@resource.transaction do
|
|
145
148
|
run_callback(:before_batch_import)
|
|
146
149
|
batch_result = resource.import(headers.values, csv_lines, import_options)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: active_admin_import
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 8.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Igor Fedoronchuk
|
|
@@ -78,14 +78,8 @@ executables: []
|
|
|
78
78
|
extensions: []
|
|
79
79
|
extra_rdoc_files: []
|
|
80
80
|
files:
|
|
81
|
-
- ".github/workflows/test.yml"
|
|
82
|
-
- ".gitignore"
|
|
83
|
-
- ".rubocop.yml"
|
|
84
|
-
- Gemfile
|
|
85
81
|
- LICENSE
|
|
86
82
|
- README.md
|
|
87
|
-
- Rakefile
|
|
88
|
-
- active_admin_import.gemspec
|
|
89
83
|
- app/views/admin/import.html.erb
|
|
90
84
|
- config/locales/de.yml
|
|
91
85
|
- config/locales/en.yml
|
|
@@ -109,36 +103,6 @@ files:
|
|
|
109
103
|
- lib/active_admin_import/model.rb
|
|
110
104
|
- lib/active_admin_import/options.rb
|
|
111
105
|
- lib/active_admin_import/version.rb
|
|
112
|
-
- spec/fixtures/files/author.csv
|
|
113
|
-
- spec/fixtures/files/author_broken_header.csv
|
|
114
|
-
- spec/fixtures/files/author_invalid.csv
|
|
115
|
-
- spec/fixtures/files/author_invalid_format.txt
|
|
116
|
-
- spec/fixtures/files/authors.csv
|
|
117
|
-
- spec/fixtures/files/authors_bom.csv
|
|
118
|
-
- spec/fixtures/files/authors_invalid_db.csv
|
|
119
|
-
- spec/fixtures/files/authors_invalid_model.csv
|
|
120
|
-
- spec/fixtures/files/authors_no_headers.csv
|
|
121
|
-
- spec/fixtures/files/authors_values_exceeded_headers.csv
|
|
122
|
-
- spec/fixtures/files/authors_win1251_win_endline.csv
|
|
123
|
-
- spec/fixtures/files/authors_with_ids.csv
|
|
124
|
-
- spec/fixtures/files/authors_with_semicolons.csv
|
|
125
|
-
- spec/fixtures/files/authors_with_tabs.tsv
|
|
126
|
-
- spec/fixtures/files/empty.csv
|
|
127
|
-
- spec/fixtures/files/only_headers.csv
|
|
128
|
-
- spec/fixtures/files/post_comments.csv
|
|
129
|
-
- spec/fixtures/files/posts.csv
|
|
130
|
-
- spec/fixtures/files/posts_for_author.csv
|
|
131
|
-
- spec/fixtures/files/posts_for_author_no_headers.csv
|
|
132
|
-
- spec/import_result_spec.rb
|
|
133
|
-
- spec/import_spec.rb
|
|
134
|
-
- spec/model_spec.rb
|
|
135
|
-
- spec/spec_helper.rb
|
|
136
|
-
- spec/support/active_model_lint.rb
|
|
137
|
-
- spec/support/admin.rb
|
|
138
|
-
- spec/support/import_form_selectors.rb
|
|
139
|
-
- spec/support/rails_template.rb
|
|
140
|
-
- spec/support/test_app_paths.rb
|
|
141
|
-
- tasks/test.rake
|
|
142
106
|
homepage: https://github.com/activeadmin-plugins/active_admin_import
|
|
143
107
|
licenses:
|
|
144
108
|
- MIT
|
|
@@ -150,14 +114,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
150
114
|
requirements:
|
|
151
115
|
- - ">="
|
|
152
116
|
- !ruby/object:Gem::Version
|
|
153
|
-
version: 3.
|
|
117
|
+
version: 3.3.0
|
|
154
118
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
119
|
requirements:
|
|
156
120
|
- - ">="
|
|
157
121
|
- !ruby/object:Gem::Version
|
|
158
122
|
version: '0'
|
|
159
123
|
requirements: []
|
|
160
|
-
rubygems_version: 3.
|
|
124
|
+
rubygems_version: 3.6.9
|
|
161
125
|
specification_version: 4
|
|
162
126
|
summary: ActiveAdmin import based on activerecord-import gem.
|
|
163
127
|
test_files: []
|
data/.github/workflows/test.yml
DELETED
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
on:
|
|
3
|
-
pull_request:
|
|
4
|
-
push:
|
|
5
|
-
branches: [master]
|
|
6
|
-
|
|
7
|
-
permissions:
|
|
8
|
-
contents: read
|
|
9
|
-
pages: write
|
|
10
|
-
id-token: write
|
|
11
|
-
|
|
12
|
-
jobs:
|
|
13
|
-
test:
|
|
14
|
-
name: Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }} / AA ${{ matrix.activeadmin }} / SQLite
|
|
15
|
-
runs-on: ubuntu-latest
|
|
16
|
-
strategy:
|
|
17
|
-
fail-fast: false
|
|
18
|
-
matrix:
|
|
19
|
-
ruby: ['3.2', '3.3', '3.4']
|
|
20
|
-
rails: ['7.1.0', '7.2.0', '8.0.0']
|
|
21
|
-
activeadmin: ['3.2.0', '3.3.0', '3.4.0', '3.5.1']
|
|
22
|
-
exclude:
|
|
23
|
-
- rails: '8.0.0'
|
|
24
|
-
activeadmin: '3.2.0'
|
|
25
|
-
include:
|
|
26
|
-
- ruby: '3.4'
|
|
27
|
-
rails: '7.2.0'
|
|
28
|
-
activeadmin: '4.0.0.beta22'
|
|
29
|
-
- ruby: '3.4'
|
|
30
|
-
rails: '8.0.0'
|
|
31
|
-
activeadmin: '4.0.0.beta22'
|
|
32
|
-
env:
|
|
33
|
-
RAILS: ${{ matrix.rails }}
|
|
34
|
-
AA: ${{ matrix.activeadmin }}
|
|
35
|
-
steps:
|
|
36
|
-
- uses: actions/checkout@v4
|
|
37
|
-
- uses: ruby/setup-ruby@v1
|
|
38
|
-
with:
|
|
39
|
-
ruby-version: ${{ matrix.ruby }}
|
|
40
|
-
bundler-cache: true
|
|
41
|
-
- name: AA v4 environment summary
|
|
42
|
-
if: matrix.activeadmin == '4.0.0.beta22'
|
|
43
|
-
run: |
|
|
44
|
-
bundle exec gem list activeadmin
|
|
45
|
-
bundle info activeadmin
|
|
46
|
-
- name: Run tests
|
|
47
|
-
run: bundle exec rspec spec
|
|
48
|
-
test-mysql:
|
|
49
|
-
name: Ruby 3.4 / Rails 8.0.0 / AA 3.5.1 / MySQL 8.0
|
|
50
|
-
runs-on: ubuntu-latest
|
|
51
|
-
env:
|
|
52
|
-
RAILS: '8.0.0'
|
|
53
|
-
AA: '3.5.1'
|
|
54
|
-
DB: mysql
|
|
55
|
-
DB_HOST: 127.0.0.1
|
|
56
|
-
DB_PORT: 3306
|
|
57
|
-
DB_USERNAME: root
|
|
58
|
-
DB_PASSWORD: root
|
|
59
|
-
services:
|
|
60
|
-
mysql:
|
|
61
|
-
image: mysql:8.0
|
|
62
|
-
env:
|
|
63
|
-
MYSQL_ROOT_PASSWORD: root
|
|
64
|
-
MYSQL_DATABASE: active_admin_import_test
|
|
65
|
-
ports:
|
|
66
|
-
- 3306:3306
|
|
67
|
-
options: >-
|
|
68
|
-
--health-cmd="mysqladmin ping -h localhost -uroot -proot"
|
|
69
|
-
--health-interval=10s
|
|
70
|
-
--health-timeout=5s
|
|
71
|
-
--health-retries=10
|
|
72
|
-
steps:
|
|
73
|
-
- uses: actions/checkout@v4
|
|
74
|
-
- uses: ruby/setup-ruby@v1
|
|
75
|
-
with:
|
|
76
|
-
ruby-version: '3.4'
|
|
77
|
-
bundler-cache: true
|
|
78
|
-
- name: Run tests
|
|
79
|
-
run: bundle exec rspec spec
|
|
80
|
-
test-postgres:
|
|
81
|
-
name: Ruby 3.4 / Rails 8.0.0 / AA 3.5.1 / PostgreSQL 16
|
|
82
|
-
runs-on: ubuntu-latest
|
|
83
|
-
env:
|
|
84
|
-
RAILS: '8.0.0'
|
|
85
|
-
AA: '3.5.1'
|
|
86
|
-
DB: postgres
|
|
87
|
-
DB_HOST: 127.0.0.1
|
|
88
|
-
DB_PORT: 5432
|
|
89
|
-
DB_USERNAME: postgres
|
|
90
|
-
DB_PASSWORD: postgres
|
|
91
|
-
services:
|
|
92
|
-
postgres:
|
|
93
|
-
image: postgres:16
|
|
94
|
-
env:
|
|
95
|
-
POSTGRES_USER: postgres
|
|
96
|
-
POSTGRES_PASSWORD: postgres
|
|
97
|
-
POSTGRES_DB: active_admin_import_test
|
|
98
|
-
ports:
|
|
99
|
-
- 5432:5432
|
|
100
|
-
options: >-
|
|
101
|
-
--health-cmd="pg_isready -U postgres"
|
|
102
|
-
--health-interval=10s
|
|
103
|
-
--health-timeout=5s
|
|
104
|
-
--health-retries=10
|
|
105
|
-
steps:
|
|
106
|
-
- uses: actions/checkout@v4
|
|
107
|
-
- uses: ruby/setup-ruby@v1
|
|
108
|
-
with:
|
|
109
|
-
ruby-version: '3.4'
|
|
110
|
-
bundler-cache: true
|
|
111
|
-
- name: Run tests
|
|
112
|
-
run: bundle exec rspec spec
|
|
113
|
-
test-postgres-aa4:
|
|
114
|
-
name: Ruby 3.4 / Rails 8.0.0 / AA 4.0.0.beta22 / PostgreSQL 16
|
|
115
|
-
runs-on: ubuntu-latest
|
|
116
|
-
env:
|
|
117
|
-
RAILS: '8.0.0'
|
|
118
|
-
AA: '4.0.0.beta22'
|
|
119
|
-
DB: postgres
|
|
120
|
-
DB_HOST: 127.0.0.1
|
|
121
|
-
DB_PORT: 5432
|
|
122
|
-
DB_USERNAME: postgres
|
|
123
|
-
DB_PASSWORD: postgres
|
|
124
|
-
services:
|
|
125
|
-
postgres:
|
|
126
|
-
image: postgres:16
|
|
127
|
-
env:
|
|
128
|
-
POSTGRES_USER: postgres
|
|
129
|
-
POSTGRES_PASSWORD: postgres
|
|
130
|
-
POSTGRES_DB: active_admin_import_test
|
|
131
|
-
ports:
|
|
132
|
-
- 5432:5432
|
|
133
|
-
options: >-
|
|
134
|
-
--health-cmd="pg_isready -U postgres"
|
|
135
|
-
--health-interval=10s
|
|
136
|
-
--health-timeout=5s
|
|
137
|
-
--health-retries=10
|
|
138
|
-
steps:
|
|
139
|
-
- uses: actions/checkout@v4
|
|
140
|
-
- uses: ruby/setup-ruby@v1
|
|
141
|
-
with:
|
|
142
|
-
ruby-version: '3.4'
|
|
143
|
-
bundler-cache: true
|
|
144
|
-
- name: AA v4 environment summary
|
|
145
|
-
run: |
|
|
146
|
-
bundle exec gem list activeadmin
|
|
147
|
-
bundle info activeadmin
|
|
148
|
-
- name: Run tests
|
|
149
|
-
run: bundle exec rspec spec
|
|
150
|
-
coverage:
|
|
151
|
-
name: Coverage
|
|
152
|
-
runs-on: ubuntu-latest
|
|
153
|
-
steps:
|
|
154
|
-
- uses: actions/checkout@v4
|
|
155
|
-
- uses: ruby/setup-ruby@v1
|
|
156
|
-
with:
|
|
157
|
-
ruby-version: '3.4'
|
|
158
|
-
bundler-cache: true
|
|
159
|
-
- name: Run tests with coverage
|
|
160
|
-
run: bundle exec rspec spec
|
|
161
|
-
- name: Upload coverage
|
|
162
|
-
uses: actions/upload-artifact@v4
|
|
163
|
-
with:
|
|
164
|
-
name: coverage
|
|
165
|
-
path: coverage/
|
|
166
|
-
|
|
167
|
-
- name: Generate badge.json
|
|
168
|
-
run: |
|
|
169
|
-
LAST_RUN="coverage/.last_run.json"
|
|
170
|
-
if [ ! -f "$LAST_RUN" ]; then
|
|
171
|
-
mkdir -p badge
|
|
172
|
-
echo '{"schemaVersion":1,"label":"coverage","message":"unknown","color":"lightgrey"}' > badge/badge.json
|
|
173
|
-
exit 0
|
|
174
|
-
fi
|
|
175
|
-
PERCENT=$(ruby -rjson -e "puts JSON.parse(File.read('$LAST_RUN')).dig('result','line').round(1)")
|
|
176
|
-
PERCENT_NUM=$(ruby -rjson -e "puts JSON.parse(File.read('$LAST_RUN')).dig('result','line')")
|
|
177
|
-
if ruby -e "exit(($PERCENT_NUM >= 90) ? 0 : 1)"; then COLOR="brightgreen"
|
|
178
|
-
elif ruby -e "exit(($PERCENT_NUM >= 75) ? 0 : 1)"; then COLOR="green"
|
|
179
|
-
elif ruby -e "exit(($PERCENT_NUM >= 60) ? 0 : 1)"; then COLOR="yellow"
|
|
180
|
-
else COLOR="red"; fi
|
|
181
|
-
mkdir -p badge
|
|
182
|
-
echo "{\"schemaVersion\":1,\"label\":\"coverage\",\"message\":\"${PERCENT}%\",\"color\":\"${COLOR}\"}" > badge/badge.json
|
|
183
|
-
|
|
184
|
-
- name: Upload badge artifact
|
|
185
|
-
uses: actions/upload-artifact@v4
|
|
186
|
-
with:
|
|
187
|
-
name: coverage-badge
|
|
188
|
-
path: badge
|
|
189
|
-
|
|
190
|
-
deploy-coverage:
|
|
191
|
-
needs: coverage
|
|
192
|
-
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
|
|
193
|
-
runs-on: ubuntu-latest
|
|
194
|
-
environment:
|
|
195
|
-
name: github-pages
|
|
196
|
-
url: ${{ steps.deployment.outputs.page_url }}
|
|
197
|
-
steps:
|
|
198
|
-
- name: Download coverage badge
|
|
199
|
-
uses: actions/download-artifact@v4
|
|
200
|
-
with:
|
|
201
|
-
name: coverage-badge
|
|
202
|
-
path: .
|
|
203
|
-
- name: Setup Pages
|
|
204
|
-
uses: actions/configure-pages@v5
|
|
205
|
-
- name: Upload Pages artifact
|
|
206
|
-
uses: actions/upload-pages-artifact@v3
|
|
207
|
-
with:
|
|
208
|
-
path: .
|
|
209
|
-
- name: Deploy to GitHub Pages
|
|
210
|
-
id: deployment
|
|
211
|
-
uses: actions/deploy-pages@v4
|
data/.gitignore
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
*.rbc
|
|
2
|
-
*.sassc
|
|
3
|
-
.sass-cache
|
|
4
|
-
capybara-*.html
|
|
5
|
-
.rspec
|
|
6
|
-
/.bundle
|
|
7
|
-
/vendor/bundle
|
|
8
|
-
/log/*
|
|
9
|
-
/tmp/*
|
|
10
|
-
/db/*.sqlite3
|
|
11
|
-
/public/system/*
|
|
12
|
-
/coverage/
|
|
13
|
-
/spec/tmp/*
|
|
14
|
-
**.orig
|
|
15
|
-
rerun.txt
|
|
16
|
-
pickle-email-*.html
|
|
17
|
-
pkg
|
|
18
|
-
spec/rails
|
|
19
|
-
Gemfile.lock
|
data/.rubocop.yml
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
AllCops:
|
|
2
|
-
TargetRubyVersion: 2.3
|
|
3
|
-
Exclude:
|
|
4
|
-
- 'spec/fixtures/**/*'
|
|
5
|
-
|
|
6
|
-
Style/IndentationWidth:
|
|
7
|
-
Width: 2
|
|
8
|
-
|
|
9
|
-
Style/Documentation:
|
|
10
|
-
Enabled: false
|
|
11
|
-
|
|
12
|
-
Style/Encoding:
|
|
13
|
-
Enabled: false
|
|
14
|
-
|
|
15
|
-
Style/MultilineOperationIndentation:
|
|
16
|
-
EnforcedStyle: indented
|
|
17
|
-
|
|
18
|
-
Style/FirstParameterIndentation:
|
|
19
|
-
EnforcedStyle: special_for_inner_method_call_in_parentheses
|
|
20
|
-
|
|
21
|
-
Metrics/AbcSize:
|
|
22
|
-
Max: 25
|
|
23
|
-
|
|
24
|
-
Metrics/LineLength:
|
|
25
|
-
Max: 120
|
|
26
|
-
|
|
27
|
-
Metrics/MethodLength:
|
|
28
|
-
Max: 40
|
|
29
|
-
|
|
30
|
-
Metrics/ClassLength:
|
|
31
|
-
Max: 250
|
|
32
|
-
|
|
33
|
-
Metrics/ModuleLength:
|
|
34
|
-
Max: 250
|
|
35
|
-
|
|
36
|
-
Metrics/CyclomaticComplexity:
|
|
37
|
-
Max: 8
|
|
38
|
-
|
|
39
|
-
Metrics/PerceivedComplexity:
|
|
40
|
-
Max: 8
|
|
41
|
-
|
|
42
|
-
Rails:
|
|
43
|
-
Enabled: true
|
data/Gemfile
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
source 'https://rubygems.org'
|
|
2
|
-
gemspec
|
|
3
|
-
|
|
4
|
-
default_rails_version = '7.1.0'
|
|
5
|
-
default_activeadmin_version = '3.2.0'
|
|
6
|
-
|
|
7
|
-
# `~> 4.0.0.beta22` would admit 4.0.0 GA — pin prereleases exactly so the
|
|
8
|
-
# CI cell tests the AA build it claims to test.
|
|
9
|
-
aa_version = ENV['AA'] || default_activeadmin_version
|
|
10
|
-
aa_op = aa_version.match?(/[a-z]/) ? '=' : '~>'
|
|
11
|
-
|
|
12
|
-
gem 'rails', "~> #{ENV['RAILS'] || default_rails_version}"
|
|
13
|
-
gem 'activeadmin', "#{aa_op} #{aa_version}"
|
|
14
|
-
|
|
15
|
-
if ENV['AA']&.start_with?('4')
|
|
16
|
-
# AA 4 uses Tailwind + importmap; sass-rails conflicts with Tailwind v4.
|
|
17
|
-
gem 'cssbundling-rails'
|
|
18
|
-
gem 'importmap-rails'
|
|
19
|
-
else
|
|
20
|
-
gem 'sprockets-rails'
|
|
21
|
-
gem 'sass-rails'
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
group :test do
|
|
25
|
-
gem 'simplecov', require: false
|
|
26
|
-
gem 'rspec-rails'
|
|
27
|
-
case ENV['DB']
|
|
28
|
-
when 'mysql'
|
|
29
|
-
gem 'mysql2'
|
|
30
|
-
when 'postgres', 'postgresql'
|
|
31
|
-
gem 'pg'
|
|
32
|
-
else
|
|
33
|
-
gem 'sqlite3', '~> 2.0'
|
|
34
|
-
end
|
|
35
|
-
gem 'database_cleaner'
|
|
36
|
-
gem 'capybara'
|
|
37
|
-
end
|
data/Rakefile
DELETED
data/active_admin_import.gemspec
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
|
2
|
-
# frozen_string_literal: true
|
|
3
|
-
require File.expand_path('../lib/active_admin_import/version', __FILE__)
|
|
4
|
-
|
|
5
|
-
Gem::Specification.new do |gem|
|
|
6
|
-
gem.authors = ['Igor Fedoronchuk']
|
|
7
|
-
gem.email = ['fedoronchuk@gmail.com']
|
|
8
|
-
gem.description = 'The most efficient way to import for Active Admin'
|
|
9
|
-
gem.summary = 'ActiveAdmin import based on activerecord-import gem.'
|
|
10
|
-
gem.homepage = 'https://github.com/activeadmin-plugins/active_admin_import'
|
|
11
|
-
gem.license = 'MIT'
|
|
12
|
-
gem.required_ruby_version = '>= 3.1.0'
|
|
13
|
-
gem.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR)
|
|
14
|
-
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
|
|
15
|
-
gem.name = 'active_admin_import'
|
|
16
|
-
gem.require_paths = ['lib']
|
|
17
|
-
gem.version = ActiveAdminImport::VERSION
|
|
18
|
-
gem.add_runtime_dependency 'activerecord-import', '>= 2.0'
|
|
19
|
-
gem.add_runtime_dependency 'rchardet', '>= 1.6'
|
|
20
|
-
gem.add_runtime_dependency 'rubyzip', '>= 1.2'
|
|
21
|
-
gem.add_dependency 'activeadmin', '>= 3.0', '< 4.1'
|
|
22
|
-
end
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Name,Last name,Birthday
|