datashift 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. data/.document +5 -5
  2. data/Gemfile +28 -25
  3. data/LICENSE.txt +26 -26
  4. data/README.markdown +302 -285
  5. data/README.rdoc +19 -19
  6. data/Rakefile +93 -95
  7. data/VERSION +5 -5
  8. data/datashift.gemspec +162 -178
  9. data/lib/applications/jruby/jexcel_file.rb +396 -396
  10. data/lib/applications/jruby/word.rb +79 -79
  11. data/lib/datashift.rb +152 -113
  12. data/lib/datashift/exceptions.rb +11 -11
  13. data/lib/datashift/file_definitions.rb +353 -353
  14. data/lib/datashift/mapping_file_definitions.rb +87 -87
  15. data/lib/datashift/method_detail.rb +236 -236
  16. data/lib/datashift/method_mapper.rb +256 -256
  17. data/lib/generators/csv_generator.rb +36 -36
  18. data/lib/generators/excel_generator.rb +121 -121
  19. data/lib/generators/generator_base.rb +13 -13
  20. data/lib/helpers/core_ext/to_b.rb +24 -24
  21. data/lib/helpers/spree_helper.rb +131 -131
  22. data/lib/java/poi-3.7/LICENSE +507 -507
  23. data/lib/java/poi-3.7/NOTICE +21 -21
  24. data/lib/java/poi-3.7/RELEASE_NOTES.txt +115 -115
  25. data/lib/loaders/csv_loader.rb +98 -98
  26. data/lib/loaders/excel_loader.rb +154 -149
  27. data/lib/loaders/loader_base.rb +403 -331
  28. data/lib/loaders/spreadsheet_loader.rb +136 -136
  29. data/lib/loaders/spree/image_loader.rb +45 -45
  30. data/lib/loaders/spree/product_loader.rb +224 -224
  31. data/spec/csv_loader_spec.rb +30 -30
  32. data/spec/datashift_spec.rb +26 -26
  33. data/spec/db/migrate/20110803201325_create_test_bed.rb +85 -85
  34. data/spec/excel_generator_spec.rb +78 -78
  35. data/spec/excel_loader_spec.rb +204 -176
  36. data/spec/file_definitions.rb +141 -141
  37. data/spec/fixtures/.~lock.ProjectsSingleCategories.xls# +1 -0
  38. data/spec/fixtures/ProjectsDefaults.yml +29 -0
  39. data/spec/fixtures/config/database.yml +24 -24
  40. data/spec/fixtures/interact_models_db.sqlite +0 -0
  41. data/spec/fixtures/interact_spree_db.sqlite +0 -0
  42. data/spec/fixtures/negative/SpreeProdMiss1Mandatory.csv +4 -4
  43. data/spec/fixtures/negative/SpreeProdMissManyMandatory.csv +4 -4
  44. data/spec/fixtures/spree/SpreeProducts.csv +4 -4
  45. data/spec/fixtures/spree/SpreeProductsMultiColumn.csv +4 -4
  46. data/spec/fixtures/spree/SpreeProductsSimple.csv +4 -4
  47. data/spec/fixtures/spree/SpreeZoneExample.csv +5 -5
  48. data/spec/fixtures/test_model_defs.rb +57 -57
  49. data/spec/loader_spec.rb +120 -120
  50. data/spec/method_mapper_spec.rb +237 -237
  51. data/spec/spec_helper.rb +115 -115
  52. data/spec/spree_generator_spec.rb +64 -64
  53. data/spec/spree_loader_spec.rb +310 -310
  54. data/spec/spree_method_mapping_spec.rb +214 -214
  55. data/tasks/config/seed_fu_product_template.erb +15 -15
  56. data/tasks/config/tidy_config.txt +12 -12
  57. data/tasks/db_tasks.rake +65 -64
  58. data/tasks/excel_generator.rake +78 -78
  59. data/tasks/file_tasks.rake +36 -36
  60. data/tasks/import/csv.rake +49 -49
  61. data/tasks/import/excel.rake +71 -66
  62. data/tasks/spree/image_load.rake +108 -108
  63. data/tasks/spree/product_loader.rake +43 -43
  64. data/tasks/word_to_seedfu.rake +166 -166
  65. data/test/helper.rb +18 -18
  66. data/test/test_interact.rb +7 -7
  67. metadata +7 -38
  68. data/Gemfile.lock +0 -211
  69. data/bin/autospec +0 -16
  70. data/bin/convert_to_should_syntax +0 -16
  71. data/bin/erubis +0 -16
  72. data/bin/htmldiff +0 -16
  73. data/bin/jeweler +0 -16
  74. data/bin/ldiff +0 -16
  75. data/bin/nokogiri +0 -16
  76. data/bin/rackup +0 -16
  77. data/bin/rails +0 -16
  78. data/bin/rake +0 -16
  79. data/bin/rake2thor +0 -16
  80. data/bin/ri +0 -16
  81. data/bin/rspec +0 -16
  82. data/bin/spree +0 -16
  83. data/bin/thor +0 -16
  84. data/bin/tilt +0 -16
  85. data/bin/tt +0 -16
