bunto-import 2.0.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +21 -21
  3. data/README.markdown +33 -33
  4. data/lib/bunto-import.rb +49 -49
  5. data/lib/bunto-import/importer.rb +26 -26
  6. data/lib/bunto-import/importers.rb +10 -10
  7. data/lib/bunto-import/importers/behance.rb +80 -80
  8. data/lib/bunto-import/importers/blogger.rb +330 -264
  9. data/lib/bunto-import/importers/csv.rb +96 -96
  10. data/lib/bunto-import/importers/drupal6.rb +53 -139
  11. data/lib/bunto-import/importers/drupal7.rb +54 -111
  12. data/lib/bunto-import/importers/drupal_common.rb +157 -0
  13. data/lib/bunto-import/importers/easyblog.rb +96 -96
  14. data/lib/bunto-import/importers/enki.rb +74 -74
  15. data/lib/bunto-import/importers/ghost.rb +68 -68
  16. data/lib/bunto-import/importers/google_reader.rb +64 -64
  17. data/lib/bunto-import/importers/joomla.rb +92 -90
  18. data/lib/bunto-import/importers/joomla3.rb +91 -91
  19. data/lib/bunto-import/importers/jrnl.rb +125 -125
  20. data/lib/bunto-import/importers/marley.rb +72 -72
  21. data/lib/bunto-import/importers/mephisto.rb +99 -99
  22. data/lib/bunto-import/importers/mt.rb +257 -257
  23. data/lib/bunto-import/importers/posterous.rb +130 -130
  24. data/lib/bunto-import/importers/rss.rb +62 -62
  25. data/lib/bunto-import/importers/s9y.rb +60 -60
  26. data/lib/bunto-import/importers/s9y_database.rb +363 -0
  27. data/lib/bunto-import/importers/textpattern.rb +70 -70
  28. data/lib/bunto-import/importers/tumblr.rb +300 -289
  29. data/lib/bunto-import/importers/typo.rb +88 -88
  30. data/lib/bunto-import/importers/wordpress.rb +372 -372
  31. data/lib/bunto-import/importers/wordpressdotcom.rb +207 -207
  32. data/lib/bunto-import/util.rb +76 -76
  33. data/lib/bunto-import/version.rb +3 -3
  34. data/lib/bunto/commands/import.rb +79 -79
  35. metadata +84 -54
