scms 3.0.5 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/scms.rb +3 -0
- data/lib/scms/scms-xmlhandler.rb +33 -0
- data/lib/scms/version.rb +1 -1
- data/scms.gemspec +1 -0
- metadata +18 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
M2MxZTlmM2Y0OTMzZDI4MzVhNDE2N2M4YzE1MDJlZmQ0MzdjZDVlZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjJkNWQyNzlmMTY1MzVjOGQ2YzQ2NmIwZmZkYTIzYWNlNTMxYTI1OQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZjJlZDU1MjFhYzFhNTkxYmE1N2UzZDJlOTU1OGFkYTUzNTljZWVkOTRjNWIz
|
10
|
+
ZDU4YWQ3MjY0OTM0ZTliY2NmYTdhYTEzMTdmMGNlZGY2MDU0NjgxNTFhNmY3
|
11
|
+
ZmI3M2Q2ZWYwYzZhZWZmYmVjMTAxNTAxOWNhMWQ1NDk2NTczYjA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZWE2ODc1NWNmOGRjNmQxODg1ZTRhOGNjNzQ1N2JlZjhjMjQ2ODZiNTVlNDQy
|
14
|
+
M2M2ZDcyMmNlYmY3MTgxYjY1ZGU0MThkZjg2YmYxNmFkZGM2NjkyNDIwMmZl
|
15
|
+
MDZiNzJiZDI2OTJmYzVmNGI3NTI0MTY5OTZjMjljZDI0YTI4MWE=
|
data/lib/scms.rb
CHANGED
@@ -2,6 +2,7 @@ require "scms/version"
|
|
2
2
|
|
3
3
|
module Scms
|
4
4
|
require 'scms/scms-utils.rb'
|
5
|
+
require 'scms/scms-xmlhandler.rb'
|
5
6
|
require 'scms/s3deploy.rb'
|
6
7
|
|
7
8
|
require 'erb'
|
@@ -187,6 +188,8 @@ module Scms
|
|
187
188
|
snnipetCode = File.read(viewpath)
|
188
189
|
|
189
190
|
case File.extname(view[1])
|
191
|
+
when ".xml"
|
192
|
+
viewSnippet = ScmsXmlHandler.transform(snnipetCode)
|
190
193
|
when ".md"
|
191
194
|
begin
|
192
195
|
snnipetCode = snnipetCode.encode('UTF-8', :invalid => :replace, :undef => :replace)
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module ScmsXmlHandler
|
2
|
+
VERSION = '1.0.0'
|
3
|
+
require 'nokogiri'
|
4
|
+
|
5
|
+
def ScmsXmlHandler.transform(xmlstring)
|
6
|
+
|
7
|
+
# This could be a better solution: http://stackoverflow.com/questions/3542264/can-nokogiri-search-for-xml-stylesheet-tags
|
8
|
+
|
9
|
+
xml = Nokogiri::XML(xmlstring)
|
10
|
+
#<?xml-stylesheet type="text/xsl" href="../skins/html5-boilerplate.xsl"?>
|
11
|
+
pi = xml.children[0]
|
12
|
+
mypi = pi.to_s.scan(/.* href="(.*)"\?>/)
|
13
|
+
|
14
|
+
if mypi[0] != nil
|
15
|
+
xslpi = mypi[0][0].to_s
|
16
|
+
puts "Transforming with #{xslpi}"
|
17
|
+
xslpi = File.join($website, xslpi)
|
18
|
+
|
19
|
+
if File.exists?(xslpi)
|
20
|
+
xsl = File.read(xslpi)
|
21
|
+
xslt = Nokogiri::XSLT(xsl)
|
22
|
+
return xslt.transform(xml).to_html
|
23
|
+
else
|
24
|
+
puts "Cant find pi: #{xslpi}"
|
25
|
+
end
|
26
|
+
else
|
27
|
+
puts "No XSL processing instruction found in #{view}"
|
28
|
+
end
|
29
|
+
|
30
|
+
return xmlstring
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
data/lib/scms/version.rb
CHANGED
data/scms.gemspec
CHANGED
@@ -35,6 +35,7 @@ Gem::Specification.new do |spec|
|
|
35
35
|
spec.add_dependency "filewatcher"
|
36
36
|
spec.add_dependency "webrick"
|
37
37
|
spec.add_dependency "launchy"
|
38
|
+
spec.add_dependency "nokogiri"
|
38
39
|
|
39
40
|
#spec.add_development_dependency "bundler", "~> 1.3"
|
40
41
|
spec.add_development_dependency "rake"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Courtenay Probert
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cprobert-s3sync
|
@@ -122,6 +122,20 @@ dependencies:
|
|
122
122
|
- - ! '>='
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: nokogiri
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ! '>='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ! '>='
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
125
139
|
- !ruby/object:Gem::Dependency
|
126
140
|
name: rake
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -177,6 +191,7 @@ files:
|
|
177
191
|
- lib/scms/s3deploy.rb
|
178
192
|
- lib/scms/scms-httpserver.rb
|
179
193
|
- lib/scms/scms-utils.rb
|
194
|
+
- lib/scms/scms-xmlhandler.rb
|
180
195
|
- lib/scms/version.rb
|
181
196
|
- lib/scms/yui.rb
|
182
197
|
- scms.gemspec
|
@@ -200,7 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
200
215
|
version: '0'
|
201
216
|
requirements: []
|
202
217
|
rubyforge_project:
|
203
|
-
rubygems_version: 2.1.
|
218
|
+
rubygems_version: 2.1.9
|
204
219
|
signing_key:
|
205
220
|
specification_version: 4
|
206
221
|
summary: Create simple static websites, in a jiffy
|