solidus_importer 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.circleci/config.yml +35 -0
- data/.gem_release.yml +5 -0
- data/.github/stale.yml +17 -0
- data/.gitignore +20 -0
- data/.hound.yml +8 -0
- data/.rspec +2 -0
- data/.rubocop.yml +2 -0
- data/Gemfile +33 -0
- data/LICENSE +26 -0
- data/README.md +170 -0
- data/Rakefile +6 -0
- data/app/assets/javascripts/spree/backend/solidus_importer.js +2 -0
- data/app/assets/javascripts/spree/frontend/solidus_importer.js +2 -0
- data/app/assets/stylesheets/spree/backend/solidus_importer.css +16 -0
- data/app/assets/stylesheets/spree/frontend/solidus_importer.css +4 -0
- data/app/controllers/spree/admin/solidus_importer/import_rows_controller.rb +24 -0
- data/app/controllers/spree/admin/solidus_importer/imports_controller.rb +44 -0
- data/app/jobs/solidus_importer/import_job.rb +30 -0
- data/app/models/solidus_importer/import.rb +48 -0
- data/app/models/solidus_importer/row.rb +26 -0
- data/app/views/spree/admin/solidus_importer/import_rows/show.html.erb +46 -0
- data/app/views/spree/admin/solidus_importer/imports/_form.html.erb +14 -0
- data/app/views/spree/admin/solidus_importer/imports/index.html.erb +80 -0
- data/app/views/spree/admin/solidus_importer/imports/new.html.erb +13 -0
- data/app/views/spree/admin/solidus_importer/imports/show.html.erb +87 -0
- data/bin/console +17 -0
- data/bin/rails +7 -0
- data/bin/rails-engine +13 -0
- data/bin/rails-sandbox +16 -0
- data/bin/rake +7 -0
- data/bin/sandbox +84 -0
- data/bin/setup +8 -0
- data/config/initializers/spree.rb +11 -0
- data/config/locales/en.yml +28 -0
- data/config/routes.rb +11 -0
- data/db/migrate/20191216101011_create_solidus_importer_imports.rb +19 -0
- data/db/migrate/20191216101012_create_solidus_importer_rows.rb +14 -0
- data/examples/importers/custom_importer.rb +20 -0
- data/examples/processors/notify_on_failure.rb +22 -0
- data/lib/generators/solidus_importer/install/install_generator.rb +22 -0
- data/lib/solidus_importer.rb +25 -0
- data/lib/solidus_importer/base_importer.rb +26 -0
- data/lib/solidus_importer/configuration.rb +39 -0
- data/lib/solidus_importer/engine.rb +23 -0
- data/lib/solidus_importer/exception.rb +5 -0
- data/lib/solidus_importer/factories.rb +4 -0
- data/lib/solidus_importer/process_import.rb +88 -0
- data/lib/solidus_importer/process_row.rb +46 -0
- data/lib/solidus_importer/processors/address.rb +47 -0
- data/lib/solidus_importer/processors/base.rb +15 -0
- data/lib/solidus_importer/processors/customer.rb +41 -0
- data/lib/solidus_importer/processors/log.rb +15 -0
- data/lib/solidus_importer/processors/option_types.rb +43 -0
- data/lib/solidus_importer/processors/option_values.rb +49 -0
- data/lib/solidus_importer/processors/order.rb +40 -0
- data/lib/solidus_importer/processors/product.rb +51 -0
- data/lib/solidus_importer/processors/product_images.rb +30 -0
- data/lib/solidus_importer/processors/taxon.rb +52 -0
- data/lib/solidus_importer/processors/variant.rb +51 -0
- data/lib/solidus_importer/processors/variant_images.rb +30 -0
- data/lib/solidus_importer/version.rb +5 -0
- data/solidus_importer.gemspec +36 -0
- data/spec/factories/solidus_importer_imports.rb +27 -0
- data/spec/factories/solidus_importer_rows.rb +82 -0
- data/spec/features/admin/solidus_importer/import_rows_spec.rb +30 -0
- data/spec/features/admin/solidus_importer/imports_spec.rb +121 -0
- data/spec/features/solidus_importer/import_spec.rb +138 -0
- data/spec/features/solidus_importer/processors_spec.rb +53 -0
- data/spec/fixtures/solidus_importer/apparel.csv +23 -0
- data/spec/fixtures/solidus_importer/customers.csv +3 -0
- data/spec/fixtures/solidus_importer/home-and-garden.csv +22 -0
- data/spec/fixtures/solidus_importer/invalid_headers.csv +3 -0
- data/spec/fixtures/solidus_importer/invalid_product.csv +2 -0
- data/spec/fixtures/solidus_importer/jewelery.csv +55 -0
- data/spec/fixtures/solidus_importer/orders.csv +5 -0
- data/spec/fixtures/solidus_importer/products.csv +8 -0
- data/spec/fixtures/solidus_importer/thinking-cat.jpg +0 -0
- data/spec/jobs/solidus_importer/import_job_spec.rb +54 -0
- data/spec/lib/solidus_importer/base_importer_spec.rb +23 -0
- data/spec/lib/solidus_importer/process_import_spec.rb +74 -0
- data/spec/lib/solidus_importer/process_row_spec.rb +24 -0
- data/spec/lib/solidus_importer/processors/address_spec.rb +18 -0
- data/spec/lib/solidus_importer/processors/base_spec.rb +9 -0
- data/spec/lib/solidus_importer/processors/customer_spec.rb +65 -0
- data/spec/lib/solidus_importer/processors/log_spec.rb +18 -0
- data/spec/lib/solidus_importer/processors/option_types_spec.rb +38 -0
- data/spec/lib/solidus_importer/processors/option_values_spec.rb +43 -0
- data/spec/lib/solidus_importer/processors/order_spec.rb +56 -0
- data/spec/lib/solidus_importer/processors/product_images_spec.rb +42 -0
- data/spec/lib/solidus_importer/processors/product_spec.rb +66 -0
- data/spec/lib/solidus_importer/processors/taxon_spec.rb +33 -0
- data/spec/lib/solidus_importer/processors/variant_images_spec.rb +44 -0
- data/spec/lib/solidus_importer/processors/variant_spec.rb +86 -0
- data/spec/lib/solidus_importer_spec.rb +14 -0
- data/spec/models/solidus_importer/import_spec.rb +60 -0
- data/spec/models/solidus_importer/row_spec.rb +18 -0
- data/spec/spec_helper.rb +27 -0
- data/spec/support/solidus_importer_helpers.rb +13 -0
- metadata +227 -0
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe SolidusImporter::Row do
|
6
|
+
subject(:described_instance) { described_class.new(args) }
|
7
|
+
|
8
|
+
let(:args) {}
|
9
|
+
|
10
|
+
it { expect(described_instance).not_to be_valid }
|
11
|
+
|
12
|
+
context 'with a file entity and some row data' do
|
13
|
+
let(:import) { build_stubbed(:solidus_importer_import_customers) }
|
14
|
+
let(:args) { { import: import, data: { 'a_field' => a_value } } }
|
15
|
+
|
16
|
+
it { expect(described_instance).to be_valid }
|
17
|
+
end
|
18
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Configure Rails Environment
|
4
|
+
ENV['RAILS_ENV'] = 'test'
|
5
|
+
|
6
|
+
# Run Coverage report
|
7
|
+
require 'solidus_dev_support/rspec/coverage'
|
8
|
+
|
9
|
+
require File.expand_path('dummy/config/environment.rb', __dir__).tap { |file|
|
10
|
+
# Create the dummy app if it's still missing.
|
11
|
+
system 'bin/rake extension:test_app' unless File.exist? file
|
12
|
+
}
|
13
|
+
|
14
|
+
# Requires factories and other useful helpers defined in spree_core.
|
15
|
+
require 'solidus_dev_support/rspec/feature_helper'
|
16
|
+
|
17
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
18
|
+
# in spec/support/ and its subdirectories.
|
19
|
+
Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each { |f| require f }
|
20
|
+
|
21
|
+
# Requires factories defined in lib/solidus_importer/factories.rb
|
22
|
+
require 'solidus_importer/factories'
|
23
|
+
|
24
|
+
RSpec.configure do |config|
|
25
|
+
config.infer_spec_type_from_file_location!
|
26
|
+
config.use_transactional_fixtures = false
|
27
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module SolidusImporterHelpers
|
4
|
+
def solidus_importer_fixture_path(fixture)
|
5
|
+
File.join(__dir__, '../fixtures/solidus_importer', fixture)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
RSpec.configure do |config|
|
10
|
+
config.include SolidusImporterHelpers
|
11
|
+
end
|
12
|
+
|
13
|
+
FactoryBot::SyntaxRunner.include SolidusImporterHelpers
|
metadata
ADDED
@@ -0,0 +1,227 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: solidus_importer
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Mattia Roccoberton
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-06-26 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: solidus_core
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.0.0
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '3'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 2.0.0
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '3'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: solidus_support
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0.5'
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0.5'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: solidus_dev_support
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
description: Solidus Importer extension to migrate data from other eCommerce systems
|
62
|
+
email: contact@solidus.io
|
63
|
+
executables: []
|
64
|
+
extensions: []
|
65
|
+
extra_rdoc_files: []
|
66
|
+
files:
|
67
|
+
- ".circleci/config.yml"
|
68
|
+
- ".gem_release.yml"
|
69
|
+
- ".github/stale.yml"
|
70
|
+
- ".gitignore"
|
71
|
+
- ".hound.yml"
|
72
|
+
- ".rspec"
|
73
|
+
- ".rubocop.yml"
|
74
|
+
- Gemfile
|
75
|
+
- LICENSE
|
76
|
+
- README.md
|
77
|
+
- Rakefile
|
78
|
+
- app/assets/javascripts/spree/backend/solidus_importer.js
|
79
|
+
- app/assets/javascripts/spree/frontend/solidus_importer.js
|
80
|
+
- app/assets/stylesheets/spree/backend/solidus_importer.css
|
81
|
+
- app/assets/stylesheets/spree/frontend/solidus_importer.css
|
82
|
+
- app/controllers/spree/admin/solidus_importer/import_rows_controller.rb
|
83
|
+
- app/controllers/spree/admin/solidus_importer/imports_controller.rb
|
84
|
+
- app/jobs/solidus_importer/import_job.rb
|
85
|
+
- app/models/solidus_importer/import.rb
|
86
|
+
- app/models/solidus_importer/row.rb
|
87
|
+
- app/views/spree/admin/solidus_importer/import_rows/show.html.erb
|
88
|
+
- app/views/spree/admin/solidus_importer/imports/_form.html.erb
|
89
|
+
- app/views/spree/admin/solidus_importer/imports/index.html.erb
|
90
|
+
- app/views/spree/admin/solidus_importer/imports/new.html.erb
|
91
|
+
- app/views/spree/admin/solidus_importer/imports/show.html.erb
|
92
|
+
- bin/console
|
93
|
+
- bin/rails
|
94
|
+
- bin/rails-engine
|
95
|
+
- bin/rails-sandbox
|
96
|
+
- bin/rake
|
97
|
+
- bin/sandbox
|
98
|
+
- bin/setup
|
99
|
+
- config/initializers/spree.rb
|
100
|
+
- config/locales/en.yml
|
101
|
+
- config/routes.rb
|
102
|
+
- db/migrate/20191216101011_create_solidus_importer_imports.rb
|
103
|
+
- db/migrate/20191216101012_create_solidus_importer_rows.rb
|
104
|
+
- examples/importers/custom_importer.rb
|
105
|
+
- examples/processors/notify_on_failure.rb
|
106
|
+
- lib/generators/solidus_importer/install/install_generator.rb
|
107
|
+
- lib/solidus_importer.rb
|
108
|
+
- lib/solidus_importer/base_importer.rb
|
109
|
+
- lib/solidus_importer/configuration.rb
|
110
|
+
- lib/solidus_importer/engine.rb
|
111
|
+
- lib/solidus_importer/exception.rb
|
112
|
+
- lib/solidus_importer/factories.rb
|
113
|
+
- lib/solidus_importer/process_import.rb
|
114
|
+
- lib/solidus_importer/process_row.rb
|
115
|
+
- lib/solidus_importer/processors/address.rb
|
116
|
+
- lib/solidus_importer/processors/base.rb
|
117
|
+
- lib/solidus_importer/processors/customer.rb
|
118
|
+
- lib/solidus_importer/processors/log.rb
|
119
|
+
- lib/solidus_importer/processors/option_types.rb
|
120
|
+
- lib/solidus_importer/processors/option_values.rb
|
121
|
+
- lib/solidus_importer/processors/order.rb
|
122
|
+
- lib/solidus_importer/processors/product.rb
|
123
|
+
- lib/solidus_importer/processors/product_images.rb
|
124
|
+
- lib/solidus_importer/processors/taxon.rb
|
125
|
+
- lib/solidus_importer/processors/variant.rb
|
126
|
+
- lib/solidus_importer/processors/variant_images.rb
|
127
|
+
- lib/solidus_importer/version.rb
|
128
|
+
- solidus_importer.gemspec
|
129
|
+
- spec/factories/solidus_importer_imports.rb
|
130
|
+
- spec/factories/solidus_importer_rows.rb
|
131
|
+
- spec/features/admin/solidus_importer/import_rows_spec.rb
|
132
|
+
- spec/features/admin/solidus_importer/imports_spec.rb
|
133
|
+
- spec/features/solidus_importer/import_spec.rb
|
134
|
+
- spec/features/solidus_importer/processors_spec.rb
|
135
|
+
- spec/fixtures/solidus_importer/apparel.csv
|
136
|
+
- spec/fixtures/solidus_importer/customers.csv
|
137
|
+
- spec/fixtures/solidus_importer/home-and-garden.csv
|
138
|
+
- spec/fixtures/solidus_importer/invalid_headers.csv
|
139
|
+
- spec/fixtures/solidus_importer/invalid_product.csv
|
140
|
+
- spec/fixtures/solidus_importer/jewelery.csv
|
141
|
+
- spec/fixtures/solidus_importer/orders.csv
|
142
|
+
- spec/fixtures/solidus_importer/products.csv
|
143
|
+
- spec/fixtures/solidus_importer/thinking-cat.jpg
|
144
|
+
- spec/jobs/solidus_importer/import_job_spec.rb
|
145
|
+
- spec/lib/solidus_importer/base_importer_spec.rb
|
146
|
+
- spec/lib/solidus_importer/process_import_spec.rb
|
147
|
+
- spec/lib/solidus_importer/process_row_spec.rb
|
148
|
+
- spec/lib/solidus_importer/processors/address_spec.rb
|
149
|
+
- spec/lib/solidus_importer/processors/base_spec.rb
|
150
|
+
- spec/lib/solidus_importer/processors/customer_spec.rb
|
151
|
+
- spec/lib/solidus_importer/processors/log_spec.rb
|
152
|
+
- spec/lib/solidus_importer/processors/option_types_spec.rb
|
153
|
+
- spec/lib/solidus_importer/processors/option_values_spec.rb
|
154
|
+
- spec/lib/solidus_importer/processors/order_spec.rb
|
155
|
+
- spec/lib/solidus_importer/processors/product_images_spec.rb
|
156
|
+
- spec/lib/solidus_importer/processors/product_spec.rb
|
157
|
+
- spec/lib/solidus_importer/processors/taxon_spec.rb
|
158
|
+
- spec/lib/solidus_importer/processors/variant_images_spec.rb
|
159
|
+
- spec/lib/solidus_importer/processors/variant_spec.rb
|
160
|
+
- spec/lib/solidus_importer_spec.rb
|
161
|
+
- spec/models/solidus_importer/import_spec.rb
|
162
|
+
- spec/models/solidus_importer/row_spec.rb
|
163
|
+
- spec/spec_helper.rb
|
164
|
+
- spec/support/solidus_importer_helpers.rb
|
165
|
+
homepage: https://github.com/nebulab/solidus_importer#readme
|
166
|
+
licenses:
|
167
|
+
- BSD-3-Clause
|
168
|
+
metadata:
|
169
|
+
homepage_uri: https://github.com/nebulab/solidus_importer#readme
|
170
|
+
source_code_uri: https://github.com/nebulab/solidus_importer#readme
|
171
|
+
changelog_uri: https://github.com/nebulab/solidus_importer/releases
|
172
|
+
post_install_message:
|
173
|
+
rdoc_options: []
|
174
|
+
require_paths:
|
175
|
+
- lib
|
176
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '2.5'
|
181
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
182
|
+
requirements:
|
183
|
+
- - ">="
|
184
|
+
- !ruby/object:Gem::Version
|
185
|
+
version: '0'
|
186
|
+
requirements: []
|
187
|
+
rubygems_version: 3.1.2
|
188
|
+
signing_key:
|
189
|
+
specification_version: 4
|
190
|
+
summary: Solidus Importer extension
|
191
|
+
test_files:
|
192
|
+
- spec/factories/solidus_importer_imports.rb
|
193
|
+
- spec/factories/solidus_importer_rows.rb
|
194
|
+
- spec/features/admin/solidus_importer/import_rows_spec.rb
|
195
|
+
- spec/features/admin/solidus_importer/imports_spec.rb
|
196
|
+
- spec/features/solidus_importer/import_spec.rb
|
197
|
+
- spec/features/solidus_importer/processors_spec.rb
|
198
|
+
- spec/fixtures/solidus_importer/apparel.csv
|
199
|
+
- spec/fixtures/solidus_importer/customers.csv
|
200
|
+
- spec/fixtures/solidus_importer/home-and-garden.csv
|
201
|
+
- spec/fixtures/solidus_importer/invalid_headers.csv
|
202
|
+
- spec/fixtures/solidus_importer/invalid_product.csv
|
203
|
+
- spec/fixtures/solidus_importer/jewelery.csv
|
204
|
+
- spec/fixtures/solidus_importer/orders.csv
|
205
|
+
- spec/fixtures/solidus_importer/products.csv
|
206
|
+
- spec/fixtures/solidus_importer/thinking-cat.jpg
|
207
|
+
- spec/jobs/solidus_importer/import_job_spec.rb
|
208
|
+
- spec/lib/solidus_importer/base_importer_spec.rb
|
209
|
+
- spec/lib/solidus_importer/process_import_spec.rb
|
210
|
+
- spec/lib/solidus_importer/process_row_spec.rb
|
211
|
+
- spec/lib/solidus_importer/processors/address_spec.rb
|
212
|
+
- spec/lib/solidus_importer/processors/base_spec.rb
|
213
|
+
- spec/lib/solidus_importer/processors/customer_spec.rb
|
214
|
+
- spec/lib/solidus_importer/processors/log_spec.rb
|
215
|
+
- spec/lib/solidus_importer/processors/option_types_spec.rb
|
216
|
+
- spec/lib/solidus_importer/processors/option_values_spec.rb
|
217
|
+
- spec/lib/solidus_importer/processors/order_spec.rb
|
218
|
+
- spec/lib/solidus_importer/processors/product_images_spec.rb
|
219
|
+
- spec/lib/solidus_importer/processors/product_spec.rb
|
220
|
+
- spec/lib/solidus_importer/processors/taxon_spec.rb
|
221
|
+
- spec/lib/solidus_importer/processors/variant_images_spec.rb
|
222
|
+
- spec/lib/solidus_importer/processors/variant_spec.rb
|
223
|
+
- spec/lib/solidus_importer_spec.rb
|
224
|
+
- spec/models/solidus_importer/import_spec.rb
|
225
|
+
- spec/models/solidus_importer/row_spec.rb
|
226
|
+
- spec/spec_helper.rb
|
227
|
+
- spec/support/solidus_importer_helpers.rb
|