From dae4c2ea0a02886716704466f74050ccc25130f7 Mon Sep 17 00:00:00 2001 From: Marc Remolt Date: Wed, 1 Jun 2011 21:16:19 +0200 Subject: [PATCH] Started integrationg the code into gem * added nokogiri as dependency * added wordpress dump as fixture --- Gemfile.lock | 2 + refinerycms-wordpress-import.gemspec | 1 + spec/fixtures/wordpress_dump.xml | 282 +++++++++++++++++++++++++++ 3 files changed, 285 insertions(+) create mode 100644 spec/fixtures/wordpress_dump.xml diff --git a/Gemfile.lock b/Gemfile.lock index bf3b30b..33c7f7a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,6 +2,7 @@ PATH remote: ./ specs: refinerycms-wordpress-import (0.0.1) + nokogiri (~> 1.4.4) refinerycms (~> 1.0.0) refinerycms-blog (~> 1.3.2) @@ -64,6 +65,7 @@ GEM mime-types (~> 1.16) treetop (~> 1.4.8) mime-types (1.16) + nokogiri (1.4.4) orm_adapter (0.0.5) polyglot (0.3.1) rack (1.2.3) diff --git a/refinerycms-wordpress-import.gemspec b/refinerycms-wordpress-import.gemspec index a45ea92..6797fb5 100644 --- a/refinerycms-wordpress-import.gemspec +++ b/refinerycms-wordpress-import.gemspec @@ -9,4 +9,5 @@ Gem::Specification.new do |s| s.add_dependency 'refinerycms', '~> 1.0.0' s.add_dependency 'refinerycms-blog', '~> 1.3.2' + s.add_dependency 'nokogiri', '~> 1.4.4' end diff --git a/spec/fixtures/wordpress_dump.xml b/spec/fixtures/wordpress_dump.xml new file mode 100644 index 0000000..a38fa0a --- /dev/null +++ b/spec/fixtures/wordpress_dump.xml @@ -0,0 +1,282 @@ + + + + + + + + + + + + + + + + + + + + + + + My test blog + http://localhost/wordpress + Just another WordPress site + Sat, 21 May 2011 12:27:19 +0000 + en + 1.1 + http://localhost/wordpress + http://localhost/wordpress + + 1adminadmin@example.com + + 7rant + 3tutorials + 1uncategorized + 6css + 5html + 8php + 4ruby + + http://wordpress.org/?v=3.1.2 + + + Hello world! + http://localhost/wordpress/?p=1 + Sat, 21 May 2011 12:21:54 +0000 + admin + http://localhost/wordpress/?p=1 + + + + 1 + 2011-05-21 12:21:54 + 2011-05-21 12:21:54 + open + open + hello-world + publish + 0 + 0 + post + + 0 + + + 1 + + + http://wordpress.org/ + + 2011-05-21 12:21:54 + 2011-05-21 12:21:54 + To delete a comment, just log in and view the post's comments. There you will have the option to edit or delete them.]]> + 1 + + 0 + 0 + + + + Sample Page + http://localhost/wordpress/?page_id=2 + Sat, 21 May 2011 12:21:54 +0000 + admin + http://localhost/wordpress/?page_id=2 + + Hi there! I'm a bike messenger by day, aspiring actor by night, and this is my blog. I live in Los Angeles, have a great dog named Jack, and I like piña coladas. (And gettin' caught in the rain.) + +...or something like this: + +
The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickies to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.
+ +As a new WordPress user, you should go to your dashboard to delete this page and create new pages for your content. Have fun!]]>
+ + 2 + 2011-05-21 12:21:54 + 2011-05-21 12:21:54 + open + open + sample-page + publish + 0 + 0 + page + + 0 + + _wp_page_template + + +
+ + Second blog post + http://localhost/wordpress/?p=4 + Sat, 21 May 2011 12:23:52 +0000 + admin + http://localhost/wordpress/?p=4 + + + + 4 + 2011-05-21 12:23:52 + 2011-05-21 12:23:52 + open + open + second-blog-post + publish + 0 + 0 + post + + 0 + + + + + + _edit_last + + + + + Third blog post + http://localhost/wordpress/?p=6 + Sat, 21 May 2011 12:24:45 +0000 + admin + http://localhost/wordpress/?p=6 + + + + 6 + 2011-05-21 12:24:45 + 2011-05-21 12:24:45 + open + open + third-blog-post + publish + 0 + 0 + post + + 0 + + + + + + _edit_last + + + + 2 + + admin@example.com + + 127.0.0.1 + 2011-05-21 12:26:24 + 2011-05-21 12:26:24 + + 1 + + 0 + 1 + + + 3 + + admin@example.com + http://www.example.com/ + 127.0.0.1 + 2011-05-21 12:26:30 + 2011-05-21 12:26:30 + + 1 + + 0 + 1 + + + + About + http://localhost/wordpress/?page_id=8 + Sat, 21 May 2011 12:25:13 +0000 + admin + http://localhost/wordpress/?page_id=8 + + + + 8 + 2011-05-21 12:25:13 + 2011-05-21 12:25:13 + open + open + about + publish + 0 + 0 + page + + 0 + + _edit_last + + + + _wp_page_template + + + + + About me + http://localhost/wordpress/?page_id=10 + Sat, 21 May 2011 12:25:42 +0000 + admin + http://localhost/wordpress/?page_id=10 + + viverra. Proin at leo ut lacus consequat rhoncus. In hac habitasse platea dictumst. Nunc quis tortor sed libero hendrerit dapibus. Integer interdum purus id erat. Duis nec velit vitae dolor mattis euismod. + +Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Suspendisse pellentesque dignissim lacus. Nulla semper euismod arcu. Suspendisse egestas, erat a consectetur dapibus, felis orci cursus eros, et sollicitudin purus urna et metus. Integer eget est sed nunc euismod vestibulum. Integer nulla dui, tristique in, euismod et, interdum imperdiet, enim. Mauris at lectus. Sed egestas tortor nec mi.]]> + + 10 + 2011-05-21 12:25:42 + 2011-05-21 12:25:42 + open + open + about-me + publish + 8 + 0 + page + + 0 + + _edit_last + + + + _wp_page_template + + + +
+