datashift 0.11.1 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. data/Rakefile +3 -2
  2. data/VERSION +1 -1
  3. data/datashift.gemspec +11 -174
  4. data/lib/datashift/column_packer.rb +64 -0
  5. data/lib/datashift/delimiters.rb +17 -1
  6. data/lib/datashift/exceptions.rb +7 -0
  7. data/lib/datashift/querying.rb +10 -4
  8. data/lib/loaders/csv_loader.rb +69 -32
  9. data/lib/loaders/excel_loader.rb +86 -53
  10. data/lib/loaders/loader_base.rb +32 -18
  11. data/lib/loaders/paperclip/attachment_loader.rb +11 -8
  12. data/lib/loaders/paperclip/datashift_paperclip.rb +21 -18
  13. data/lib/loaders/reporter.rb +48 -0
  14. data/spec/Gemfile.lock +129 -0
  15. data/spec/csv_exporter_spec.rb +1 -1
  16. metadata +121 -191
  17. data/.document +0 -5
  18. data/lib/java/poi-3.7/._poi-3.7-20101029.jar5645100390082102460.tmp +0 -0
  19. data/spec/MissingAttachmentRecords/DEMO_001_ror_bag.jpeg +0 -0
  20. data/spec/MissingAttachmentRecords/DEMO_002_Powerstation.jpeg +0 -0
  21. data/spec/MissingAttachmentRecords/DEMO_002_Powerstation.jpg +0 -0
  22. data/spec/MissingAttachmentRecords/DEMO_003_ror_mug.jpeg +0 -0
  23. data/spec/MissingAttachmentRecords/DEMO_004_ror_ringer.jpeg +0 -0
  24. data/spec/fixtures/BadAssociationName.xls +0 -0
  25. data/spec/fixtures/DemoNegativeTesting.xls +0 -0
  26. data/spec/fixtures/ProjectsDefaults.yml +0 -29
  27. data/spec/fixtures/ProjectsMultiCategories.xls +0 -0
  28. data/spec/fixtures/ProjectsMultiCategoriesHeaderLookup.xls +0 -0
  29. data/spec/fixtures/ProjectsSingleCategories.xls +0 -0
  30. data/spec/fixtures/SimpleProjects.xls +0 -0
  31. data/spec/fixtures/config/database.yml +0 -28
  32. data/spec/fixtures/db/datashift_test_models_db.sqlite +0 -0
  33. data/spec/fixtures/db/migrate/20110803201325_create_test_bed.rb +0 -96
  34. data/spec/fixtures/db/migrate/20121009161700_add_digitals.rb +0 -24
  35. data/spec/fixtures/images/DEMO_001_ror_bag.jpeg +0 -0
  36. data/spec/fixtures/images/DEMO_002_Powerstation.jpeg +0 -0
  37. data/spec/fixtures/images/DEMO_003_ror_mug.jpeg +0 -0
  38. data/spec/fixtures/images/DEMO_004_ror_ringer.jpeg +0 -0
  39. data/spec/fixtures/load_datashift.thor +0 -3
  40. data/spec/fixtures/models/category.rb +0 -7
  41. data/spec/fixtures/models/digital.rb +0 -14
  42. data/spec/fixtures/models/empty.rb +0 -2
  43. data/spec/fixtures/models/loader_release.rb +0 -10
  44. data/spec/fixtures/models/long_and_complex_table_linked_to_version.rb +0 -6
  45. data/spec/fixtures/models/milestone.rb +0 -8
  46. data/spec/fixtures/models/owner.rb +0 -7
  47. data/spec/fixtures/models/project.rb +0 -26
  48. data/spec/fixtures/models/version.rb +0 -7
  49. data/spec/fixtures/simple_export_spec.xls +0 -0
  50. data/spec/fixtures/simple_template_spec.xls +0 -0
  51. data/spec/fixtures/test_model_defs.rb +0 -9
  52. data/spec/rails_sandbox/.gitignore +0 -15
  53. data/spec/rails_sandbox/Gemfile +0 -40
  54. data/spec/rails_sandbox/README.rdoc +0 -261
  55. data/spec/rails_sandbox/Rakefile +0 -7
  56. data/spec/rails_sandbox/app/assets/images/rails.png +0 -0
  57. data/spec/rails_sandbox/app/assets/javascripts/application.js +0 -15
  58. data/spec/rails_sandbox/app/assets/stylesheets/application.css +0 -13
  59. data/spec/rails_sandbox/app/controllers/application_controller.rb +0 -3
  60. data/spec/rails_sandbox/app/helpers/application_helper.rb +0 -2
  61. data/spec/rails_sandbox/app/mailers/.gitkeep +0 -0
  62. data/spec/rails_sandbox/app/models/.gitkeep +0 -0
  63. data/spec/rails_sandbox/app/models/category.rb +0 -7
  64. data/spec/rails_sandbox/app/models/empty.rb +0 -2
  65. data/spec/rails_sandbox/app/models/loader_release.rb +0 -10
  66. data/spec/rails_sandbox/app/models/long_and_complex_table_linked_to_version.rb +0 -6
  67. data/spec/rails_sandbox/app/models/milestone.rb +0 -8
  68. data/spec/rails_sandbox/app/models/owner.rb +0 -5
  69. data/spec/rails_sandbox/app/models/project.rb +0 -26
  70. data/spec/rails_sandbox/app/models/test_model_defs.rb +0 -67
  71. data/spec/rails_sandbox/app/models/version.rb +0 -7
  72. data/spec/rails_sandbox/app/views/layouts/application.html.erb +0 -14
  73. data/spec/rails_sandbox/config.ru +0 -4
  74. data/spec/rails_sandbox/config/application.rb +0 -62
  75. data/spec/rails_sandbox/config/boot.rb +0 -6
  76. data/spec/rails_sandbox/config/database.yml +0 -20
  77. data/spec/rails_sandbox/config/environment.rb +0 -5
  78. data/spec/rails_sandbox/config/environments/development.rb +0 -37
  79. data/spec/rails_sandbox/config/environments/production.rb +0 -67
  80. data/spec/rails_sandbox/config/environments/test.rb +0 -37
  81. data/spec/rails_sandbox/config/initializers/backtrace_silencers.rb +0 -7
  82. data/spec/rails_sandbox/config/initializers/inflections.rb +0 -15
  83. data/spec/rails_sandbox/config/initializers/mime_types.rb +0 -5
  84. data/spec/rails_sandbox/config/initializers/secret_token.rb +0 -7
  85. data/spec/rails_sandbox/config/initializers/session_store.rb +0 -8
  86. data/spec/rails_sandbox/config/initializers/wrap_parameters.rb +0 -14
  87. data/spec/rails_sandbox/config/locales/en.yml +0 -5
  88. data/spec/rails_sandbox/config/routes.rb +0 -58
  89. data/spec/rails_sandbox/db/migrate/20110803201325_create_test_bed.rb +0 -96
  90. data/spec/rails_sandbox/db/schema.rb +0 -81
  91. data/spec/rails_sandbox/db/seeds.rb +0 -7
  92. data/spec/rails_sandbox/lib/assets/.gitkeep +0 -0
  93. data/spec/rails_sandbox/lib/tasks/.gitkeep +0 -0
  94. data/spec/rails_sandbox/log/.gitkeep +0 -0
  95. data/spec/rails_sandbox/public/404.html +0 -26
  96. data/spec/rails_sandbox/public/422.html +0 -26
  97. data/spec/rails_sandbox/public/500.html +0 -25
  98. data/spec/rails_sandbox/public/favicon.ico +0 -0
  99. data/spec/rails_sandbox/public/index.html +0 -241
  100. data/spec/rails_sandbox/public/robots.txt +0 -5
  101. data/spec/rails_sandbox/script/rails +0 -6
  102. data/spec/rails_sandbox/test/fixtures/.gitkeep +0 -0
  103. data/spec/rails_sandbox/test/functional/.gitkeep +0 -0
  104. data/spec/rails_sandbox/test/integration/.gitkeep +0 -0
  105. data/spec/rails_sandbox/test/performance/browsing_test.rb +0 -12
  106. data/spec/rails_sandbox/test/test_helper.rb +0 -13
  107. data/spec/rails_sandbox/test/unit/.gitkeep +0 -0
  108. data/spec/rails_sandbox/vendor/assets/javascripts/.gitkeep +0 -0
  109. data/spec/rails_sandbox/vendor/assets/stylesheets/.gitkeep +0 -0
  110. data/spec/rails_sandbox/vendor/plugins/.gitkeep +0 -0
