slickplan 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/slickplan/page.rb +1 -1
- data/lib/slickplan/parser/xml.rb +4 -4
- data/lib/slickplan/sitemap.rb +1 -1
- data/lib/slickplan/template.rb +1 -1
- data/lib/slickplan/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 387473611cf2ad24dd7f074ee5762367fc8490cf
|
4
|
+
data.tar.gz: 339c373cf1a2178c95dc198e3d855027e7eb9878
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 707998beae11f1153d4e6b06b8a89702054fba3a1e332f048ae2589464224ef75e79b3051201e6744ea0341feddac7e91c361becaacb969cec5868a8330e68d1
|
7
|
+
data.tar.gz: 150f708b9cf45e85e4e37a68070700ab04c1c35f1bceb5140baddc7ffec426890dcea5cd444c32bb92aeb888ce11553b8c4866472554bbc2f259b15d07c07880
|
data/lib/slickplan/page.rb
CHANGED
data/lib/slickplan/parser/xml.rb
CHANGED
@@ -1,17 +1,17 @@
|
|
1
|
-
module
|
1
|
+
module Slickplan
|
2
2
|
module Parser
|
3
3
|
class XML
|
4
4
|
def self.parse(xml)
|
5
5
|
doc = Nokogiri::XML(xml)
|
6
|
-
sitemap =
|
6
|
+
sitemap = Slickplan::Sitemap.new(title: doc.css('sitemap>title').text)
|
7
7
|
sitemap.templates = doc.css('content_templates>template').collect do |t|
|
8
|
-
|
8
|
+
Slickplan::Template.new(name: t.attr(:name), id: t.attr(:id))
|
9
9
|
end
|
10
10
|
sitemap.pages = doc.css('section#svgmainsection>cells>cell').collect do |p|
|
11
11
|
template_id = p.css('contents>template').text
|
12
12
|
parent_id = p.css('parent').text
|
13
13
|
|
14
|
-
|
14
|
+
Slickplan::Page.new(id: p.attr(:id), title: p.css('text').text, content: p.css('contents>body>wysiwyg>content').text, template_id: template_id, template: sitemap.templates.find {|t| t.id == template_id}, parent_id: parent_id)
|
15
15
|
end
|
16
16
|
sitemap.pages.each do |page|
|
17
17
|
page.parent = sitemap.pages.find {|p| p.id == page.parent_id}
|
data/lib/slickplan/sitemap.rb
CHANGED
data/lib/slickplan/template.rb
CHANGED
data/lib/slickplan/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slickplan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ed Jones
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|