@@ -1,3 +1,3 @@
1
- module BuntoImport
2
- VERSION = '2.0.0'
3
- end
1
+ module BuntoImport
2
+ VERSION = '3.0.0'
3
+ end
@@ -1,79 +1,79 @@
1
- $:.unshift File.expand_path("../../", File.dirname(__FILE__)) # load from bunto-import/lib
2
- require 'bunto/command'
3
- require 'bunto-import'
4
-
5
- module Bunto
6
- module Commands
7
- class Import < Command
8
-
9
- IMPORTERS = {
10
- :blogger => 'Blogger',
11
- :behance => 'Behance',
12
- :csv => 'CSV',
13
- :drupal6 => 'Drupal6',
14
- :drupal7 => 'Drupal7',
15
- :enki => 'Enki',
16
- :joomla => 'Joomla',
17
- :joomla3 => 'Joomla3',
18
- :jrnl => 'Jrnl',
19
- :ghost => 'Ghost',
20
- :google_reader => 'GoogleReader',
21
- :marley => 'Marley',
22
- :mephisto => 'Mephisto',
23
- :mt => 'MT',
24
- :posterous => 'Posterous',
25
- :rss => 'RSS',
26
- :s9y => 'S9Y',
27
- :textpattern => 'TextPattern',
28
- :tumblr => 'Tumblr',
29
- :typo => 'Typo',
30
- :wordpress => 'WordPress',
31
- :wordpressdotcom => 'WordpressDotCom'
32
- }
33
-
34
- class << self
35
-
36
- def init_with_program(prog)
37
- prog.command(:import) do |c|
38
- c.syntax 'import <platform> [options]'
39
- c.description 'Import your old blog to Bunto'
40
- importers = BuntoImport.add_importer_commands(c)
41
-
42
- c.action do |args, options|
43
- if args.empty?
44
- Bunto.logger.warn "You must specify an importer."
45
- Bunto.logger.info "Valid options are:"
46
- importers.each { |i| Bunto.logger.info "*", "#{i}" }
47
- end
48
- end
49
- end
50
- end
51
-
52
- def process(migrator, options)
53
- migrator = migrator.to_s.downcase
54
-
55
- if IMPORTERS.keys.include?(migrator.to_sym)
56
- if BuntoImport::Importers.const_defined?(IMPORTERS[migrator.to_sym])
57
- klass = BuntoImport::Importers.const_get(IMPORTERS[migrator.to_sym])
58
- if options.respond_to?(:__hash__)
59
- klass.run(options.__hash__)
60
- else
61
- klass.run(options)
62
- end
63
- end
64
- else
65
- abort_on_invalid_migrator(migrator)
66
- end
67
- end
68
-
69
- def abort_on_invalid_migrator(migrator)
70
- $stderr.puts "Sorry, '#{migrator}' isn't a valid migrator. Valid choices:"
71
- IMPORTERS.keys.each { |k| $stderr.puts "* #{k}" }
72
- raise RuntimeError.new("'#{migrator}' is not a valid migrator.")
73
- end
74
-
75
- end
76
-
77
- end
78
- end
79
- end
1
+ $:.unshift File.expand_path("../../", File.dirname(__FILE__)) # load from bunto-import/lib
2
+ require 'bunto/command'
3
+ require 'bunto-import'
4
+
5
+ module Bunto
6
+ module Commands
7
+ class Import < Command
8
+
9
+ IMPORTERS = {
10
+ :blogger => 'Blogger',
11
+ :behance => 'Behance',
12
+ :csv => 'CSV',
13
+ :drupal6 => 'Drupal6',
14
+ :drupal7 => 'Drupal7',
15
+ :enki => 'Enki',
16
+ :joomla => 'Joomla',
17
+ :joomla3 => 'Joomla3',
18
+ :jrnl => 'Jrnl',
19
+ :ghost => 'Ghost',
20
+ :google_reader => 'GoogleReader',
21
+ :marley => 'Marley',
22
+ :mephisto => 'Mephisto',
23
+ :mt => 'MT',
24
+ :posterous => 'Posterous',
25
+ :rss => 'RSS',
26
+ :s9y => 'S9Y',
27
+ :textpattern => 'TextPattern',
28
+ :tumblr => 'Tumblr',
29
+ :typo => 'Typo',
30
+ :wordpress => 'WordPress',
31
+ :wordpressdotcom => 'WordpressDotCom'
32
+ }
33
+
34
+ class << self
35
+
36
+ def init_with_program(prog)
37
+ prog.command(:import) do |c|
38
+ c.syntax 'import <platform> [options]'
39
+ c.description 'Import your old blog to Bunto'
40
+ importers = BuntoImport.add_importer_commands(c)
41
+
42
+ c.action do |args, options|
43
+ if args.empty?
44
+ Bunto.logger.warn "You must specify an importer."
45
+ Bunto.logger.info "Valid options are:"
46
+ importers.each { |i| Bunto.logger.info "*", "#{i}" }
47
+ end
48
+ end
49
+ end
50
+ end
51
+
52
+ def process(migrator, options)
53
+ migrator = migrator.to_s.downcase
54
+
55
+ if IMPORTERS.keys.include?(migrator.to_sym)
56
+ if BuntoImport::Importers.const_defined?(IMPORTERS[migrator.to_sym])
57
+ klass = BuntoImport::Importers.const_get(IMPORTERS[migrator.to_sym])
58
+ if options.respond_to?(:__hash__)
59
+ klass.run(options.__hash__)
60
+ else
61
+ klass.run(options)
62
+ end
63
+ end
64
+ else
65
+ abort_on_invalid_migrator(migrator)
66
+ end
67
+ end
68
+
69
+ def abort_on_invalid_migrator(migrator)
70
+ $stderr.puts "Sorry, '#{migrator}' isn't a valid migrator. Valid choices:"
71
+ IMPORTERS.keys.each { |k| $stderr.puts "* #{k}" }
72
+ raise RuntimeError.new("'#{migrator}' is not a valid migrator.")
73
+ end
74
+
75
+ end
76
+
77
+ end
78
+ end
79
+ end
metadata CHANGED
@@ -1,305 +1,333 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bunto-import
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
8
8
  - Suriyaa Kudo
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-04-10 00:00:00.000000000 Z
12
+ date: 2016-08-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
+ name: bunto
15
16
  requirement: !ruby/object:Gem::Requirement
16
17
  requirements:
17
- - - "~>"
18
+ - - ">="
18
19
  - !ruby/object:Gem::Version
19
- version: '1.0'
20
- name: bunto
21
- prerelease: false
20
+ version: '1.4'
22
21
  type: :runtime
