solidus_importer 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +7 -0
  2. data/.circleci/config.yml +35 -0
  3. data/.gem_release.yml +5 -0
  4. data/.github/stale.yml +17 -0
  5. data/.gitignore +20 -0
  6. data/.hound.yml +8 -0
  7. data/.rspec +2 -0
  8. data/.rubocop.yml +2 -0
  9. data/Gemfile +33 -0
  10. data/LICENSE +26 -0
  11. data/README.md +170 -0
  12. data/Rakefile +6 -0
  13. data/app/assets/javascripts/spree/backend/solidus_importer.js +2 -0
  14. data/app/assets/javascripts/spree/frontend/solidus_importer.js +2 -0
  15. data/app/assets/stylesheets/spree/backend/solidus_importer.css +16 -0
  16. data/app/assets/stylesheets/spree/frontend/solidus_importer.css +4 -0
  17. data/app/controllers/spree/admin/solidus_importer/import_rows_controller.rb +24 -0
  18. data/app/controllers/spree/admin/solidus_importer/imports_controller.rb +44 -0
  19. data/app/jobs/solidus_importer/import_job.rb +30 -0
  20. data/app/models/solidus_importer/import.rb +48 -0
  21. data/app/models/solidus_importer/row.rb +26 -0
  22. data/app/views/spree/admin/solidus_importer/import_rows/show.html.erb +46 -0
  23. data/app/views/spree/admin/solidus_importer/imports/_form.html.erb +14 -0
  24. data/app/views/spree/admin/solidus_importer/imports/index.html.erb +80 -0
  25. data/app/views/spree/admin/solidus_importer/imports/new.html.erb +13 -0
  26. data/app/views/spree/admin/solidus_importer/imports/show.html.erb +87 -0
  27. data/bin/console +17 -0
  28. data/bin/rails +7 -0
  29. data/bin/rails-engine +13 -0
  30. data/bin/rails-sandbox +16 -0
  31. data/bin/rake +7 -0
  32. data/bin/sandbox +84 -0
  33. data/bin/setup +8 -0
  34. data/config/initializers/spree.rb +11 -0
  35. data/config/locales/en.yml +28 -0
  36. data/config/routes.rb +11 -0
  37. data/db/migrate/20191216101011_create_solidus_importer_imports.rb +19 -0
  38. data/db/migrate/20191216101012_create_solidus_importer_rows.rb +14 -0
  39. data/examples/importers/custom_importer.rb +20 -0
  40. data/examples/processors/notify_on_failure.rb +22 -0
  41. data/lib/generators/solidus_importer/install/install_generator.rb +22 -0
  42. data/lib/solidus_importer.rb +25 -0
  43. data/lib/solidus_importer/base_importer.rb +26 -0
  44. data/lib/solidus_importer/configuration.rb +39 -0
  45. data/lib/solidus_importer/engine.rb +23 -0
  46. data/lib/solidus_importer/exception.rb +5 -0
  47. data/lib/solidus_importer/factories.rb +4 -0
  48. data/lib/solidus_importer/process_import.rb +88 -0
  49. data/lib/solidus_importer/process_row.rb +46 -0
  50. data/lib/solidus_importer/processors/address.rb +47 -0
  51. data/lib/solidus_importer/processors/base.rb +15 -0
  52. data/lib/solidus_importer/processors/customer.rb +41 -0
  53. data/lib/solidus_importer/processors/log.rb +15 -0
  54. data/lib/solidus_importer/processors/option_types.rb +43 -0
  55. data/lib/solidus_importer/processors/option_values.rb +49 -0
  56. data/lib/solidus_importer/processors/order.rb +40 -0
  57. data/lib/solidus_importer/processors/product.rb +51 -0
  58. data/lib/solidus_importer/processors/product_images.rb +30 -0
  59. data/lib/solidus_importer/processors/taxon.rb +52 -0
  60. data/lib/solidus_importer/processors/variant.rb +51 -0
  61. data/lib/solidus_importer/processors/variant_images.rb +30 -0
  62. data/lib/solidus_importer/version.rb +5 -0
  63. data/solidus_importer.gemspec +36 -0
  64. data/spec/factories/solidus_importer_imports.rb +27 -0
  65. data/spec/factories/solidus_importer_rows.rb +82 -0
  66. data/spec/features/admin/solidus_importer/import_rows_spec.rb +30 -0
  67. data/spec/features/admin/solidus_importer/imports_spec.rb +121 -0
  68. data/spec/features/solidus_importer/import_spec.rb +138 -0
  69. data/spec/features/solidus_importer/processors_spec.rb +53 -0
  70. data/spec/fixtures/solidus_importer/apparel.csv +23 -0
  71. data/spec/fixtures/solidus_importer/customers.csv +3 -0
  72. data/spec/fixtures/solidus_importer/home-and-garden.csv +22 -0
  73. data/spec/fixtures/solidus_importer/invalid_headers.csv +3 -0
  74. data/spec/fixtures/solidus_importer/invalid_product.csv +2 -0
  75. data/spec/fixtures/solidus_importer/jewelery.csv +55 -0
  76. data/spec/fixtures/solidus_importer/orders.csv +5 -0
  77. data/spec/fixtures/solidus_importer/products.csv +8 -0
  78. data/spec/fixtures/solidus_importer/thinking-cat.jpg +0 -0
  79. data/spec/jobs/solidus_importer/import_job_spec.rb +54 -0
  80. data/spec/lib/solidus_importer/base_importer_spec.rb +23 -0
  81. data/spec/lib/solidus_importer/process_import_spec.rb +74 -0
  82. data/spec/lib/solidus_importer/process_row_spec.rb +24 -0
  83. data/spec/lib/solidus_importer/processors/address_spec.rb +18 -0
  84. data/spec/lib/solidus_importer/processors/base_spec.rb +9 -0
  85. data/spec/lib/solidus_importer/processors/customer_spec.rb +65 -0
  86. data/spec/lib/solidus_importer/processors/log_spec.rb +18 -0
  87. data/spec/lib/solidus_importer/processors/option_types_spec.rb +38 -0
  88. data/spec/lib/solidus_importer/processors/option_values_spec.rb +43 -0
  89. data/spec/lib/solidus_importer/processors/order_spec.rb +56 -0
  90. data/spec/lib/solidus_importer/processors/product_images_spec.rb +42 -0
  91. data/spec/lib/solidus_importer/processors/product_spec.rb +66 -0
  92. data/spec/lib/solidus_importer/processors/taxon_spec.rb +33 -0
  93. data/spec/lib/solidus_importer/processors/variant_images_spec.rb +44 -0
  94. data/spec/lib/solidus_importer/processors/variant_spec.rb +86 -0
  95. data/spec/lib/solidus_importer_spec.rb +14 -0
  96. data/spec/models/solidus_importer/import_spec.rb +60 -0
  97. data/spec/models/solidus_importer/row_spec.rb +18 -0
  98. data/spec/spec_helper.rb +27 -0
  99. data/spec/support/solidus_importer_helpers.rb +13 -0
  100. 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
@@ -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