data/test/helper.rb CHANGED
@@ -1,18 +1,18 @@
1
- require 'rubygems'
2
- require 'bundler'
3
- begin
4
- Bundler.setup(:default, :development)
5
- rescue Bundler::BundlerError => e
6
- $stderr.puts e.message
7
- $stderr.puts "Run `bundle install` to install missing gems"
8
- exit e.status_code
9
- end
10
- require 'test/unit'
11
- require 'shoulda'
12
-
13
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
- $LOAD_PATH.unshift(File.dirname(__FILE__))
15
- require 'DataShift'
16
-
17
- class Test::Unit::TestCase
18
- end
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ begin
4
+ Bundler.setup(:default, :development)
5
+ rescue Bundler::BundlerError => e
6
+ $stderr.puts e.message
7
+ $stderr.puts "Run `bundle install` to install missing gems"
8
+ exit e.status_code
9
+ end
10
+ require 'test/unit'
11
+ require 'shoulda'
12
+
13
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
15
+ require 'DataShift'
16
+
17
+ class Test::Unit::TestCase
18
+ end
@@ -1,7 +1,7 @@
1
- require 'helper'
2
-
3
- class TestDataShift < Test::Unit::TestCase
4
- should "probably rename this file and start testing for real" do
5
- flunk "hey buddy, you should probably rename this file and start testing for real"
6
- end
7
- end
1
+ require 'helper'
2
+
3
+ class TestDataShift < Test::Unit::TestCase
4
+ should "probably rename this file and start testing for real" do
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: datashift
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1
5
+ version: 0.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Thomas Statter
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-02-02 00:00:00 Z
13
+ date: 2012-02-12 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -135,24 +135,8 @@ dependencies:
135
135
  type: :development
136
136
  description: A suite of tools to move data between ActiveRecord models,databases,applications like Excel/Open Office, files and projects including Spree
137
137
  email: rubygems@autotelik.co.uk
138
- executables:
139
- - autospec
140
- - convert_to_should_syntax
141
- - erubis
142
- - htmldiff
143
- - jeweler
144
- - ldiff
145
- - nokogiri
146
- - rackup
147
- - rails
148
- - rake
149
- - rake2thor
150
- - ri
151
- - rspec
152
- - spree
153
- - thor
154
- - tilt
155
- - tt
138
+ executables: []
139
+
156
140
  extensions: []
157
141
 
158
142
  extra_rdoc_files:
@@ -162,29 +146,12 @@ extra_rdoc_files:
162
146
  files:
163
147
  - .document
164
148
  - Gemfile
165
- - Gemfile.lock
166
149
  - LICENSE.txt
167
150
  - README.markdown
168
151
  - README.rdoc
169
152
  - Rakefile
170
153
  - VERSION
171
- - bin/autospec
172
- - bin/convert_to_should_syntax
173
- - bin/erubis
174
- - bin/htmldiff
175
- - bin/jeweler
176
- - bin/ldiff
177
- - bin/nokogiri
178
- - bin/rackup
179
- - bin/rails
180
- - bin/rake
181
- - bin/rake2thor
182
- - bin/ri
183
- - bin/rspec
184
- - bin/spree
185
- - bin/thor
186
- - bin/tilt
187
- - bin/tt
154
+ - datashift-0.0.2.gem
188
155
  - datashift.gemspec