22
+ prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - "~>"
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: '1.0'
27
+ version: '1.4'
28
28
  - !ruby/object:Gem::Dependency
29
+ name: fastercsv
29
30
  requirement: !ruby/object:Gem::Requirement
30
31
  requirements:
31
32
  - - ">="
32
33
  - !ruby/object:Gem::Version
33
34
  version: '0'
34
- name: fastercsv
35
- prerelease: false
36
35
  type: :runtime
36
+ prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
+ name: nokogiri
43
44
  requirement: !ruby/object:Gem::Requirement
44
45
  requirements:
45
46
  - - ">="
46
47
  - !ruby/object:Gem::Version
47
- version: 1.6.7.2
48
- name: nokogiri
49
- prerelease: false
48
+ version: '0'
50
49
  type: :runtime
50
+ prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: 1.6.7.2
55
+ version: '0'
56
56
  - !ruby/object:Gem::Dependency
57
+ name: rake
57
58
  requirement: !ruby/object:Gem::Requirement
58
59
  requirements:
59
60
  - - "~>"
60
61
  - !ruby/object:Gem::Version
61
62
  version: 10.1.0
62
- name: rake
63
- prerelease: false
64
63
  type: :development
64
+ prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
69
  version: 10.1.0
70
70
  - !ruby/object:Gem::Dependency
71
+ name: rdoc
71
72
  requirement: !ruby/object:Gem::Requirement
72
73
  requirements:
73
74
  - - "~>"
74
75
  - !ruby/object:Gem::Version
75
76
  version: 4.0.0
76
- name: rdoc
77
- prerelease: false
78
77
  type: :development
78
+ prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - "~>"
82
82
  - !ruby/object:Gem::Version
83
83
  version: 4.0.0
84
84
  - !ruby/object:Gem::Dependency
85
+ name: activesupport
85
86
  requirement: !ruby/object:Gem::Requirement
86
87
  requirements:
87
88
  - - "~>"
88
89
  - !ruby/object:Gem::Version
89
90
  version: '3.2'
90
- name: activesupport
91
- prerelease: false
92
91
  type: :development
92
+ prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
97
  version: '3.2'
98
98
  - !ruby/object:Gem::Dependency
99
+ name: redgreen
99
100
  requirement: !ruby/object:Gem::Requirement
100
101
  requirements:
101
102
  - - "~>"
102
103
  - !ruby/object:Gem::Version
103
104
  version: '1.2'
104
- name: redgreen
105
- prerelease: false
106
105
  type: :development
106
+ prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
109
  - - "~>"
110
110
  - !ruby/object:Gem::Version
111
111
  version: '1.2'
112
112
  - !ruby/object:Gem::Dependency
113
+ name: shoulda
113
114
  requirement: !ruby/object:Gem::Requirement
114
115
  requirements:
115
116
  - - "~>"
116
117
  - !ruby/object:Gem::Version
117
118
  version: '3.5'
118
- name: shoulda
119
- prerelease: false
120
119
  type: :development
120
+ prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
122
122
  requirements:
123
123
  - - "~>"
124
124
  - !ruby/object:Gem::Version
125
125
  version: '3.5'
126
126
  - !ruby/object:Gem::Dependency
127
+ name: rr
127
128
  requirement: !ruby/object:Gem::Requirement
128
129
  requirements:
129
130
  - - "~>"
130
131
  - !ruby/object:Gem::Version
131
132
  version: '1.0'
132
- name: rr
133
- prerelease: false
134
133
  type: :development
134
+ prerelease: false
135
135
  version_requirements: !ruby/object:Gem::Requirement
136
136
  requirements:
137
137
  - - "~>"
138
138
  - !ruby/object:Gem::Version
139
139
  version: '1.0'
140
140
  - !ruby/object:Gem::Dependency
141
+ name: simplecov
141
142
  requirement: !ruby/object:Gem::Requirement
142
143
  requirements:
143
144
  - - "~>"
144
145
  - !ruby/object:Gem::Version
145
146
  version: '0.7'
146
- name: simplecov
147
- prerelease: false
148
147
  type: :development
148
+ prerelease: false
149
149
  version_requirements: !ruby/object:Gem::Requirement
150
150
  requirements:
151
151
  - - "~>"
152
152
  - !ruby/object:Gem::Version
153
153
  version: '0.7'
154
154
  - !ruby/object:Gem::Dependency
155
+ name: simplecov-gem-adapter
155
156
  requirement: !ruby/object:Gem::Requirement
156
157
  requirements:
