datashift 0.16.0 → 0.40.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{LICENSE.txt → LICENSE} +0 -0
- data/Rakefile +1 -20
- data/datashift.thor +125 -0
- data/lib/applications/apache_poi_extensions.rb +21 -52
- data/lib/applications/excel.rb +64 -57
- data/lib/applications/hssf_row_extensions.rb +66 -0
- data/lib/applications/jexcel_file.rb +99 -95
- data/lib/applications/jexcel_file_extensions.rb +76 -83
- data/lib/applications/jruby/word.rb +36 -36
- data/lib/applications/ruby_poi_translations.rb +34 -32
- data/lib/applications/spreadsheet_extensions.rb +21 -19
- data/lib/datashift.rb +49 -59
- data/lib/datashift/binder.rb +217 -0
- data/lib/datashift/column_packer.rb +21 -72
- data/lib/datashift/configuration.rb +317 -0
- data/lib/datashift/context_factory.rb +88 -0
- data/lib/datashift/core_ext/array.rb +15 -0
- data/lib/datashift/core_ext/csv_ext.rb +46 -0
- data/lib/datashift/core_ext/string.rb +49 -0
- data/lib/datashift/core_ext/to_b.rb +11 -0
- data/lib/datashift/delimiters.rb +55 -61
- data/lib/datashift/doc_context.rb +137 -0
- data/lib/datashift/excel_base.rb +93 -81
- data/lib/datashift/exceptions.rb +30 -28
- data/lib/datashift/file_definitions.rb +44 -39
- data/lib/datashift/guards.rb +5 -5
- data/lib/datashift/header.rb +25 -0
- data/lib/datashift/headers.rb +94 -0
- data/lib/datashift/inbound_data/column.rb +44 -0
- data/lib/datashift/inbound_data/lookup_support.rb +33 -0
- data/lib/datashift/inbound_data/method_binding.rb +139 -0
- data/lib/datashift/load_object.rb +37 -12
- data/lib/datashift/logging.rb +54 -27
- data/lib/datashift/mandatory.rb +39 -0
- data/lib/datashift/mapping/data_flow_schema.rb +198 -0
- data/lib/datashift/{model_mapper.rb → mapping/mapper_utils.rb} +30 -10
- data/lib/datashift/model_methods/catalogue.rb +183 -0
- data/lib/datashift/model_methods/collection.rb +140 -0
- data/lib/datashift/model_methods/model_method.rb +162 -0
- data/lib/datashift/model_methods/model_methods_manager.rb +76 -0
- data/lib/datashift/model_methods/operator.rb +62 -0
- data/lib/datashift/node_collection.rb +26 -0
- data/lib/datashift/node_context.rb +68 -0
- data/lib/datashift/populator.rb +308 -282
- data/lib/datashift/progress_monitor.rb +91 -0
- data/lib/datashift/querying.rb +110 -52
- data/lib/datashift/templates/import_export_config.erb +55 -0
- data/lib/datashift/transformation/factory.rb +219 -0
- data/lib/datashift/transformation/remove.rb +44 -0
- data/lib/datashift/version.rb +3 -0
- data/lib/exporters/configuration.rb +84 -0
- data/lib/exporters/csv_exporter.rb +54 -52
- data/lib/exporters/excel_exporter.rb +80 -61
- data/lib/exporters/exporter_base.rb +8 -8
- data/lib/generators/config_generator.rb +218 -0
- data/lib/generators/csv_generator.rb +13 -70
- data/lib/generators/excel_generator.rb +23 -111
- data/lib/generators/generator_base.rb +15 -70
- data/lib/loaders/configuration.rb +90 -0
- data/lib/loaders/csv_loader.rb +63 -101
- data/lib/loaders/excel_loader.rb +71 -156
- data/lib/loaders/failure_data.rb +40 -0
- data/lib/loaders/file_loader.rb +16 -0
- data/lib/loaders/loader_base.rb +82 -410
- data/lib/loaders/loader_factory.rb +42 -0
- data/lib/loaders/paperclip/attachment_loader.rb +157 -140
- data/lib/loaders/paperclip/datashift_paperclip.rb +18 -35
- data/lib/loaders/paperclip/image_loading.rb +40 -35
- data/lib/loaders/reporters/basic_stdout_reporter.rb +40 -0
- data/lib/loaders/reporters/reporter.rb +26 -0
- data/lib/tasks/config.thor +65 -0
- data/{tasks → lib/tasks}/config/seed_fu_product_template.erb +0 -0
- data/{tasks → lib/tasks}/config/tidy_config.txt +0 -0
- data/lib/tasks/export.thor +192 -0
- data/lib/tasks/generate.thor +190 -0
- data/lib/tasks/import.thor +142 -0
- data/lib/{thor → tasks}/paperclip.thor +69 -69
- data/{tasks → lib/tasks/to_convert_to_thor}/db_tasks.rake +20 -20
- data/lib/tasks/tools.thor +109 -0
- data/spec/MissingAttachmentRecords/DEMO_001_ror_bag.jpeg +0 -0
- data/spec/MissingAttachmentRecords/DEMO_002_Powerstation.jpeg +0 -0
- data/spec/MissingAttachmentRecords/DEMO_003_ror_mug.jpeg +0 -0
- data/spec/MissingAttachmentRecords/DEMO_004_ror_ringer.jpeg +0 -0
- data/spec/datashift/binder_spec.rb +266 -0
- data/spec/datashift/config_generator_spec.rb +186 -0
- data/spec/datashift/configuration.rb +66 -0
- data/spec/datashift/context_factory_spec.rb +63 -0
- data/spec/datashift/data_flow_schema_spec.rb +150 -0
- data/spec/datashift/datashift_spec.rb +52 -0
- data/spec/datashift/excel_base_spec.rb +57 -0
- data/spec/datashift/excel_spec.rb +188 -0
- data/spec/datashift/failure_data_spec.rb +27 -0
- data/spec/{file_definitions.rb → datashift/file_definitions.rb} +9 -10
- data/spec/datashift/headers_spec.rb +56 -0
- data/spec/datashift/inbound_data_spec.rb +47 -0
- data/spec/datashift/mapper_utils_spec.rb +38 -0
- data/spec/datashift/method_binding_spec.rb +60 -0
- data/spec/datashift/model_method_spec.rb +109 -0
- data/spec/datashift/model_methods_catalogue.rb +111 -0
- data/spec/datashift/model_methods_collection_spec.rb +138 -0
- data/spec/datashift/model_methods_manager_spec.rb +329 -0
- data/spec/datashift/populator_spec.rb +117 -0
- data/spec/datashift/thor_spec.rb +314 -0
- data/spec/datashift/transformation/factory_spec.rb +195 -0
- data/spec/datashift/transformation/transformer_remove_spec.rb +43 -0
- data/spec/dummy/Gemfile +53 -0
- data/spec/dummy/Gemfile.lock +197 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +16 -0
- data/spec/dummy/app/assets/javascripts/categories.js +2 -0
- data/spec/dummy/app/assets/javascripts/digitals.js +2 -0
- data/spec/dummy/app/assets/javascripts/empties.js +2 -0
- data/spec/dummy/app/assets/javascripts/loader_releases.js +2 -0
- data/spec/dummy/app/assets/javascripts/long_and_complex_table_linked_to_versions.js +2 -0
- data/spec/dummy/app/assets/javascripts/milestones.js +2 -0
- data/spec/dummy/app/assets/javascripts/owners.js +2 -0
- data/spec/dummy/app/assets/javascripts/projects.js +2 -0
- data/spec/dummy/app/assets/javascripts/users.js +2 -0
- data/spec/dummy/app/assets/javascripts/versions.js +2 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/assets/stylesheets/categories.css +4 -0
- data/spec/dummy/app/assets/stylesheets/digitals.css +4 -0
- data/spec/dummy/app/assets/stylesheets/empties.css +4 -0
- data/spec/dummy/app/assets/stylesheets/loader_releases.css +4 -0
- data/spec/dummy/app/assets/stylesheets/long_and_complex_table_linked_to_versions.css +4 -0
- data/spec/dummy/app/assets/stylesheets/milestones.css +4 -0
- data/spec/dummy/app/assets/stylesheets/owners.css +4 -0
- data/spec/dummy/app/assets/stylesheets/projects.css +4 -0
- data/spec/dummy/app/assets/stylesheets/scaffold.css +56 -0
- data/spec/dummy/app/assets/stylesheets/users.css +4 -0
- data/spec/dummy/app/assets/stylesheets/versions.css +4 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/controllers/categories_controller.rb +58 -0
- data/spec/dummy/app/controllers/digitals_controller.rb +58 -0
- data/spec/dummy/app/controllers/empties_controller.rb +58 -0
- data/spec/dummy/app/controllers/loader_releases_controller.rb +58 -0
- data/spec/dummy/app/controllers/long_and_complex_table_linked_to_versions_controller.rb +58 -0
- data/spec/dummy/app/controllers/milestones_controller.rb +58 -0
- data/spec/dummy/app/controllers/owners_controller.rb +58 -0
- data/spec/dummy/app/controllers/projects_controller.rb +58 -0
- data/spec/dummy/app/controllers/users_controller.rb +58 -0
- data/spec/dummy/app/controllers/versions_controller.rb +58 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/helpers/categories_helper.rb +2 -0
- data/spec/dummy/app/helpers/digitals_helper.rb +2 -0
- data/spec/dummy/app/helpers/empties_helper.rb +2 -0
- data/spec/dummy/app/helpers/loader_releases_helper.rb +2 -0
- data/spec/dummy/app/helpers/long_and_complex_table_linked_to_versions_helper.rb +2 -0
- data/spec/dummy/app/helpers/milestones_helper.rb +2 -0
- data/spec/dummy/app/helpers/owners_helper.rb +2 -0
- data/spec/dummy/app/helpers/projects_helper.rb +2 -0
- data/spec/dummy/app/helpers/users_helper.rb +2 -0
- data/spec/dummy/app/helpers/versions_helper.rb +2 -0
- data/spec/dummy/app/models/category.rb +6 -0
- data/spec/dummy/app/models/digital.rb +22 -0
- data/spec/dummy/app/models/empty.rb +2 -0
- data/spec/dummy/app/models/loader_release.rb +10 -0
- data/spec/dummy/app/models/long_and_complex_table_linked_to_version.rb +6 -0
- data/spec/dummy/app/models/milestone.rb +15 -0
- data/spec/dummy/app/models/owner.rb +13 -0
- data/spec/dummy/app/models/project.rb +53 -0
- data/spec/dummy/app/models/user.rb +5 -0
- data/spec/dummy/app/models/version.rb +7 -0
- data/spec/dummy/app/views/categories/_form.html.erb +17 -0
- data/spec/dummy/app/views/categories/edit.html.erb +6 -0
- data/spec/dummy/app/views/categories/index.html.erb +25 -0
- data/spec/dummy/app/views/categories/new.html.erb +5 -0
- data/spec/dummy/app/views/categories/show.html.erb +4 -0
- data/spec/dummy/app/views/digitals/_form.html.erb +17 -0
- data/spec/dummy/app/views/digitals/edit.html.erb +6 -0
- data/spec/dummy/app/views/digitals/index.html.erb +25 -0
- data/spec/dummy/app/views/digitals/new.html.erb +5 -0
- data/spec/dummy/app/views/digitals/show.html.erb +4 -0
- data/spec/dummy/app/views/empties/_form.html.erb +17 -0
- data/spec/dummy/app/views/empties/edit.html.erb +6 -0
- data/spec/dummy/app/views/empties/index.html.erb +25 -0
- data/spec/dummy/app/views/empties/new.html.erb +5 -0
- data/spec/dummy/app/views/empties/show.html.erb +4 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/loader_releases/_form.html.erb +17 -0
- data/spec/dummy/app/views/loader_releases/edit.html.erb +6 -0
- data/spec/dummy/app/views/loader_releases/index.html.erb +25 -0
- data/spec/dummy/app/views/loader_releases/new.html.erb +5 -0
- data/spec/dummy/app/views/loader_releases/show.html.erb +4 -0
- data/spec/dummy/app/views/long_and_complex_table_linked_to_versions/_form.html.erb +17 -0
- data/spec/dummy/app/views/long_and_complex_table_linked_to_versions/edit.html.erb +6 -0
- data/spec/dummy/app/views/long_and_complex_table_linked_to_versions/index.html.erb +25 -0
- data/spec/dummy/app/views/long_and_complex_table_linked_to_versions/new.html.erb +5 -0
- data/spec/dummy/app/views/long_and_complex_table_linked_to_versions/show.html.erb +4 -0
- data/spec/dummy/app/views/milestones/_form.html.erb +17 -0
- data/spec/dummy/app/views/milestones/edit.html.erb +6 -0
- data/spec/dummy/app/views/milestones/index.html.erb +25 -0
- data/spec/dummy/app/views/milestones/new.html.erb +5 -0
- data/spec/dummy/app/views/milestones/show.html.erb +4 -0
- data/spec/dummy/app/views/owners/_form.html.erb +17 -0
- data/spec/dummy/app/views/owners/edit.html.erb +6 -0
- data/spec/dummy/app/views/owners/index.html.erb +25 -0
- data/spec/dummy/app/views/owners/new.html.erb +5 -0
- data/spec/dummy/app/views/owners/show.html.erb +4 -0
- data/spec/dummy/app/views/projects/_form.html.erb +17 -0
- data/spec/dummy/app/views/projects/edit.html.erb +6 -0
- data/spec/dummy/app/views/projects/index.html.erb +25 -0
- data/spec/dummy/app/views/projects/new.html.erb +5 -0
- data/spec/dummy/app/views/projects/show.html.erb +4 -0
- data/spec/dummy/app/views/users/_form.html.erb +17 -0
- data/spec/dummy/app/views/users/edit.html.erb +6 -0
- data/spec/dummy/app/views/users/index.html.erb +25 -0
- data/spec/dummy/app/views/users/new.html.erb +5 -0
- data/spec/dummy/app/views/users/show.html.erb +4 -0
- data/spec/dummy/app/views/versions/_form.html.erb +17 -0
- data/spec/dummy/app/views/versions/edit.html.erb +6 -0
- data/spec/dummy/app/views/versions/index.html.erb +25 -0
- data/spec/dummy/app/views/versions/new.html.erb +5 -0
- data/spec/dummy/app/views/versions/show.html.erb +4 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +9 -0
- data/spec/dummy/bin/rake +9 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/bin/spring +16 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +26 -0
- data/spec/dummy/config/boot.rb +3 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +41 -0
- data/spec/dummy/config/environments/production.rb +79 -0
- data/spec/dummy/config/environments/test.rb +42 -0
- data/spec/dummy/config/initializers/assets.rb +11 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +76 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20110803201325_create_test_bed.rb +98 -0
- data/spec/dummy/db/migrate/20121009161700_add_digitals.rb +24 -0
- data/spec/dummy/db/migrate/20161005123106_create_digitals.rb +8 -0
- data/spec/dummy/db/migrate/20161005123106_create_long_and_complex_table_linked_to_versions.rb +8 -0
- data/spec/dummy/db/migrate/20161005123107_create_loader_releases.rb +8 -0
- data/spec/dummy/db/migrate/20161005123108_create_owners.rb +8 -0
- data/spec/dummy/db/migrate/20161005123109_create_empties.rb +8 -0
- data/spec/dummy/db/migrate/20161005123110_create_projects.rb +8 -0
- data/spec/dummy/db/migrate/20161005123111_create_users.rb +8 -0
- data/spec/dummy/db/migrate/20161005123111_create_versions.rb +8 -0
- data/spec/dummy/db/migrate/20161005123112_create_milestones.rb +8 -0
- data/spec/dummy/db/migrate/20161005123113_create_categories.rb +8 -0
- data/spec/dummy/db/schema.rb +93 -0
- data/spec/dummy/db/seeds.rb +9 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +69 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/robots.txt +5 -0
- data/spec/dummy/sandbox_example.thor +4 -0
- data/spec/dummy/test/controllers/categories_controller_test.rb +49 -0
- data/spec/dummy/test/controllers/digitals_controller_test.rb +49 -0
- data/spec/dummy/test/controllers/empties_controller_test.rb +49 -0
- data/spec/dummy/test/controllers/loader_releases_controller_test.rb +49 -0
- data/spec/dummy/test/controllers/long_and_complex_table_linked_to_versions_controller_test.rb +49 -0
- data/spec/dummy/test/controllers/milestones_controller_test.rb +49 -0
- data/spec/dummy/test/controllers/owners_controller_test.rb +49 -0
- data/spec/dummy/test/controllers/projects_controller_test.rb +49 -0
- data/spec/dummy/test/controllers/users_controller_test.rb +49 -0
- data/spec/dummy/test/controllers/versions_controller_test.rb +49 -0
- data/spec/dummy/test/factories/categories.rb +5 -0
- data/spec/dummy/test/factories/digitals.rb +5 -0
- data/spec/dummy/test/factories/empties.rb +5 -0
- data/spec/dummy/test/factories/loader_releases.rb +5 -0
- data/spec/dummy/test/factories/long_and_complex_table_linked_to_versions.rb +5 -0
- data/spec/dummy/test/factories/milestones.rb +5 -0
- data/spec/dummy/test/factories/owners.rb +5 -0
- data/spec/dummy/test/factories/projects.rb +5 -0
- data/spec/dummy/test/factories/users.rb +5 -0
- data/spec/dummy/test/factories/versions.rb +5 -0
- data/spec/dummy/test/models/category_test.rb +7 -0
- data/spec/dummy/test/models/digital_test.rb +7 -0
- data/spec/dummy/test/models/empty_test.rb +7 -0
- data/spec/dummy/test/models/loader_release_test.rb +7 -0
- data/spec/dummy/test/models/long_and_complex_table_linked_to_version_test.rb +7 -0
- data/spec/dummy/test/models/milestone_test.rb +7 -0
- data/spec/dummy/test/models/owner_test.rb +7 -0
- data/spec/dummy/test/models/project_test.rb +7 -0
- data/spec/dummy/test/models/user_test.rb +7 -0
- data/spec/dummy/test/models/version_test.rb +7 -0
- data/spec/dummy/test/test_helper.rb +10 -0
- data/spec/exporters/csv_exporter_spec.rb +240 -0
- data/spec/exporters/csv_generator_spec.rb +139 -0
- data/spec/exporters/excel_exporter_spec.rb +193 -0
- data/spec/exporters/excel_generator_spec.rb +181 -0
- data/spec/exporters/generator_base_spec.rb +45 -0
- data/spec/factories/categories.rb +7 -0
- data/spec/factories/factories.rb +18 -0
- data/spec/factories/milestone.rb +16 -0
- data/spec/factories/projects.rb +41 -0
- data/spec/fixtures/BadAssociationName.xls +0 -0
- data/spec/fixtures/DemoNegativeTesting.xls +0 -0
- data/spec/fixtures/ProjectConfiguration.yml +18 -0
- data/spec/fixtures/ProjectsMultiCategories.xls +0 -0
- data/spec/fixtures/ProjectsMultiCategoriesHeaderLookup.xls +0 -0
- data/spec/fixtures/ProjectsSingleCategories.xls +0 -0
- data/spec/fixtures/ProjectsSingleCategories.xlsx +0 -0
- data/spec/fixtures/SimpleProjects.xls +0 -0
- data/spec/fixtures/config/database.yml +28 -0
- data/spec/fixtures/csv/BadAssociationName.csv +6 -0
- data/spec/fixtures/csv/DemoNegativeTesting.csv +6 -0
- data/spec/fixtures/csv/ProjectsMultiCategories.csv +5 -0
- data/spec/fixtures/csv/ProjectsMultiCategoriesHeaderLookup.csv +5 -0
- data/spec/fixtures/csv/ProjectsSingleCategories.csv +5 -0
- data/spec/fixtures/csv/SimpleProjects.csv +4 -0
- data/spec/fixtures/db/migrate/20110803201325_create_test_bed.rb +98 -0
- data/spec/fixtures/db/migrate/20121009161700_add_digitals.rb +24 -0
- data/spec/fixtures/db/seeds.rb +9 -0
- data/spec/fixtures/images/DEMO_001_ror_bag.jpeg +0 -0
- data/spec/fixtures/images/DEMO_002_Powerstation.jpeg +0 -0
- data/spec/fixtures/images/DEMO_003_ror_mug.jpeg +0 -0
- data/spec/fixtures/images/DEMO_004_ror_ringer.jpeg +0 -0
- data/spec/fixtures/load_datashift.thor +3 -0
- data/spec/fixtures/models/category.rb +6 -0
- data/spec/fixtures/models/digital.rb +22 -0
- data/spec/fixtures/models/empty.rb +2 -0
- data/spec/fixtures/models/loader_release.rb +10 -0
- data/spec/fixtures/models/long_and_complex_table_linked_to_version.rb +6 -0
- data/spec/fixtures/models/milestone.rb +15 -0
- data/spec/fixtures/models/owner.rb +13 -0
- data/spec/fixtures/models/project.rb +53 -0
- data/spec/fixtures/models/user.rb +5 -0
- data/spec/fixtures/models/version.rb +7 -0
- data/spec/fixtures/results/exp_project_assoc_headers.xls +0 -0
- data/spec/fixtures/results/exp_project_collection_spec.csv +2 -0
- data/spec/fixtures/results/exp_project_export.xls +0 -0
- data/spec/fixtures/results/exp_project_first_export.xls +0 -0
- data/spec/fixtures/results/exp_project_plus_assoc.xls +0 -0
- data/spec/fixtures/results/exp_project_plus_assoc_export_spec.csv +9 -0
- data/spec/fixtures/results/gen_project_plus_assoc_template.xls +0 -0
- data/spec/fixtures/results/gen_project_plus_some_assoc_template.xls +0 -0
- data/spec/fixtures/results/gen_project_template.xls +0 -0
- data/spec/fixtures/results/project_and_assoc_in_hash_export.xls +0 -0
- data/spec/fixtures/results/project_and_assoc_in_json_export.csv +9 -0
- data/spec/fixtures/results/project_and_assoc_in_json_export.xls +0 -0
- data/spec/fixtures/results/project_export_spec_with_custom_delim_,.csv +2 -0
- data/spec/fixtures/results/project_export_spec_with_custom_delim_/302/243.csv +2 -0
- data/spec/fixtures/results/project_export_spec_with_custom_delim_/302/247.csv +2 -0
- data/spec/fixtures/results/project_plus_assoc_template.csv +1 -0
- data/spec/fixtures/results/project_plus_some_assoc_template.csv +1 -0
- data/spec/fixtures/results/project_remove_export_spec.csv +2 -0
- data/spec/fixtures/results/project_template.csv +1 -0
- data/spec/fixtures/results/project_with_methods_export_spec.csv +2 -0
- data/spec/fixtures/results/thor_spec_gen_project.csv +1 -0
- data/spec/fixtures/sandbox_example.thor +4 -0
- data/spec/fixtures/simple_export_spec.xls +0 -0
- data/spec/fixtures/simple_template_spec.xls +0 -0
- data/spec/fixtures/test_model_defs.rb +7 -0
- data/spec/loaders/csv_loader_spec.rb +206 -0
- data/spec/loaders/data_flow_excel_loader_spec.rb +290 -0
- data/spec/loaders/excel_loader_failures_spec.rb +67 -0
- data/spec/loaders/excel_loader_spec.rb +294 -0
- data/spec/loaders/loader_base_spec.rb +29 -0
- data/spec/loaders/paperclip_loader_spec.rb +106 -0
- data/spec/log/datashift.log +14930 -0
- data/spec/private/digitals/1/DEMO_003_ror_mug.jpeg +0 -0
- data/spec/private/digitals/2/DEMO_002_Powerstation.jpeg +0 -0
- data/spec/private/digitals/3/DEMO_004_ror_ringer.jpeg +0 -0
- data/spec/private/digitals/4/DEMO_001_ror_bag.jpeg +0 -0
- data/spec/spec_helper.rb +26 -230
- data/spec/support/clear_and_manage_contexts.rb +25 -0
- data/spec/support/database_cleaner.rb +32 -0
- data/spec/support/datashift_test_helpers.rb +153 -0
- data/spec/support/files_paths_helper.rb +13 -0
- data/spec/support/fixtures/results/mapping_template.yaml +15 -0
- data/spec/support/sandbox.rb +136 -0
- metadata +804 -85
- data/README.markdown +0 -274
- data/README.rdoc +0 -19
- data/VERSION +0 -1
- data/datashift.gemspec +0 -48
- data/lib/applications/jruby/old_pre_proxy_jexcel_file.rb +0 -437
- data/lib/datashift/data_transforms.rb +0 -83
- data/lib/datashift/mapping_file_definitions.rb +0 -88
- data/lib/datashift/mapping_service.rb +0 -91
- data/lib/datashift/method_detail.rb +0 -165
- data/lib/datashift/method_details_manager.rb +0 -95
- data/lib/datashift/method_dictionary.rb +0 -281
- data/lib/datashift/method_mapper.rb +0 -174
- data/lib/datashift/thor_base.rb +0 -38
- data/lib/generators/mapping_generator.rb +0 -112
- data/lib/helpers/core_ext/csv_file.rb +0 -33
- data/lib/helpers/core_ext/to_b.rb +0 -24
- data/lib/loaders/reporter.rb +0 -58
- data/lib/thor/export.thor +0 -175
- data/lib/thor/generate.thor +0 -191
- data/lib/thor/import.thor +0 -110
- data/lib/thor/mapping.thor +0 -65
- data/lib/thor/tools.thor +0 -84
- data/spec/Gemfile +0 -31
- data/spec/Gemfile.lock +0 -134
- data/spec/csv_exporter_spec.rb +0 -144
- data/spec/csv_generator_spec.rb +0 -159
- data/spec/csv_loader_spec.rb +0 -212
- data/spec/datashift_spec.rb +0 -55
- data/spec/excel_exporter_spec.rb +0 -199
- data/spec/excel_generator_spec.rb +0 -203
- data/spec/excel_loader_spec.rb +0 -237
- data/spec/excel_spec.rb +0 -203
- data/spec/loader_base_spec.rb +0 -166
- data/spec/mapping_spec.rb +0 -117
- data/spec/method_dictionary_spec.rb +0 -300
- data/spec/method_mapper_spec.rb +0 -100
- data/spec/model_mapper_spec.rb +0 -41
- data/spec/paperclip_loader_spec.rb +0 -92
- data/spec/populator_spec.rb +0 -128
- data/spec/thor_spec.rb +0 -90
- data/tasks/file_tasks.rake +0 -37
- data/tasks/word_to_seedfu.rake +0 -167
@@ -1,6 +1,5 @@
|
|
1
|
-
# Copyright:: (c) Autotelik Media Ltd
|
1
|
+
# Copyright:: (c) Autotelik Media Ltd 2015
|
2
2
|
# Author :: Tom Statter
|
3
|
-
# Date :: Aug 2010
|
4
3
|
# License:: MIT
|
5
4
|
#
|
6
5
|
# Details:: Base class for Exporters, which provide services to export a Model
|
@@ -10,12 +9,13 @@ module DataShift
|
|
10
9
|
|
11
10
|
class ExporterBase
|
12
11
|
|
13
|
-
attr_accessor :
|
14
|
-
|
15
|
-
|
16
|
-
|
12
|
+
attr_accessor :configuration
|
13
|
+
attr_accessor :file_name
|
14
|
+
|
15
|
+
def initialize
|
16
|
+
@configuration = DataShift::Exporters::Configuration.call
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
19
|
end
|
20
20
|
|
21
|
-
end
|
21
|
+
end
|
@@ -0,0 +1,218 @@
|
|
1
|
+
# Copyright:: (c) Autotelik Media Ltd 2015
|
2
|
+
# Author :: Tom Statter
|
3
|
+
# Date :: Mar 2015
|
4
|
+
# License:: MIT
|
5
|
+
#
|
6
|
+
# Details:: Generate an empty Configuration file, users can populate
|
7
|
+
# to configure their specific import and export
|
8
|
+
#
|
9
|
+
require 'generator_base'
|
10
|
+
|
11
|
+
module DataShift
|
12
|
+
|
13
|
+
class ConfigGenerator < GeneratorBase
|
14
|
+
|
15
|
+
def self.title
|
16
|
+
@mappings_title ||= "datashift_mappings:\n"
|
17
|
+
end
|
18
|
+
|
19
|
+
attr_accessor :output_filename, :headers
|
20
|
+
|
21
|
+
attr_writer :import_template, :export_template
|
22
|
+
|
23
|
+
def initialize
|
24
|
+
super
|
25
|
+
end
|
26
|
+
|
27
|
+
def import_template
|
28
|
+
@import_template ||= File.join(DataShift.library_path, 'datashift/templates/import_export_config.erb')
|
29
|
+
end
|
30
|
+
|
31
|
+
def export_template
|
32
|
+
@export_template ||= File.join(DataShift.library_path, 'datashift/templates/import_export_config.erb')
|
33
|
+
end
|
34
|
+
|
35
|
+
# You can pass Transformations into the options
|
36
|
+
#
|
37
|
+
# options[:defaults]
|
38
|
+
# options[:overrides]
|
39
|
+
# options[:substitutions]
|
40
|
+
# options[:prefixes]
|
41
|
+
# options[:postfixes]
|
42
|
+
#
|
43
|
+
# For example :
|
44
|
+
#
|
45
|
+
# options = {
|
46
|
+
# defaults: {'value_as_string': 'some default text', 'value_as_double': 45.467 }
|
47
|
+
# }
|
48
|
+
#
|
49
|
+
def write_import(file_name, klass_or_name, options = {})
|
50
|
+
result = create_import_config(klass_or_name, options)
|
51
|
+
|
52
|
+
logger.info("Writing Import Config File [#{file_name}]")
|
53
|
+
|
54
|
+
File.open(file_name, 'w') { |f| f << result }
|
55
|
+
|
56
|
+
result
|
57
|
+
end
|
58
|
+
|
59
|
+
# N.B Gettign the YAML formatted correctly was nigh on impossible in ERB,
|
60
|
+
# be careful of the spacing in the string sections here e.g dont use IDE auto spacing tools
|
61
|
+
|
62
|
+
# TODO: - How to better isolate these string template snippets
|
63
|
+
|
64
|
+
# Create an YAML ERB Configuration template for Importing.
|
65
|
+
# Includes available transformations and column mapping
|
66
|
+
#
|
67
|
+
# For other options See DataShift::Loaders::Configuration
|
68
|
+
#
|
69
|
+
def create_section(hash)
|
70
|
+
section = ''
|
71
|
+
(hash || { "#name": 'value' } ).each { |n, v| section += " #{n}: #{v}\n" }
|
72
|
+
section
|
73
|
+
end
|
74
|
+
|
75
|
+
def create_import_config(klass_or_name, options = {})
|
76
|
+
|
77
|
+
klass = MapperUtils.ensure_class(klass_or_name)
|
78
|
+
|
79
|
+
@key = 'data_flow_schema'
|
80
|
+
@klass = klass.name.to_s
|
81
|
+
|
82
|
+
defaults_section = create_section(options[:defaults] )
|
83
|
+
overrides_section = create_section(options[:overrides] )
|
84
|
+
prefixes_section = create_section(options[:prefixes] )
|
85
|
+
postfixes_section = create_section(options[:postfixes] )
|
86
|
+
|
87
|
+
@substitutions = options[:substitutions] || {}
|
88
|
+
|
89
|
+
# operator => [rule , replacement]
|
90
|
+
substitutions_section = ''
|
91
|
+
|
92
|
+
@substitutions.each do |o, v|
|
93
|
+
raise BadConfig, 'Substitutions need be in format {operator: [rule, replacement]}' unless(v.is_a? Array)
|
94
|
+
substitutions_section += <<-EOS
|
95
|
+
#{o}:
|
96
|
+
- #{v.first}
|
97
|
+
- #{v.last}
|
98
|
+
EOS
|
99
|
+
end
|
100
|
+
|
101
|
+
@headers = Headers.klass_to_headers(klass)
|
102
|
+
|
103
|
+
nodes_section = <<-EOS
|
104
|
+
# Mappings between inbound column names and internal names
|
105
|
+
# are only required when datashift cannot guess the mapping itself
|
106
|
+
# It will automatically map headings like :
|
107
|
+
# 'Product properties' or 'Product_Properties', 'product Properties' etc to product_properties
|
108
|
+
nodes:
|
109
|
+
EOS
|
110
|
+
|
111
|
+
@headers.each_with_index do |s, _i|
|
112
|
+
nodes_section += <<-EOS
|
113
|
+
- #{s}:
|
114
|
+
heading:
|
115
|
+
source: #{s}
|
116
|
+
presentation: #{s}
|
117
|
+
EOS
|
118
|
+
end
|
119
|
+
|
120
|
+
x = <<-EOS
|
121
|
+
# YAML Configuration file for Datashift Import/Export
|
122
|
+
#
|
123
|
+
#{@key}:
|
124
|
+
#{@klass}:
|
125
|
+
defaults:
|
126
|
+
#{defaults_section}
|
127
|
+
overrides:
|
128
|
+
#{overrides_section}
|
129
|
+
# Expects a tuple (list with 2 entries), the rule and the replacement
|
130
|
+
substitutions:
|
131
|
+
#{substitutions_section}
|
132
|
+
prefixes:
|
133
|
+
#{prefixes_section}
|
134
|
+
postfixes:
|
135
|
+
#{postfixes_section}
|
136
|
+
|
137
|
+
#{nodes_section}
|
138
|
+
|
139
|
+
EOS
|
140
|
+
|
141
|
+
# This was a nightmare to get proeprly formatted YAML
|
142
|
+
# Erubis::Eruby.new( File.read(import_template)).result(binding)
|
143
|
+
|
144
|
+
x
|
145
|
+
end
|
146
|
+
|
147
|
+
# FOR EXPORTERS
|
148
|
+
|
149
|
+
def write_export(file_name, klass_or_name, options = {})
|
150
|
+
result = export(klass_or_name, options)
|
151
|
+
|
152
|
+
logger.info("Writing Export Config File [#{config[:file]}]")
|
153
|
+
|
154
|
+
File.open(file_name, 'w') { |f| f << result }
|
155
|
+
end
|
156
|
+
|
157
|
+
# Create an YAML Configuration template for Exporting
|
158
|
+
# includes available transformations and column mapping
|
159
|
+
#
|
160
|
+
# For other options See DataShift::Exporters::Configuration
|
161
|
+
#
|
162
|
+
def export(klass_or_name, options = {})
|
163
|
+
|
164
|
+
@klass = MapperUtils.ensure_class(klass_or_name)
|
165
|
+
|
166
|
+
@title = @klass.name.to_s
|
167
|
+
|
168
|
+
@defaults = options[:defaults] || []
|
169
|
+
|
170
|
+
@overrides = options[:overrides] || []
|
171
|
+
@substitutions = options[:substitutions] || []
|
172
|
+
@prefixs = options[:prefixs] || []
|
173
|
+
@postfixs = options[:postfixs] || []
|
174
|
+
|
175
|
+
klass_to_headers(@klass)
|
176
|
+
|
177
|
+
Erubis::Eruby.new( File.read(export_template)).result(binding)
|
178
|
+
end
|
179
|
+
|
180
|
+
# Create an YAML template BAASED on an Excel spreadsheet for mapping headers
|
181
|
+
#
|
182
|
+
# * <tt>:title</tt> - Top level YAML node -defaults to ConfigGenerator.title
|
183
|
+
#
|
184
|
+
# * <tt>:model_as_dest</tt> - Override default treatment of using model as the SOURCE
|
185
|
+
#
|
186
|
+
# * <tt>:file</tt> - Write mappings direct to file name provided
|
187
|
+
#
|
188
|
+
def generate_from_excel(excel_file_name, options = {})
|
189
|
+
|
190
|
+
excel = Excel.new
|
191
|
+
|
192
|
+
puts "\n\n\nGenerating mapping from Excel file: #{excel_file_name}"
|
193
|
+
|
194
|
+
excel.open(excel_file_name)
|
195
|
+
|
196
|
+
sheet_number = options[:sheet_number] || 0
|
197
|
+
|
198
|
+
sheet = excel.worksheet( sheet_number )
|
199
|
+
|
200
|
+
@headers = excel.parse_headers(sheet, options[:header_row] || 0)
|
201
|
+
|
202
|
+
mappings = options[:title] || ConfigGenerator.title
|
203
|
+
|
204
|
+
if options[:model_as_dest]
|
205
|
+
headers.each_with_index { |s, i| mappings += " #srcs_column_heading_#{i}: #{s}\n" }
|
206
|
+
else
|
207
|
+
headers.each_with_index { |s, i| mappings += " #{s}: #dest_column_heading_#{i}\n" }
|
208
|
+
end
|
209
|
+
|
210
|
+
File.open(options[:file], 'w') { |f| f << mappings } if options[:file]
|
211
|
+
|
212
|
+
mappings
|
213
|
+
|
214
|
+
end
|
215
|
+
|
216
|
+
end
|
217
|
+
|
218
|
+
end # DataShift
|
@@ -1,92 +1,35 @@
|
|
1
|
-
# Copyright:: (c) Autotelik Media Ltd
|
1
|
+
# Copyright:: (c) Autotelik Media Ltd 2015
|
2
2
|
# Author :: Tom Statter
|
3
|
-
# Date :: Aug 2011
|
4
3
|
# License:: MIT
|
5
4
|
#
|
6
|
-
# Details:: Export a model to CSV
|
5
|
+
# Details:: Export a model definition to CSV
|
7
6
|
#
|
8
7
|
#
|
9
|
-
require 'generator_base'
|
10
|
-
|
11
8
|
module DataShift
|
12
9
|
|
13
10
|
class CsvGenerator < GeneratorBase
|
14
11
|
|
15
|
-
|
12
|
+
attr_accessor :file_name
|
16
13
|
|
17
|
-
def initialize
|
18
|
-
super
|
14
|
+
def initialize
|
15
|
+
super
|
19
16
|
end
|
20
17
|
|
21
18
|
# Create CSV file representing supplied Model
|
19
|
+
#
|
20
|
+
def generate(file_name, klass)
|
21
|
+
@file_name = file_name
|
22
22
|
|
23
|
-
|
24
|
-
@filename = options[:filename] if options[:filename]
|
25
|
-
|
26
|
-
prep_remove_list(options)
|
27
|
-
|
28
|
-
MethodDictionary.find_operators( klass )
|
29
|
-
@headers = MethodDictionary.assignments[klass]
|
30
|
-
|
31
|
-
@headers.delete_if{|h| @remove_list.include?( h.to_sym ) }
|
32
|
-
|
33
|
-
logger.info("CSVGenerator saving generated template #{@filename}")
|
34
|
-
|
35
|
-
CSV.open(@filename, "w") do |csv|
|
36
|
-
csv << @headers
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
def generate_with_associations(klass, options = {})
|
41
|
-
@filename = options[:filename] if options[:filename]
|
42
|
-
|
43
|
-
MethodDictionary.find_operators( klass )
|
44
|
-
MethodDictionary.build_method_details( klass )
|
45
|
-
|
46
|
-
work_list = MethodDetail::supported_types_enum.to_a - [ *options[:exclude] ]
|
47
|
-
|
48
|
-
prep_remove_list(options)
|
49
|
-
|
50
|
-
@headers = []
|
51
|
-
|
52
|
-
details_mgr = MethodDictionary.method_details_mgrs[klass]
|
53
|
-
|
54
|
-
work_list.each do |assoc_type|
|
55
|
-
method_details_for_assoc_type = details_mgr.get_list_of_method_details(assoc_type)
|
56
|
-
|
57
|
-
next if(method_details_for_assoc_type.nil? || method_details_for_assoc_type.empty?)
|
23
|
+
headers = Headers.klass_to_headers(klass)
|
58
24
|
|
59
|
-
|
60
|
-
comparable_association = md.operator.to_s.downcase.to_sym
|
25
|
+
logger.info("CSVGenerator saving generated Template #{@file_name}")
|
61
26
|
|
62
|
-
|
27
|
+
csv_delim = DataShift::Exporters::Configuration.call.csv_delimiter
|
63
28
|
|
64
|
-
|
65
|
-
|
29
|
+
CSV.open(file_name, 'w', col_sep: csv_delim ) do |csv|
|
30
|
+
csv << headers.sources
|
66
31
|
end
|
67
32
|
|
68
|
-
logger.info("CSVGenerator saving generated with associations template #{@filename}")
|
69
|
-
|
70
|
-
CSV.open(@filename, "w") do |csv|
|
71
|
-
csv << @headers
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
|
76
|
-
# Create an CSV file representing supplied Model
|
77
|
-
|
78
|
-
def export(items, options = {})
|
79
|
-
end
|
80
|
-
|
81
|
-
|
82
|
-
private
|
83
|
-
|
84
|
-
# Take options and create a list of symbols to remove from headers
|
85
|
-
#
|
86
|
-
def prep_remove_list( options )
|
87
|
-
@remove_list = [ *options[:remove] ].compact.collect{|x| x.to_s.downcase.to_sym }
|
88
|
-
|
89
|
-
@remove_list += GeneratorBase::rails_columns if(options[:remove_rails])
|
90
33
|
end
|
91
34
|
|
92
35
|
end
|
@@ -1,6 +1,5 @@
|
|
1
|
-
# Copyright:: (c) Autotelik Media Ltd
|
1
|
+
# Copyright:: (c) Autotelik Media Ltd 2015
|
2
2
|
# Author :: Tom Statter
|
3
|
-
# Date :: Aug 2011
|
4
3
|
# License:: MIT
|
5
4
|
#
|
6
5
|
# Details:: Export a model to Excel '97(-2007) file format.
|
@@ -8,130 +7,43 @@
|
|
8
7
|
# TOD : Can we switch between .xls and XSSF (POI implementation of Excel 2007 OOXML (.xlsx) file format.)
|
9
8
|
#
|
10
9
|
#
|
11
|
-
require 'generator_base'
|
12
10
|
require 'excel'
|
13
|
-
|
11
|
+
|
14
12
|
module DataShift
|
15
|
-
|
13
|
+
|
16
14
|
class ExcelGenerator < GeneratorBase
|
17
15
|
|
18
|
-
include DataShift::
|
19
|
-
|
16
|
+
include DataShift::ExcelBase
|
17
|
+
|
20
18
|
attr_accessor :excel
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
attr_accessor :file_name
|
20
|
+
|
21
|
+
def initialize
|
22
|
+
super
|
24
23
|
end
|
25
24
|
|
26
25
|
# Create an Excel file template (header row) representing supplied Model
|
27
|
-
#
|
28
|
-
# * <tt>:filename</tt>
|
29
|
-
# * <tt>:autosize</tt> - Autosize all the columns
|
26
|
+
# file_name => Filename for generated template
|
30
27
|
#
|
31
|
-
|
32
|
-
|
33
|
-
|
28
|
+
# See DataShift::Exporters::Configuration for options
|
29
|
+
#
|
30
|
+
def generate(file_name, klass, options = {})
|
34
31
|
|
35
|
-
|
36
|
-
|
37
|
-
@headers = MethodDictionary.assignments[klass]
|
38
|
-
|
39
|
-
@headers.delete_if{|h| @remove_list.include?( h.to_sym ) }
|
40
|
-
|
41
|
-
@excel.set_headers( @headers )
|
32
|
+
@file_name = file_name
|
42
33
|
|
43
|
-
|
44
|
-
|
45
|
-
#@excel.autosize if(options[:autosize])
|
46
|
-
|
47
|
-
@excel.write( @filename )
|
48
|
-
end
|
34
|
+
start_excel(klass, options)
|
49
35
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
#
|
54
|
-
# Options:
|
55
|
-
# * <tt>:filename</tt>
|
56
|
-
# * <tt>:autosize</tt> - Autosize all the columns
|
57
|
-
#
|
58
|
-
# * <tt>:exclude</tt> - Association TYPE(s) to exclude.
|
59
|
-
# You can specify a hash of {association_type => [array of association names] }
|
60
|
-
# to exclude from the template.
|
61
|
-
#
|
62
|
-
# Possible association_type values are given by MethodDetail::supported_types_enum
|
63
|
-
# ... [:assignment, :belongs_to, :has_one, :has_many]
|
64
|
-
#
|
65
|
-
# * <tt>:remove</tt> - Association NAME(s) to remove .. :title, :id, :name
|
66
|
-
# .
|
67
|
-
# * <tt>:remove_rails</tt> - Remove Rails DB columns :
|
68
|
-
# :id, :created_at, :created_on, :updated_at, :updated_on
|
69
|
-
#
|
70
|
-
def generate_with_associations(klass, options = {})
|
36
|
+
@headers = Headers.klass_to_headers(klass)
|
37
|
+
|
38
|
+
@excel.set_headers(@headers)
|
71
39
|
|
72
|
-
|
73
|
-
|
74
|
-
MethodDictionary.build_method_details( klass )
|
75
|
-
|
76
|
-
work_list = MethodDetail::supported_types_enum.to_a - [ *options[:exclude] ]
|
77
|
-
|
78
|
-
prep_remove_list(options)
|
79
|
-
|
80
|
-
@headers = []
|
81
|
-
|
82
|
-
details_mgr = MethodDictionary.method_details_mgrs[klass]
|
83
|
-
|
84
|
-
work_list.each do |assoc_type|
|
85
|
-
method_details_for_assoc_type = details_mgr.get_list_of_method_details(assoc_type)
|
86
|
-
|
87
|
-
next if(method_details_for_assoc_type.nil? || method_details_for_assoc_type.empty?)
|
88
|
-
|
89
|
-
method_details_for_assoc_type.each do |md|
|
90
|
-
comparable_association = md.operator.to_s.downcase.to_sym
|
40
|
+
logger.info("ExcelGenerator saving generated template #{@file_name}")
|
91
41
|
|
92
|
-
i = remove_list.index { |r| r == comparable_association }
|
93
|
-
|
94
|
-
(i) ? remove_list.delete_at(i) : headers << "#{md.operator}"
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
@excel.set_headers( headers )
|
99
|
-
|
100
42
|
# @excel.autosize if(options[:autosize])
|
101
|
-
|
102
|
-
@excel.write( filename() )
|
103
|
-
end
|
104
|
-
|
105
|
-
private
|
106
|
-
|
107
|
-
# Take options and create a list of symbols to remove from headers
|
108
|
-
#
|
109
|
-
def prep_remove_list( options )
|
110
|
-
@remove_list = [ *options[:remove] ].compact.collect{|x| x.to_s.downcase.to_sym }
|
111
|
-
|
112
|
-
@remove_list += GeneratorBase::rails_columns if(options[:remove_rails])
|
113
|
-
end
|
114
|
-
|
115
|
-
|
116
|
-
def prepare_excel(klass, options = {})
|
117
|
-
@filename = options[:filename] if options[:filename]
|
118
|
-
|
119
|
-
logger.info("ExcelGenerator creating template with associations for class #{klass}")
|
120
|
-
|
121
|
-
@excel = Excel.new()
|
122
43
|
|
123
|
-
|
124
|
-
|
125
|
-
sheet = @excel.create_worksheet( :name => name )
|
126
|
-
|
127
|
-
unless sheet
|
128
|
-
logger.error("Excel failed to create WorkSheet for #{name}")
|
129
|
-
|
130
|
-
raise "Failed to create Excel WorkSheet for #{name}"
|
131
|
-
end
|
132
|
-
|
133
|
-
MethodDictionary.find_operators( klass )
|
44
|
+
@excel.write( @file_name )
|
134
45
|
end
|
46
|
+
|
135
47
|
end # ExcelGenerator
|
136
|
-
|
137
|
-
end # DataShift
|
48
|
+
|
49
|
+
end # DataShift
|