middleman-xmlvalidator 0.0.33 → 0.0.34
Sign up to get free protection for your applications and to get access to all the features.
@@ -6,14 +6,14 @@ module Middleman
|
|
6
6
|
app.after_build do |builder|
|
7
7
|
puts "", "Validating with NokoGiri", ""
|
8
8
|
|
9
|
-
puts File.exist?File.join(File.dirname(File.expand_path(__FILE__)), './RSSSchema.xsd')
|
9
|
+
#puts File.exist?File.join(File.dirname(File.expand_path(__FILE__)), './RSSSchema.xsd')
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
Dir.glob("build/**/*BingSiteAuth.xml").each do |full_path|
|
12
|
+
puts " validating".blue + " #{full_path}....." + (Xmlvalidator.valid(full_path, 'BingSiteAuth.xsd') == true ? "COMPLETE".green : "ERRORS FOUND".red)
|
13
|
+
Xmlvalidator.validate(full_path, 'BingSiteAuth.xsd').each do |error|
|
14
|
+
puts " " + error.message
|
15
|
+
end
|
16
|
+
end
|
17
17
|
|
18
18
|
# Dir.glob("build/**/*crossdomain.xml").each do |full_path|
|
19
19
|
# puts " validating".blue + " #{full_path}....." + (Xmlvalidator.valid(full_path, 'crossdomain.xsd') == true ? "COMPLETE".green : "ERRORS FOUND".red)
|
@@ -52,7 +52,7 @@ module Middleman
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def self.validate(document_path, schema_path)
|
55
|
-
schema = Nokogiri::XML::Schema(File.read("
|
55
|
+
schema = Nokogiri::XML::Schema(File.read(File.join(File.dirname(File.expand_path(__FILE__)), "./" + schema_path)))
|
56
56
|
document = Nokogiri::XML(File.read(document_path))
|
57
57
|
schema.validate(document)
|
58
58
|
end
|