189
156
  - lib/applications/jruby/jexcel_file.rb
190
157
  - lib/applications/jruby/word.rb
@@ -226,8 +193,10 @@ files:
226
193
  - spec/excel_generator_spec.rb
227
194
  - spec/excel_loader_spec.rb
228
195
  - spec/file_definitions.rb
196
+ - spec/fixtures/.~lock.ProjectsSingleCategories.xls#
229
197
  - spec/fixtures/BadAssociationName.xls
230
198
  - spec/fixtures/DemoNegativeTesting.xls
199
+ - spec/fixtures/ProjectsDefaults.yml
231
200
  - spec/fixtures/ProjectsMultiCategories.xls
232
201
  - spec/fixtures/ProjectsSingleCategories.xls
233
202
  - spec/fixtures/SimpleProjects.xls
data/Gemfile.lock DELETED
@@ -1,211 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- actionmailer (3.1.3)
5
- actionpack (= 3.1.3)
6
- mail (~> 2.3.0)
7
- actionpack (3.1.3)
8
- activemodel (= 3.1.3)
9
- activesupport (= 3.1.3)
10
- builder (~> 3.0.0)
11
- erubis (~> 2.7.0)
12
- i18n (~> 0.6)
13
- rack (~> 1.3.5)
14
- rack-cache (~> 1.1)
15
- rack-mount (~> 0.8.2)
16
- rack-test (~> 0.6.1)
17
- sprockets (~> 2.0.3)
18
- activemerchant (1.17.0)
19
- activesupport (>= 2.3.11)
20
- braintree (>= 2.0.0)
21
- builder (>= 2.0.0)
22
- json (>= 1.5.1)
23
- activemodel (3.1.3)
24
- activesupport (= 3.1.3)
25
- builder (~> 3.0.0)
26
- i18n (~> 0.6)
27
- activerecord (3.1.3)
28
- activemodel (= 3.1.3)
29
- activesupport (= 3.1.3)
30
- arel (~> 2.2.1)
31
- tzinfo (~> 0.3.29)
32
- activerecord-jdbc-adapter (1.2.2)
33
- activerecord-jdbcsqlite3-adapter (1.2.2)
34
- activerecord-jdbc-adapter (~> 1.2.2)
35
- jdbc-sqlite3 (~> 3.7.2)
36
- activeresource (3.1.3)
37
- activemodel (= 3.1.3)
38
- activesupport (= 3.1.3)
39
- activesupport (3.1.3)
40
- multi_json (~> 1.0)
41
- acts_as_list (0.1.4)
42
- arel (2.2.1)
43
- bcrypt-ruby (3.0.1-java)
44
- bouncy-castle-java (1.5.0146.1)
45
- braintree (2.13.3)
46
- builder (>= 2.0.0)
47
- builder (3.0.0)
48
- cancan (1.6.5)
49
- cocaine (0.2.1)
50
- deface (0.7.2)
51
- nokogiri (~> 1.5.0)
52
- rails (>= 3.0.9)
53
- devise (1.4.7)
54
- bcrypt-ruby (~> 3.0)
55
- orm_adapter (~> 0.0.3)
56
- warden (~> 1.0.3)
57
- diff-lcs (1.1.3)
58
- erubis (2.7.0)
59
- faker (1.0.0)
60
- i18n (~> 0.4)
61
- git (1.2.5)
62
- highline (1.6.2)
63
- hike (1.2.1)
64
- i18n (0.6.0)
65
- jdbc-sqlite3 (3.7.2)
66
- jeweler (1.8.3)
67
- bundler (~> 1.0)
68
- git (>= 1.2.5)
69
- rake
70
- rdoc
71
- jquery-rails (1.0.19)
72
- railties (~> 3.0)
73
- thor (~> 0.14)
74
- jruby-openssl (0.7.5)
75
- bouncy-castle-java (>= 1.5.0146.1)
76
- json (1.6.5-java)
77
- kaminari (0.13.0)
78
- actionpack (>= 3.0.0)
79
- activesupport (>= 3.0.0)
80
- railties (>= 3.0.0)
81
- mail (2.3.0)
82
- i18n (>= 0.4.0)
83
- mime-types (~> 1.16)
84
- treetop (~> 1.4.8)
85
- meta_search (1.1.1)
86
- actionpack (~> 3.1.0)
87
- activerecord (~> 3.1.0)
88
- activesupport (~> 3.1.0)
89
- polyamorous (~> 0.5.0)
90
- mime-types (1.17.2)
91
- multi_json (1.0.4)
92
- nested_set (1.6.8)
93
- activerecord (>= 3.0.0)
94
- railties (>= 3.0.0)
95
- nokogiri (1.5.0-java)
96
- orm_adapter (0.0.6)
97
- paperclip (2.4.1)
98
- activerecord (>= 2.3.0)
99
- activesupport (>= 2.3.2)
100
- cocaine (>= 0.0.2)
101
- mime-types
102
- polyamorous (0.5.0)
103
- activerecord (~> 3.0)
104
- polyglot (0.3.3)
105
- rack (1.3.6)
106
- rack-cache (1.1)
107
- rack (>= 0.4)
108
- rack-mount (0.8.3)
109
- rack (>= 1.0.0)
110
- rack-ssl (1.3.2)
111
- rack
112
- rack-test (0.6.1)
113
- rack (>= 1.0)
114
- rails (3.1.3)
115
- actionmailer (= 3.1.3)
116
- actionpack (= 3.1.3)
117
- activerecord (= 3.1.3)
118
- activeresource (= 3.1.3)
119
- activesupport (= 3.1.3)
120
- bundler (~> 1.0)
121
- railties (= 3.1.3)
122
- railties (3.1.3)
123
- actionpack (= 3.1.3)
124
- activesupport (= 3.1.3)
125
- rack-ssl (~> 1.3.2)
126
- rake (>= 0.8.7)
127
- rdoc (~> 3.4)
128
- thor (~> 0.14.6)
129
- rake (0.9.2.2)
130
- rd_find_by_param (0.1.1)
131
- activerecord (~> 3.0)
132
- activesupport (~> 3.0)
133
- rd_resource_controller (1.0.1)
134
- rdoc (3.12)
135
- json (~> 1.4)
136
- rspec (2.8.0)
137
- rspec-core (~> 2.8.0)
138
- rspec-expectations (~> 2.8.0)
139
- rspec-mocks (~> 2.8.0)
140
- rspec-core (2.8.0)
141
- rspec-expectations (2.8.0)
142
- diff-lcs (~> 1.1.2)
143
- rspec-mocks (2.8.0)
144
- shoulda (2.11.3)
145
- spree (0.70.3)
146
- spree_api (= 0.70.3)
147
- spree_auth (= 0.70.3)
148
- spree_core (= 0.70.3)
149
- spree_dash (= 0.70.3)
150
- spree_promo (= 0.70.3)
151
- spree_sample (= 0.70.3)
152
- spree_api (0.70.3)
153
- spree_auth (= 0.70.3)
154
- spree_core (= 0.70.3)
155
- spree_auth (0.70.3)
156
- cancan (= 1.6.5)
157
- devise (= 1.4.7)
158
- spree_core (= 0.70.3)
159
- spree_core (0.70.3)
160
- activemerchant (= 1.17.0)
161
- acts_as_list (= 0.1.4)
162
- deface (>= 0.7.0)
163
- faker (= 1.0.0)
164
- highline (= 1.6.2)
165
- jquery-rails (>= 1.0.14)
166
- kaminari (>= 0.12.4)
167
- meta_search (= 1.1.1)
168
- nested_set (= 1.6.8)
169
- paperclip (= 2.4.1)
170
- rails (>= 3.1.1, <= 3.1.3)
171
- rd_find_by_param (= 0.1.1)
172
- rd_resource_controller
173
- state_machine (= 1.0.1)
174
- stringex (= 1.0.3)
175
- spree_dash (0.70.3)
176
- spree_core (= 0.70.3)
177
- spree_promo (0.70.3)
178
- spree_auth (= 0.70.3)
179
- spree_core (= 0.70.3)
180
- spree_sample (0.70.3)
181
- spree_core (= 0.70.3)
182
- sprockets (2.0.3)
183
- hike (~> 1.2)
184
- rack (~> 1.0)
185
- tilt (~> 1.1, != 1.3.0)
186
- state_machine (1.0.1)
187
- stringex (1.0.3)
188
- thor (0.14.6)
189
- tilt (1.3.3)
190
- treetop (1.4.10)
191
- polyglot
192
- polyglot (>= 0.3.1)
193
- tzinfo (0.3.31)
194
- warden (1.0.6)
195
- rack (>= 1.0)
196
-
197
- PLATFORMS
198
- java
199
-
200
- DEPENDENCIES
201
- activerecord (= 3.1.3)
202
- activerecord-jdbcsqlite3-adapter
203
- activesupport (= 3.1.3)
204
- bundler (~> 1.0.0)
205
- jeweler (~> 1.8.3)
206
- jruby-openssl
207
- rails (= 3.1.3)
208
- rdoc (~> 3.12)
209
- rspec
210
- shoulda
211
- spree (= 0.70.3)
data/bin/autospec DELETED
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env jruby
2
- #
3
- # This file was generated by Bundler.
4
- #
5
- # The application 'autospec' is installed as part of a gem, and
6
- # this file is here to facilitate running it.
7
- #
8
-
9
- require 'pathname'
10
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
- Pathname.new(__FILE__).realpath)
12
-
13
- require 'rubygems'
14
- require 'bundler/setup'
15
-
16
- load Gem.bin_path('rspec-core', 'autospec')
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env jruby
2
- #
3
- # This file was generated by Bundler.
4
- #
5
- # The application 'convert_to_should_syntax' is installed as part of a gem, and
6
- # this file is here to facilitate running it.
7
- #
8
-
9
- require 'pathname'
10
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
- Pathname.new(__FILE__).realpath)
12
-
13
- require 'rubygems'
14
- require 'bundler/setup'
15
-
16
- load Gem.bin_path('shoulda', 'convert_to_should_syntax')
data/bin/erubis DELETED
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env jruby
2
- #
3
- # This file was generated by Bundler.
4
- #
5
- # The application 'erubis' is installed as part of a gem, and
6
- # this file is here to facilitate running it.
7
- #
8
-
9
- require 'pathname'
10
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
- Pathname.new(__FILE__).realpath)
12
-
13
- require 'rubygems'
14
- require 'bundler/setup'
15
-
16
- load Gem.bin_path('erubis', 'erubis')
data/bin/htmldiff DELETED
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env jruby
2
- #
3
- # This file was generated by Bundler.
4
- #
5
- # The application 'htmldiff' is installed as part of a gem, and
6
- # this file is here to facilitate running it.
7
- #
8
-
9
- require 'pathname'
10
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
- Pathname.new(__FILE__).realpath)
12
-
13
- require 'rubygems'
14
- require 'bundler/setup'
15
-
16
- load Gem.bin_path('diff-lcs', 'htmldiff')
data/bin/jeweler DELETED
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env jruby
2
- #
3
- # This file was generated by Bundler.
4
- #
5
- # The application 'jeweler' is installed as part of a gem, and
6
- # this file is here to facilitate running it.
7
- #
8
-
9
- require 'pathname'
10
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
- Pathname.new(__FILE__).realpath)
12
-
13
- require 'rubygems'
14
- require 'bundler/setup'
15
-
16
- load Gem.bin_path('jeweler', 'jeweler')
data/bin/ldiff DELETED
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env jruby
2
- #
3
- # This file was generated by Bundler.
4
- #
5
- # The application 'ldiff' is installed as part of a gem, and
6
- # this file is here to facilitate running it.
7
- #
8
-
9
- require 'pathname'
10
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
- Pathname.new(__FILE__).realpath)
12
-
13
- require 'rubygems'
14
- require 'bundler/setup'
15
-
16
- load Gem.bin_path('diff-lcs', 'ldiff')