157
158
  - - "~>"
158
159
  - !ruby/object:Gem::Version
159
160
  version: 1.0.1
160
- name: simplecov-gem-adapter
161
- prerelease: false
162
161
  type: :development
162
+ prerelease: false
163
163
  version_requirements: !ruby/object:Gem::Requirement
164
164
  requirements:
165
165
  - - "~>"
166
166
  - !ruby/object:Gem::Version
167
167
  version: 1.0.1
168
168
  - !ruby/object:Gem::Dependency
169
+ name: rubocop
170
+ requirement: !ruby/object:Gem::Requirement
171
+ requirements:
172
+ - - ">="
173
+ - !ruby/object:Gem::Version
174
+ version: '0'
175
+ type: :development
176
+ prerelease: false
177
+ version_requirements: !ruby/object:Gem::Requirement
178
+ requirements:
179
+ - - ">="
180
+ - !ruby/object:Gem::Version
181
+ version: '0'
182
+ - !ruby/object:Gem::Dependency
183
+ name: sequel
169
184
  requirement: !ruby/object:Gem::Requirement
170
185
  requirements:
171
186
  - - "~>"
172
187
  - !ruby/object:Gem::Version
173
188
  version: '3.42'
174
- name: sequel
175
- prerelease: false
176
189
  type: :development
190
+ prerelease: false
177
191
  version_requirements: !ruby/object:Gem::Requirement
178
192
  requirements:
179
193
  - - "~>"
180
194
  - !ruby/object:Gem::Version
181
195
  version: '3.42'
182
196
  - !ruby/object:Gem::Dependency
197
+ name: htmlentities
183
198
  requirement: !ruby/object:Gem::Requirement
184
199
  requirements:
185
200
  - - "~>"
186
201
  - !ruby/object:Gem::Version
187
202
  version: '4.3'
188
- name: htmlentities
189
- prerelease: false
190
203
  type: :development
204
+ prerelease: false
191
205
  version_requirements: !ruby/object:Gem::Requirement
192
206
  requirements:
193
207
  - - "~>"
194
208
  - !ruby/object:Gem::Version
195
209
  version: '4.3'
196
210
  - !ruby/object:Gem::Dependency
211
+ name: hpricot
197
212
  requirement: !ruby/object:Gem::Requirement
198
213
  requirements:
199
214
  - - "~>"
200
215
  - !ruby/object:Gem::Version
201
216
  version: '0.8'
202
- name: hpricot
203
- prerelease: false
204
217
  type: :development
218
+ prerelease: false
205
219
  version_requirements: !ruby/object:Gem::Requirement
206
220
  requirements:
207
221
  - - "~>"
208
222
  - !ruby/object:Gem::Version
209
223
  version: '0.8'
210
224
  - !ruby/object:Gem::Dependency
225
+ name: mysql
211
226
  requirement: !ruby/object:Gem::Requirement
212
227
  requirements:
213
228
  - - "~>"
214
229
  - !ruby/object:Gem::Version
215
230
  version: '2.8'
216
- name: mysql
217
- prerelease: false
218
231
  type: :development
232
+ prerelease: false
219
233
  version_requirements: !ruby/object:Gem::Requirement
220
234
  requirements:
221
235
  - - "~>"
222
236
  - !ruby/object:Gem::Version
223
237
  version: '2.8'
224
238
  - !ruby/object:Gem::Dependency
239
+ name: pg
225
240
  requirement: !ruby/object:Gem::Requirement
226
241
  requirements:
227
242
  - - "~>"
228
243
  - !ruby/object:Gem::Version
229
244
  version: '0.12'
230
- name: pg
231
- prerelease: false
232
245
  type: :development
246
+ prerelease: false
233
247
  version_requirements: !ruby/object:Gem::Requirement
234
248
  requirements:
235
249
  - - "~>"
236
250
  - !ruby/object:Gem::Version
237
251
  version: '0.12'
238
252
  - !ruby/object:Gem::Dependency
253
+ name: mysql2
239
254
  requirement: !ruby/object:Gem::Requirement
240
255
  requirements:
241
256
  - - "~>"
242
257
  - !ruby/object:Gem::Version
243
258
  version: '0.3'
244
- name: mysql2
245
- prerelease: false
246
259
  type: :development
260
+ prerelease: false
247
261
  version_requirements: !ruby/object:Gem::Requirement
248
262
  requirements:
249
263
  - - "~>"
250
264
  - !ruby/object:Gem::Version
251
265
  version: '0.3'
