datashift 0.8.0 → 0.9.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 (37) hide show
  1. data/README.markdown +12 -0
  2. data/Rakefile +4 -2
  3. data/VERSION +1 -1
  4. data/datashift.gemspec +13 -12
  5. data/lib/datashift/delimiters.rb +87 -0
  6. data/lib/datashift/method_detail.rb +5 -0
  7. data/lib/datashift/method_details_manager.rb +5 -1
  8. data/lib/datashift/method_dictionary.rb +3 -1
  9. data/lib/exporters/csv_exporter.rb +158 -10
  10. data/lib/exporters/excel_exporter.rb +6 -2
  11. data/lib/exporters/exporter_base.rb +6 -0
  12. data/lib/helpers/spree_helper.rb +2 -1
  13. data/lib/loaders/paperclip/image_loader.rb +32 -2
  14. data/lib/loaders/spree/product_loader.rb +3 -2
  15. data/lib/thor/export.thor +111 -0
  16. data/lib/thor/{import_excel.thor → import.thor} +40 -2
  17. data/lib/thor/spree/bootstrap_cleanup.thor +7 -4
  18. data/lib/thor/spree/products_images.thor +26 -17
  19. data/lib/thor/spree/reports.thor +30 -40
  20. data/lib/thor/tools.thor +63 -0
  21. data/spec/Gemfile +3 -2
  22. data/spec/csv_exporter_spec.rb +101 -0
  23. data/spec/excel_exporter_spec.rb +1 -1
  24. data/spec/fixtures/datashift_Spree_db.sqlite +0 -0
  25. data/spec/fixtures/datashift_test_models_db.sqlite +0 -0
  26. data/spec/fixtures/test_model_defs.rb +5 -0
  27. data/spec/spree_loader_spec.rb +28 -131
  28. data/spec/spree_method_mapping_spec.rb +1 -1
  29. data/spec/spree_variants_loader_spec.rb +189 -0
  30. metadata +193 -167
  31. data/lib/thor/export_excel.thor +0 -74
  32. data/sandbox/app/controllers/application_controller.rb +0 -3
  33. data/sandbox/config/application.rb +0 -59
  34. data/sandbox/config/database.yml +0 -20
  35. data/sandbox/config/environment.rb +0 -5
  36. data/sandbox/config/environments/development.rb +0 -37
  37. data/tasks/import/csv.rake +0 -51
metadata CHANGED
@@ -1,203 +1,229 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datashift
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 59
4
5
  prerelease:
5
- version: 0.8.0
6
+ segments:
7
+ - 0
8
+ - 9
9
+ - 0
10
+ version: 0.9.0
6
11
  platform: ruby
7
12
  authors:
8
- - Thomas Statter
13
+ - Thomas Statter
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
17
 
13
- date: 2012-07-09 00:00:00 Z
18
+ date: 2012-09-03 00:00:00 Z
14
19
  dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: spreadsheet
17
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
19
- none: false
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: "0"
24
- type: :runtime
25
- version_requirements: *id001
26
- description: A suite of tools to move data between ActiveRecord models,databases,applications like Excel/Open Office, files and projects including Spree
20
+ - !ruby/object:Gem::Dependency
21
+ version_requirements: &id001 !ruby/object:Gem::Requirement
22
+ none: false
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ hash: 3
27
+ segments:
28
+ - 0
29
+ version: "0"
30
+ requirement: *id001
31
+ prerelease: false
32
+ name: spreadsheet
33
+ type: :runtime
34
+ - !ruby/object:Gem::Dependency
35
+ version_requirements: &id002 !ruby/object:Gem::Requirement
36
+ none: false
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ hash: 3
41
+ segments:
42
+ - 0
43
+ version: "0"
44
+ requirement: *id002
45
+ prerelease: false
46
+ name: rubyzip
47
+ type: :runtime
48
+ description: Comprehensive Excel and CSV import/export tools. Shift data between ActiveRecord databases, applications, and projects like Spree
27
49
  email: rubygems@autotelik.co.uk
28
50
  executables: []
29
51
 
30
52
  extensions: []
31
53
 
32
54
  extra_rdoc_files:
33
- - LICENSE.txt
34
- - README.markdown
35
- - README.rdoc
55
+ - LICENSE.txt
56
+ - README.markdown
57
+ - README.rdoc
36
58
  files:
37
- - .document
38
- - LICENSE.txt
39
- - README.markdown
40
- - README.rdoc
41
- - Rakefile
42
- - VERSION
43
- - datashift.gemspec
44
- - lib/applications/jruby/jexcel_file.rb
45
- - lib/applications/jruby/word.rb
46
- - lib/datashift.rb
47
- - lib/datashift/exceptions.rb
48
- - lib/datashift/file_definitions.rb
49
- - lib/datashift/logging.rb
50
- - lib/datashift/mapping_file_definitions.rb
51
- - lib/datashift/method_detail.rb
52
- - lib/datashift/method_details_manager.rb
53
- - lib/datashift/method_dictionary.rb
54
- - lib/datashift/method_mapper.rb
55
- - lib/datashift/model_mapper.rb
56
- - lib/datashift/populator.rb
57
- - lib/exporters/csv_exporter.rb
58
- - lib/exporters/excel_exporter.rb
59
- - lib/exporters/exporter_base.rb
60
- - lib/generators/csv_generator.rb
61
- - lib/generators/excel_generator.rb
62
- - lib/generators/generator_base.rb
63
- - lib/helpers/core_ext/to_b.rb
64
- - lib/helpers/rake_utils.rb
65
- - lib/helpers/spree_helper.rb
66
- - lib/java/poi-3.7/._poi-3.7-20101029.jar5645100390082102460.tmp
67
- - lib/java/poi-3.7/LICENSE
68
- - lib/java/poi-3.7/NOTICE
69
- - lib/java/poi-3.7/RELEASE_NOTES.txt
70
- - lib/java/poi-3.7/lib/commons-logging-1.1.jar
71
- - lib/java/poi-3.7/lib/junit-3.8.1.jar
72
- - lib/java/poi-3.7/lib/log4j-1.2.13.jar
73
- - lib/java/poi-3.7/ooxml-lib/dom4j-1.6.1.jar
74
- - lib/java/poi-3.7/ooxml-lib/geronimo-stax-api_1.0_spec-1.0.jar
75
- - lib/java/poi-3.7/ooxml-lib/xmlbeans-2.3.0.jar
76
- - lib/java/poi-3.7/poi-3.7-20101029.jar
77
- - lib/java/poi-3.7/poi-examples-3.7-20101029.jar
78
- - lib/java/poi-3.7/poi-ooxml-3.7-20101029.jar
79
- - lib/java/poi-3.7/poi-ooxml-schemas-3.7-20101029.jar
80
- - lib/java/poi-3.7/poi-scratchpad-3.7-20101029.jar
81
- - lib/loaders/csv_loader.rb
82
- - lib/loaders/excel_loader.rb
83
- - lib/loaders/loader_base.rb
84
- - lib/loaders/paperclip/image_loader.rb
85
- - lib/loaders/spreadsheet_loader.rb
86
- - lib/loaders/spree/image_loader.rb
87
- - lib/loaders/spree/product_loader.rb
88
- - lib/thor/export_excel.thor
89
- - lib/thor/generate_excel.thor
90
- - lib/thor/import_excel.thor
91
- - lib/thor/spree/bootstrap_cleanup.thor
92
- - lib/thor/spree/products_images.thor
93
- - lib/thor/spree/reports.thor
94
- - public/spree/products/large/DEMO_001_ror_bag.jpeg
95
- - public/spree/products/large/DEMO_002_Powerstation.jpg
96
- - public/spree/products/large/DEMO_003_ror_mug.jpeg
97
- - public/spree/products/mini/DEMO_001_ror_bag.jpeg
98
- - public/spree/products/mini/DEMO_002_Powerstation.jpg
99
- - public/spree/products/mini/DEMO_003_ror_mug.jpeg
100
- - public/spree/products/original/DEMO_001_ror_bag.jpeg
101
- - public/spree/products/original/DEMO_002_Powerstation.jpg
102
- - public/spree/products/original/DEMO_003_ror_mug.jpeg
103
- - public/spree/products/product/DEMO_001_ror_bag.jpeg
104
- - public/spree/products/product/DEMO_002_Powerstation.jpg
105
- - public/spree/products/product/DEMO_003_ror_mug.jpeg
106
- - public/spree/products/small/DEMO_001_ror_bag.jpeg
107
- - public/spree/products/small/DEMO_002_Powerstation.jpg
108
- - public/spree/products/small/DEMO_003_ror_mug.jpeg
109
- - sandbox/app/controllers/application_controller.rb
110
- - sandbox/config/application.rb
111
- - sandbox/config/database.yml
112
- - sandbox/config/environment.rb
113
- - sandbox/config/environments/development.rb
114
- - spec/Gemfile
115
- - spec/csv_loader_spec.rb
116
- - spec/datashift_spec.rb
117
- - spec/db/migrate/20110803201325_create_test_bed.rb
118
- - spec/excel_exporter_spec.rb
119
- - spec/excel_generator_spec.rb
120
- - spec/excel_loader_spec.rb
121
- - spec/file_definitions.rb
122
- - spec/fixtures/BadAssociationName.xls
123
- - spec/fixtures/DemoNegativeTesting.xls
124
- - spec/fixtures/ProjectsDefaults.yml
125
- - spec/fixtures/ProjectsMultiCategories.xls
126
- - spec/fixtures/ProjectsMultiCategoriesHeaderLookup.xls
127
- - spec/fixtures/ProjectsSingleCategories.xls
128
- - spec/fixtures/SimpleProjects.xls
129
- - spec/fixtures/config/database.yml
130
- - spec/fixtures/datashift_Spree_db.sqlite
131
- - spec/fixtures/datashift_test_models_db.sqlite
132
- - spec/fixtures/images/DEMO_001_ror_bag.jpeg
133
- - spec/fixtures/images/DEMO_002_Powerstation.jpg
134
- - spec/fixtures/images/DEMO_003_ror_mug.jpeg
135
- - spec/fixtures/images/DEMO_004_ror_ringer.jpeg
136
- - spec/fixtures/negative/SpreeProdMiss1Mandatory.csv
137
- - spec/fixtures/negative/SpreeProdMiss1Mandatory.xls
138
- - spec/fixtures/negative/SpreeProdMissManyMandatory.csv
139
- - spec/fixtures/negative/SpreeProdMissManyMandatory.xls
140
- - spec/fixtures/simple_export_spec.xls
141
- - spec/fixtures/simple_template_spec.xls
142
- - spec/fixtures/spree/SpreeImages.xls
143
- - spec/fixtures/spree/SpreeMultiVariant.csv
144
- - spec/fixtures/spree/SpreeProducts.csv
145
- - spec/fixtures/spree/SpreeProducts.xls
146
- - spec/fixtures/spree/SpreeProductsDefaults.yml
147
- - spec/fixtures/spree/SpreeProductsMandatoryOnly.xls
148
- - spec/fixtures/spree/SpreeProductsMultiColumn.csv
149
- - spec/fixtures/spree/SpreeProductsMultiColumn.xls
150
- - spec/fixtures/spree/SpreeProductsSimple.csv
151
- - spec/fixtures/spree/SpreeProductsSimple.xls
152
- - spec/fixtures/spree/SpreeProductsWithImages.csv
153
- - spec/fixtures/spree/SpreeProductsWithImages.xls
154
- - spec/fixtures/spree/SpreeZoneExample.csv
155
- - spec/fixtures/spree/SpreeZoneExample.xls
156
- - spec/fixtures/test_model_defs.rb
157
- - spec/loader_spec.rb
158
- - spec/method_dictionary_spec.rb
159
- - spec/method_mapper_spec.rb
160
- - spec/spec_helper.rb
161
- - spec/spree_exporter_spec.rb
162
- - spec/spree_generator_spec.rb
163
- - spec/spree_images_loader_spec.rb
164
- - spec/spree_loader_spec.rb
165
- - spec/spree_method_mapping_spec.rb
166
- - spec/thor_spec.rb
167
- - tasks/config/seed_fu_product_template.erb
168
- - tasks/config/tidy_config.txt
169
- - tasks/db_tasks.rake
170
- - tasks/export/excel_generator.rake
171
- - tasks/file_tasks.rake
172
- - tasks/import/csv.rake
173
- - tasks/import/excel.rake
174
- - tasks/word_to_seedfu.rake
175
- - test/helper.rb
176
- - test/test_interact.rb
59
+ - .document
60
+ - LICENSE.txt
61
+ - README.markdown
62
+ - README.rdoc
63
+ - Rakefile
64
+ - VERSION
65
+ - datashift.gemspec
66
+ - lib/applications/jruby/jexcel_file.rb
67
+ - lib/applications/jruby/word.rb
68
+ - lib/datashift.rb
69
+ - lib/datashift/delimiters.rb
70
+ - lib/datashift/exceptions.rb
71
+ - lib/datashift/file_definitions.rb
72
+ - lib/datashift/logging.rb
73
+ - lib/datashift/mapping_file_definitions.rb
74
+ - lib/datashift/method_detail.rb
75
+ - lib/datashift/method_details_manager.rb
76
+ - lib/datashift/method_dictionary.rb
77
+ - lib/datashift/method_mapper.rb
78
+ - lib/datashift/model_mapper.rb
79
+ - lib/datashift/populator.rb
80
+ - lib/exporters/csv_exporter.rb
81
+ - lib/exporters/excel_exporter.rb
82
+ - lib/exporters/exporter_base.rb
83
+ - lib/generators/csv_generator.rb
84
+ - lib/generators/excel_generator.rb
85
+ - lib/generators/generator_base.rb
86
+ - lib/helpers/core_ext/to_b.rb
87
+ - lib/helpers/rake_utils.rb
88
+ - lib/helpers/spree_helper.rb
89
+ - lib/java/poi-3.7/._poi-3.7-20101029.jar5645100390082102460.tmp
90
+ - lib/java/poi-3.7/LICENSE
91
+ - lib/java/poi-3.7/NOTICE
92
+ - lib/java/poi-3.7/RELEASE_NOTES.txt
93
+ - lib/java/poi-3.7/lib/commons-logging-1.1.jar
94
+ - lib/java/poi-3.7/lib/junit-3.8.1.jar
95
+ - lib/java/poi-3.7/lib/log4j-1.2.13.jar
96
+ - lib/java/poi-3.7/ooxml-lib/dom4j-1.6.1.jar
97
+ - lib/java/poi-3.7/ooxml-lib/geronimo-stax-api_1.0_spec-1.0.jar
98
+ - lib/java/poi-3.7/ooxml-lib/xmlbeans-2.3.0.jar
99
+ - lib/java/poi-3.7/poi-3.7-20101029.jar
100
+ - lib/java/poi-3.7/poi-examples-3.7-20101029.jar
101
+ - lib/java/poi-3.7/poi-ooxml-3.7-20101029.jar
102
+ - lib/java/poi-3.7/poi-ooxml-schemas-3.7-20101029.jar
103
+ - lib/java/poi-3.7/poi-scratchpad-3.7-20101029.jar
104
+ - lib/loaders/csv_loader.rb
105
+ - lib/loaders/excel_loader.rb
106
+ - lib/loaders/loader_base.rb
107
+ - lib/loaders/paperclip/image_loader.rb
108
+ - lib/loaders/spreadsheet_loader.rb
109
+ - lib/loaders/spree/image_loader.rb
110
+ - lib/loaders/spree/product_loader.rb
111
+ - lib/thor/export.thor
112
+ - lib/thor/generate_excel.thor
113
+ - lib/thor/import.thor
114
+ - lib/thor/spree/bootstrap_cleanup.thor
115
+ - lib/thor/spree/products_images.thor
116
+ - lib/thor/spree/reports.thor
117
+ - lib/thor/tools.thor
118
+ - public/spree/products/large/DEMO_001_ror_bag.jpeg
119
+ - public/spree/products/large/DEMO_002_Powerstation.jpg
120
+ - public/spree/products/large/DEMO_003_ror_mug.jpeg
121
+ - public/spree/products/mini/DEMO_001_ror_bag.jpeg
122
+ - public/spree/products/mini/DEMO_002_Powerstation.jpg
123
+ - public/spree/products/mini/DEMO_003_ror_mug.jpeg
124
+ - public/spree/products/original/DEMO_001_ror_bag.jpeg
125
+ - public/spree/products/original/DEMO_002_Powerstation.jpg
126
+ - public/spree/products/original/DEMO_003_ror_mug.jpeg
127
+ - public/spree/products/product/DEMO_001_ror_bag.jpeg
128
+ - public/spree/products/product/DEMO_002_Powerstation.jpg
129
+ - public/spree/products/product/DEMO_003_ror_mug.jpeg
130
+ - public/spree/products/small/DEMO_001_ror_bag.jpeg
131
+ - public/spree/products/small/DEMO_002_Powerstation.jpg
132
+ - public/spree/products/small/DEMO_003_ror_mug.jpeg
133
+ - spec/Gemfile
134
+ - spec/csv_exporter_spec.rb
135
+ - spec/csv_loader_spec.rb
136
+ - spec/datashift_spec.rb
137
+ - spec/db/migrate/20110803201325_create_test_bed.rb
138
+ - spec/excel_exporter_spec.rb
139
+ - spec/excel_generator_spec.rb
140
+ - spec/excel_loader_spec.rb
141
+ - spec/file_definitions.rb
142
+ - spec/fixtures/BadAssociationName.xls
143
+ - spec/fixtures/DemoNegativeTesting.xls
144
+ - spec/fixtures/ProjectsDefaults.yml
145
+ - spec/fixtures/ProjectsMultiCategories.xls
146
+ - spec/fixtures/ProjectsMultiCategoriesHeaderLookup.xls
147
+ - spec/fixtures/ProjectsSingleCategories.xls
148
+ - spec/fixtures/SimpleProjects.xls
149
+ - spec/fixtures/config/database.yml
150
+ - spec/fixtures/datashift_Spree_db.sqlite
151
+ - spec/fixtures/datashift_test_models_db.sqlite
152
+ - spec/fixtures/images/DEMO_001_ror_bag.jpeg
153
+ - spec/fixtures/images/DEMO_002_Powerstation.jpg
154
+ - spec/fixtures/images/DEMO_003_ror_mug.jpeg
155
+ - spec/fixtures/images/DEMO_004_ror_ringer.jpeg
156
+ - spec/fixtures/negative/SpreeProdMiss1Mandatory.csv
157
+ - spec/fixtures/negative/SpreeProdMiss1Mandatory.xls
158
+ - spec/fixtures/negative/SpreeProdMissManyMandatory.csv
159
+ - spec/fixtures/negative/SpreeProdMissManyMandatory.xls
160
+ - spec/fixtures/simple_export_spec.xls
161
+ - spec/fixtures/simple_template_spec.xls
162
+ - spec/fixtures/spree/SpreeImages.xls
163
+ - spec/fixtures/spree/SpreeMultiVariant.csv
164
+ - spec/fixtures/spree/SpreeProducts.csv
165
+ - spec/fixtures/spree/SpreeProducts.xls
166
+ - spec/fixtures/spree/SpreeProductsDefaults.yml
167
+ - spec/fixtures/spree/SpreeProductsMandatoryOnly.xls
168
+ - spec/fixtures/spree/SpreeProductsMultiColumn.csv
169
+ - spec/fixtures/spree/SpreeProductsMultiColumn.xls
170
+ - spec/fixtures/spree/SpreeProductsSimple.csv
171
+ - spec/fixtures/spree/SpreeProductsSimple.xls
172
+ - spec/fixtures/spree/SpreeProductsWithImages.csv
173
+ - spec/fixtures/spree/SpreeProductsWithImages.xls
174
+ - spec/fixtures/spree/SpreeZoneExample.csv
175
+ - spec/fixtures/spree/SpreeZoneExample.xls
176
+ - spec/fixtures/test_model_defs.rb
177
+ - spec/loader_spec.rb
178
+ - spec/method_dictionary_spec.rb
179
+ - spec/method_mapper_spec.rb
180
+ - spec/spec_helper.rb
181
+ - spec/spree_exporter_spec.rb
182
+ - spec/spree_generator_spec.rb
183
+ - spec/spree_images_loader_spec.rb
184
+ - spec/spree_loader_spec.rb
185
+ - spec/spree_method_mapping_spec.rb
186
+ - spec/spree_variants_loader_spec.rb
187
+ - spec/thor_spec.rb
188
+ - tasks/config/seed_fu_product_template.erb
189
+ - tasks/config/tidy_config.txt
190
+ - tasks/db_tasks.rake
191
+ - tasks/export/excel_generator.rake
192
+ - tasks/file_tasks.rake
193
+ - tasks/import/excel.rake
194
+ - tasks/word_to_seedfu.rake
195
+ - test/helper.rb
196
+ - test/test_interact.rb
177
197
  homepage: http://github.com/autotelik/datashift
