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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MGY4MWMyMjE3ZjdlOTBiOGU1Y2Y5ZmFlY2ViY2VlNDRkMmE2ZTBlNA==
4
+ M2MxZTlmM2Y0OTMzZDI4MzVhNDE2N2M4YzE1MDJlZmQ0MzdjZDVlZg==
5
5
  data.tar.gz: !binary |-
6
- N2U4NjVkMDM3Mjc0OWZiZmFkYTNmOTliNjkzMDBkYzgzMGJkZmM4OQ==
6
+ ZjJkNWQyNzlmMTY1MzVjOGQ2YzQ2NmIwZmZkYTIzYWNlNTMxYTI1OQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MmE1MWJhOGU0N2Q3NjA0MThjMmEyOWNmYmI2NDdhYTY3NWM1ZmFiNWExMDZi
10
- NGFkMzMzYWQ2MDRiM2Y0YzdlMDg3MGU4ZWVkYmFhMjAzNzdjMWVlNWU1Nzg5
11
- OGQxNzUzOWY5ZWVjMGM1MGJjNTQ4MDhmYTRhZTYwZmMzNThiYmM=
9
+ ZjJlZDU1MjFhYzFhNTkxYmE1N2UzZDJlOTU1OGFkYTUzNTljZWVkOTRjNWIz
10
+ ZDU4YWQ3MjY0OTM0ZTliY2NmYTdhYTEzMTdmMGNlZGY2MDU0NjgxNTFhNmY3
11
+ ZmI3M2Q2ZWYwYzZhZWZmYmVjMTAxNTAxOWNhMWQ1NDk2NTczYjA=
12
12
  data.tar.gz: !binary |-
13
- ZTJhNDVjNmQ2NzcxNTE4ZjhjZGVjNDk5MTVhZmE1MTdhZjA4ZjkwZTZkYTEy
14
- YjBkZTAwMWI1YzYzOWIzMGMwNDkyZGEwMDFiZTA5Njc0NDUyODVmYTRkYzI1
15
- Yzk4MDhhZTU1NTllMDA1ZGE3OGI1NmJlZWI1MzFhZjhiMWJlNWE=
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
@@ -1,3 +1,3 @@
1
1
  module Scms
2
- VERSION = "3.0.5"
2
+ VERSION = "3.1.0"
3
3
  end
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.5
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-14 00:00:00.000000000 Z
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.8
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