252
266
  - !ruby/object:Gem::Dependency
267
+ name: behance
253
268
  requirement: !ruby/object:Gem::Requirement
254
269
  requirements:
255
270
  - - "~>"
256
271
  - !ruby/object:Gem::Version
257
272
  version: '0.3'
258
- name: behance
259
- prerelease: false
260
273
  type: :development
274
+ prerelease: false
261
275
  version_requirements: !ruby/object:Gem::Requirement
262
276
  requirements:
263
277
  - - "~>"
264
278
  - !ruby/object:Gem::Version
265
279
  version: '0.3'
266
280
  - !ruby/object:Gem::Dependency
281
+ name: unidecode
267
282
  requirement: !ruby/object:Gem::Requirement
268
283
  requirements:
269
284
  - - ">="
270
285
  - !ruby/object:Gem::Version
271
286
  version: '0'
272
- name: unidecode
273
- prerelease: false
274
287
  type: :development
288
+ prerelease: false
275
289
  version_requirements: !ruby/object:Gem::Requirement
276
290
  requirements:
277
291
  - - ">="
278
292
  - !ruby/object:Gem::Version
279
293
  version: '0'
280
294
  - !ruby/object:Gem::Dependency
295
+ name: open_uri_redirections
281
296
  requirement: !ruby/object:Gem::Requirement
282
297
  requirements:
283
298
  - - ">="
284
299
  - !ruby/object:Gem::Version
285
300
  version: '0'
286
- name: open_uri_redirections
301
+ type: :development
287
302
  prerelease: false
303
+ version_requirements: !ruby/object:Gem::Requirement
304
+ requirements:
305
+ - - ">="
306
+ - !ruby/object:Gem::Version
307
+ version: '0'
308
+ - !ruby/object:Gem::Dependency
309
+ name: reverse_markdown
310
+ requirement: !ruby/object:Gem::Requirement
311
+ requirements:
312
+ - - ">="
313
+ - !ruby/object:Gem::Version
314
+ version: '0'
288
315
  type: :development
316
+ prerelease: false
289
317
  version_requirements: !ruby/object:Gem::Requirement
290
318
  requirements:
291
319
  - - ">="
292
320
  - !ruby/object:Gem::Version
293
321
  version: '0'
294
322
  - !ruby/object:Gem::Dependency
323
+ name: launchy
295
324
  requirement: !ruby/object:Gem::Requirement
296
325
  requirements:
297
326
  - - "~>"
298
327
  - !ruby/object:Gem::Version
299
328
  version: '2.4'
300
- name: launchy
301
- prerelease: false
302
329
  type: :development
330
+ prerelease: false
303
331
  version_requirements: !ruby/object:Gem::Requirement
304
332
  requirements:
305
333
  - - "~>"
@@ -325,6 +353,7 @@ files:
325
353
  - lib/bunto-import/importers/csv.rb
326
354
  - lib/bunto-import/importers/drupal6.rb
327
355
  - lib/bunto-import/importers/drupal7.rb
356
+ - lib/bunto-import/importers/drupal_common.rb
328
357
  - lib/bunto-import/importers/easyblog.rb
329
358
  - lib/bunto-import/importers/enki.rb
330
359
  - lib/bunto-import/importers/ghost.rb
@@ -338,6 +367,7 @@ files:
338
367
  - lib/bunto-import/importers/posterous.rb
339
368
  - lib/bunto-import/importers/rss.rb
340
369
  - lib/bunto-import/importers/s9y.rb
370
+ - lib/bunto-import/importers/s9y_database.rb
341
371
  - lib/bunto-import/importers/textpattern.rb
342
372
  - lib/bunto-import/importers/tumblr.rb
343
373
  - lib/bunto-import/importers/typo.rb
@@ -350,7 +380,7 @@ homepage: http://github.com/bunto/bunto-import
350
380
  licenses:
351
381
  - MIT
352
382
  metadata: {}
353
- post_install_message:
383
+ post_install_message:
354
384
  rdoc_options:
355
385
  - "--charset=UTF-8"
356
386
  require_paths:
@@ -366,9 +396,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
366
396
  - !ruby/object:Gem::Version
367
397
  version: '0'
368
398
  requirements: []
369
- rubyforge_project:
370
- rubygems_version: 2.4.8
371
- signing_key:
399
+ rubyforge_project:
400
+ rubygems_version: 2.6.6
401
+ signing_key:
372
402
  specification_version: 2
373
403
  summary: Import command for Bunto (static site generator).
374
404
  test_files: []