178
198
  licenses:
179
- - MIT
199
+ - MIT
180
200
  post_install_message:
181
201
  rdoc_options: []
182
202
 
183
203
  require_paths:
184
- - lib
204
+ - lib
185
205
  required_ruby_version: !ruby/object:Gem::Requirement
186
206
  none: false
187
207
  requirements:
188
- - - ">="
189
- - !ruby/object:Gem::Version
190
- version: "0"
208
+ - - ">="
209
+ - !ruby/object:Gem::Version
210
+ hash: 3
211
+ segments:
212
+ - 0
213
+ version: "0"
191
214
  required_rubygems_version: !ruby/object:Gem::Requirement
192
215
  none: false
193
216
  requirements:
194
- - - ">="
195
- - !ruby/object:Gem::Version
196
- version: "0"
217
+ - - ">="
218
+ - !ruby/object:Gem::Version
219
+ hash: 3
220
+ segments:
221
+ - 0
222
+ version: "0"
197
223
  requirements: []
198
224
 
199
225
  rubyforge_project:
200
- rubygems_version: 1.8.15
226
+ rubygems_version: 1.8.24
201
227
  signing_key:
202
228
  specification_version: 3
203
229
  summary: Shift data betwen applications and Active Record
@@ -1,74 +0,0 @@
1
- # Copyright:: (c) Autotelik Media Ltd 2012
2
- # Author :: Tom Statter
3
- # Date :: April 2012
4
- # License:: MIT.
5
- #
6
- # Usage::
7
- #
8
- # To pull Datashift commands into your main application :
9
- #
10
- # require 'datashift'
11
- #
12
- # DataShift::load_commands
13
- #
14
- # Cmd Line:
15
- #
16
- # => bundle exec thor datashift:export:excel -m <active record class> -r <output_template.xls> -a
17
- #
18
- require 'datashift'
19
-
20
- # Note, not DataShift, case sensitive, create namespace for command line : datashift
21
- module Datashift
22
-
23
-
24
- class Export < Thor
25
-
26
- include DataShift::Logging
27
-
28
- desc "excel", "export any active record model (with optional associations)"
29
- method_option :model, :aliases => '-m', :required => true, :desc => "The active record model to export"
30
- method_option :result, :aliases => '-r', :required => true, :desc => "Create template of model in supplied file"
31
- method_option :assoc, :aliases => '-a', :type => :boolean, :desc => "Include all associations in the template"
32
- method_option :exclude, :aliases => '-e', :type => :array, :desc => "Use with -a : Exclude association types. Any from #{DataShift::MethodDetail::supported_types_enum.to_a.inspect}"
33
-
34
- def excel()
35
-
36
- # TODO - We're assuming run from a rails app/top level dir...
37
- # ...can we make this more robust ? e.g what about when using active record but not in Rails app,
38
- require File.expand_path('config/environment.rb')
39
-
40
- require 'excel_exporter'
41
-
42
- model = options[:model]
43
- result = options[:result]
44
-
45
- logger.info "Datashift: Start Excel export to #{result}"
46
-
47
- begin
48
- # support modules e.g "Spree::Property")
49
- klass = ModelMapper::class_from_string(model) #Kernel.const_get(model)
50
- rescue NameError => e
51
- puts e
52
- raise "ERROR: No such Model [#{model}] found - check valid model supplied via -model <Class>"
53
- end
54
-
55
- begin
56
- gen = DataShift::ExcelExporter.new(result)
57
-
58
- if(options[:assoc])
59
- opts = (options[:exclude]) ? {:exclude => options[:exclude]} : {}
60
- logger.info("Datashift: Exporting with associations")
61
- gen.generate_with_associations(klass, opts)
62
- else
63
- gen.generate(klass)
64
- end
65
- rescue => e
66
- puts e
67
- puts e.backtrace
68
- puts "Warning: Error during export, data may be incomplete"
69
- end
70
-
71
- end
72
- end
73
-
74
- end