@@ -1,37 +0,0 @@
1
- RailsSandbox::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
3
-
4
- # The test environment is used exclusively to run your application's
5
- # test suite. You never need to work with it otherwise. Remember that
6
- # your test database is "scratch space" for the test suite and is wiped
7
- # and recreated between test runs. Don't rely on the data there!
8
- config.cache_classes = true
9
-
10
- # Configure static asset server for tests with Cache-Control for performance
11
- config.serve_static_assets = true
12
- config.static_cache_control = "public, max-age=3600"
13
-
14
- # Log error messages when you accidentally call methods on nil
15
- config.whiny_nils = true
16
-
17
- # Show full error reports and disable caching
18
- config.consider_all_requests_local = true
19
- config.action_controller.perform_caching = false
20
-
21
- # Raise exceptions instead of rendering exception templates
22
- config.action_dispatch.show_exceptions = false
23
-
24
- # Disable request forgery protection in test environment
25
- config.action_controller.allow_forgery_protection = false
26
-
27
- # Tell Action Mailer not to deliver emails to the real world.
28
- # The :test delivery method accumulates sent emails in the
29
- # ActionMailer::Base.deliveries array.
30
- config.action_mailer.delivery_method = :test
31
-
32
- # Raise exception on mass assignment protection for Active Record models
33
- config.active_record.mass_assignment_sanitizer = :strict
34
-
35
- # Print deprecation notices to the stderr
36
- config.active_support.deprecation = :stderr
37
- end
@@ -1,7 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
- # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
-
6
- # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
- # Rails.backtrace_cleaner.remove_silencers!
@@ -1,15 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new inflection rules using the following format
4
- # (all these examples are active by default):
5
- # ActiveSupport::Inflector.inflections do |inflect|
6
- # inflect.plural /^(ox)$/i, '\1en'
7
- # inflect.singular /^(ox)en/i, '\1'
8
- # inflect.irregular 'person', 'people'
9
- # inflect.uncountable %w( fish sheep )
10
- # end
11
- #
12
- # These inflection rules are supported but not enabled by default:
13
- # ActiveSupport::Inflector.inflections do |inflect|
14
- # inflect.acronym 'RESTful'
15
- # end
@@ -1,5 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new mime types for use in respond_to blocks:
4
- # Mime::Type.register "text/richtext", :rtf
5
- # Mime::Type.register_alias "text/html", :iphone
@@ -1,7 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Your secret key for verifying the integrity of signed cookies.
4
- # If you change this key, all old signed cookies will become invalid!
5
- # Make sure the secret is at least 30 characters and all random,
6
- # no regular words or you'll be exposed to dictionary attacks.
7
- RailsSandbox::Application.config.secret_token = 'bc81bba57897b8111a904e90e2c9a4496ace0aec351e757b067046df47af5f35df855f7e6ebdf5b6598c587f8096cc27e86950cc57a21d7a40732d657327953e'
@@ -1,8 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- RailsSandbox::Application.config.session_store :cookie_store, :key => '_rails_sandbox_session'
4
-
5
- # Use the database for sessions instead of the cookie-based default,
6
- # which shouldn't be used to store highly confidential information
7
- # (create the session table with "rails generate session_migration")
8
- # RailsSandbox::Application.config.session_store :active_record_store
@@ -1,14 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
- #
3
- # This file contains settings for ActionController::ParamsWrapper which
4
- # is enabled by default.
5
-
6
- # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
- ActiveSupport.on_load(:action_controller) do
8
- wrap_parameters :format => [:json]
9
- end
10
-
11
- # Disable root element in JSON by default.
12
- ActiveSupport.on_load(:active_record) do
13
- self.include_root_in_json = false
14
- end
@@ -1,5 +0,0 @@
1
- # Sample localization file for English. Add more files in this directory for other locales.
2
- # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
-
4
- en:
5
- hello: "Hello world"
@@ -1,58 +0,0 @@
1
- RailsSandbox::Application.routes.draw do
2
- # The priority is based upon order of creation:
3
- # first created -> highest priority.
4
-
5
- # Sample of regular route:
6
- # match 'products/:id' => 'catalog#view'
7
- # Keep in mind you can assign values other than :controller and :action
8
-
9
- # Sample of named route:
10
- # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
11
- # This route can be invoked with purchase_url(:id => product.id)
12
-
13
- # Sample resource route (maps HTTP verbs to controller actions automatically):
14
- # resources :products
15
-
16
- # Sample resource route with options:
17
- # resources :products do
18
- # member do
19
- # get 'short'
20
- # post 'toggle'
21
- # end
22
- #
23
- # collection do
24
- # get 'sold'
25
- # end
26
- # end
27
-
28
- # Sample resource route with sub-resources:
29
- # resources :products do
30
- # resources :comments, :sales
31
- # resource :seller
32
- # end
33
-
34
- # Sample resource route with more complex sub-resources
35
- # resources :products do
36
- # resources :comments
37
- # resources :sales do
38
- # get 'recent', :on => :collection
39
- # end
40
- # end
41
-
42
- # Sample resource route within a namespace:
43
- # namespace :admin do
44
- # # Directs /admin/products/* to Admin::ProductsController
45
- # # (app/controllers/admin/products_controller.rb)
46
- # resources :products
47
- # end
48
-
49
- # You can have the root of your site routed with "root"
50
- # just remember to delete public/index.html.
51
- # root :to => 'welcome#index'
52
-
53
- # See how all your routes lay out with "rake routes"
54
-
55
- # This is a legacy wild controller route that's not recommended for RESTful applications.
56
- # Note: This route will make all actions in every controller accessible via GET requests.
57
- # match ':controller(/:action(/:id))(.:format)'
58
- end
@@ -1,96 +0,0 @@
1
- # Author :: Tom Statter
2
- # Date :: Aug 2011
3
- # License:: MIT
4
- #
5
- # Details:: Migration to create a test database that exercises all aspects of Active Record models
6
- #
7
-
8
- class CreateTestBed < ActiveRecord::Migration
9
-
10
- def self.up
11
-
12
- create_table :users do |t|
13
- t.string :title
14
- t.string :first_name
15
- end
16
-
17
- # belongs_to :user
18
- # has many :milestones
19
- #
20
- create_table :projects do |t|
21
- t.string :title
22
- t.string :value_as_string
23
- t.text :value_as_text
24
- t.boolean :value_as_boolean, :default => false
25
- t.datetime :value_as_datetime, :default => nil
26
- t.integer :value_as_integer, :default => 0
27
- t.decimal :value_as_double, :precision => 8, :scale => 2, :default => 0.0
28
- t.references :user
29
- t.timestamps
30
- end
31
-
32
- # belongs_to :project
33
- # @project => has_many :milestones
34
-
35
- create_table :milestones do |t|
36
- t.string :name
37
- t.datetime :datetime, :default => nil
38
- t.decimal :cost, :precision => 8, :scale => 2, :default => 0.0
39
- t.references :project
40
- t.timestamps
41
- end
42
-
43
- # belongs_to :project, project => has_one
44
- create_table :owners do |t|
45
- t.string :name
46
- t.references :project
47
- t.timestamps
48
- end
49
-
50
- # has_belongs_to_many :project
51
- create_table :categories do |t|
52
- t.string :reference
53
- t.timestamps
54
- end
55
-
56
- # testing has_belongs_to_many (hence no id)
57
- create_table :categories_projects, :id => false do |t|
58
- t.references :category
59
- t.references :project
60
- end
61
-
62
- create_table :versions do |t|
63
- t.string :name
64
- t.timestamps
65
- end
66
-
67
- # testing project has_many release + versions :through
68
- create_table :loader_releases do |t|
69
- t.string :name
70
- t.references :project
71
- t.references :version
72
- t.timestamps
73
- end
74
-
75
-
76
- create_table :long_and_complex_table_linked_to_versions do |t|
77
- t.references :version
78
- end
79
-
80
- create_table :empties do |t|
81
- end
82
-
83
- end
84
-
85
- def self.down
86
- drop_table :users
87
- drop_table :projects
88
- drop_table :categories
89
- drop_table :loader_releases
90
- drop_table :versions
91
- drop_table :categories_projectss
92
- drop_table :milestones
93
- drop_table :long_and_complex_table_linked_to_versions
94
- drop_table :empties
95
- end
96
- end
@@ -1,81 +0,0 @@
1
- # This file is auto-generated from the current state of the database. Instead
2
- # of editing this file, please use the migrations feature of Active Record to
3
- # incrementally modify your database, and then regenerate this schema definition.
4
- #
5
- # Note that this schema.rb definition is the authoritative source for your
6
- # database schema. If you need to create the application database on another
7
- # system, you should be using db:schema:load, not running all the migrations
8
- # from scratch. The latter is a flawed and unsustainable approach (the more migrations
9
- # you'll amass, the slower it'll run and the greater likelihood for issues).
10
- #
11
- # It's strongly recommended to check this file into your version control system.
12
-
13
- ActiveRecord::Schema.define(:version => 20110803201325) do
14
-
15
- create_table "categories", :force => true do |t|
16
- t.string "reference"
17
- t.datetime "created_at", :null => false
18
- t.datetime "updated_at", :null => false
19
- end
20
-
21
- create_table "categories_projects", :id => false, :force => true do |t|
22
- t.integer "category_id"
23
- t.integer "project_id"
24
- end
25
-
26
- create_table "empties", :force => true do |t|
27
- end
28
-
29
- create_table "loader_releases", :force => true do |t|
30
- t.string "name"
31
- t.integer "project_id"
32
- t.integer "version_id"
33
- t.datetime "created_at", :null => false
34
- t.datetime "updated_at", :null => false
35
- end
36
-
37
- create_table "long_and_complex_table_linked_to_versions", :force => true do |t|
38
- t.integer "version_id"
39
- end
40
-
41
- create_table "milestones", :force => true do |t|
42
- t.string "name"
43
- t.datetime "datetime"
44
- t.decimal "cost", :precision => 8, :scale => 2, :default => 0.0
45
- t.integer "project_id"
46
- t.datetime "created_at", :null => false
47
- t.datetime "updated_at", :null => false
48
- end
49
-
50
- create_table "owners", :force => true do |t|
51
- t.string "name"
52
- t.integer "project_id"
53
- t.datetime "created_at", :null => false
54
- t.datetime "updated_at", :null => false
55
- end
56
-
57
- create_table "projects", :force => true do |t|
58
- t.string "title"
59
- t.string "value_as_string"
60
- t.text "value_as_text"
61
- t.boolean "value_as_boolean", :default => false
62
- t.datetime "value_as_datetime"
63
- t.integer "value_as_integer", :default => 0
64
- t.decimal "value_as_double", :precision => 8, :scale => 2, :default => 0.0
65
- t.integer "user_id"
66
- t.datetime "created_at", :null => false
67
- t.datetime "updated_at", :null => false
68
- end
69
-
70
- create_table "users", :force => true do |t|
71
- t.string "title"
72
- t.string "first_name"
73
- end
74
-
75
- create_table "versions", :force => true do |t|
76
- t.string "name"
77
- t.datetime "created_at", :null => false
78
- t.datetime "updated_at", :null => false
79
- end
80
-
81
- end
@@ -1,7 +0,0 @@
1
- # This file should contain all the record creation needed to seed the database with its default values.
2
- # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
- #
4
- # Examples:
5
- #
6
- # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
7
- # Mayor.create(:name => 'Emanuel', :city => cities.first)
File without changes
File without changes
File without changes
@@ -1,26 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The page you were looking for doesn't exist (404)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/404.html -->
21
- <div class="dialog">
22
- <h1>The page you were looking for doesn't exist.</h1>
23
- <p>You may have mistyped the address or the page may have moved.</p>
24
- </div>
25
- </body>
26
- </html>
@@ -1,26 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The change you wanted was rejected (422)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/422.html -->
21
- <div class="dialog">
22
- <h1>The change you wanted was rejected.</h1>
23
- <p>Maybe you tried to change something you didn't have access to.</p>
24
- </div>
25
- </body>
26
- </html>
@@ -1,25 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>We're sorry, but something went wrong (500)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/500.html -->
21
- <div class="dialog">
22
- <h1>We're sorry, but something went wrong.</h1>
23
- </div>
24
- </body>
25
- </html>