middleman-xmlvalidator 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,6 @@
1
1
  require 'middleman-core'
2
2
 
3
3
  require 'middleman/xmlvalidator/version'
4
- require 'middleman/xmlvalidator'
5
4
 
6
5
 
7
6
  ::Middleman::Extensions.register(:validate, ::Middleman::Xmlvalidator::Extension)
@@ -1,63 +1,64 @@
1
1
  module Middleman
2
2
  module Xmlvalidator
3
3
  class << self
4
- def registered(app)
4
+ def registered(app)
5
5
 
6
- app.after_build do |builder|
7
- puts "", "Validating with NokoGiri", ""
6
+ app.after_build do |builder|
7
+ puts "", "Validating with NokoGiri", ""
8
8
 
9
- Dir.glob("build/**/*BingSiteAuth.xml").each do |full_path|
10
- puts " validating".blue + " #{full_path}....." + (ValidateNokoGiri.valid(full_path, 'BingSiteAuth.xsd') == true ? "COMPLETE".green : "ERRORS FOUND".red)
11
- ValidateNokoGiri.validate(full_path, 'BingSiteAuth.xsd').each do |error|
12
- puts " " + error.message
9
+ Dir.glob("build/**/*BingSiteAuth.xml").each do |full_path|
10
+ puts " validating".blue + " #{full_path}....." + (ValidateNokoGiri.valid(full_path, 'BingSiteAuth.xsd') == true ? "COMPLETE".green : "ERRORS FOUND".red)
11
+ ValidateNokoGiri.validate(full_path, 'BingSiteAuth.xsd').each do |error|
12
+ puts " " + error.message
13
+ end
13
14
  end
14
- end
15
15
 
16
- Dir.glob("build/**/*crossdomain.xml").each do |full_path|
17
- puts " validating".blue + " #{full_path}....." + (ValidateNokoGiri.valid(full_path, 'crossdomain.xsd') == true ? "COMPLETE".green : "ERRORS FOUND".red)
18
- ValidateNokoGiri.validate(full_path, 'crossdomain.xsd').each do |error|
19
- puts " " + error.message
16
+ Dir.glob("build/**/*crossdomain.xml").each do |full_path|
17
+ puts " validating".blue + " #{full_path}....." + (ValidateNokoGiri.valid(full_path, 'crossdomain.xsd') == true ? "COMPLETE".green : "ERRORS FOUND".red)
18
+ ValidateNokoGiri.validate(full_path, 'crossdomain.xsd').each do |error|
19
+ puts " " + error.message
20
+ end
20
21
  end
21
- end
22
22
 
23
- Dir.glob("build/**/*Sitemap.xml").each do |full_path|
24
- puts " validating".blue + " #{full_path}....." + (ValidateNokoGiri.valid(full_path, 'Sitemap3.xsd') == true ? "COMPLETE".green : "ERRORS FOUND".red)
25
- ValidateNokoGiri.validate(full_path, 'Sitemap3.xsd').each do |error|
26
- puts " " + error.message
23
+ Dir.glob("build/**/*Sitemap.xml").each do |full_path|
24
+ puts " validating".blue + " #{full_path}....." + (ValidateNokoGiri.valid(full_path, 'Sitemap3.xsd') == true ? "COMPLETE".green : "ERRORS FOUND".red)
25
+ ValidateNokoGiri.validate(full_path, 'Sitemap3.xsd').each do |error|
26
+ puts " " + error.message
27
+ end
27
28
  end
28
- end
29
29
 
30
- Dir.glob("build/**/*.rss").each do |full_path|
31
- puts " validating".blue + " #{full_path}....." + (ValidateNokoGiri.valid(full_path, 'RSSSchema.xsd') == true ? "COMPLETE".green : "ERRORS FOUND".red)
32
- ValidateNokoGiri.validate(full_path, 'RSSSchema.xsd').each do |error|
33
- puts " " + error.message
30
+ Dir.glob("build/**/*.rss").each do |full_path|
31
+ puts " validating".blue + " #{full_path}....." + (ValidateNokoGiri.valid(full_path, 'RSSSchema.xsd') == true ? "COMPLETE".green : "ERRORS FOUND".red)
32
+ ValidateNokoGiri.validate(full_path, 'RSSSchema.xsd').each do |error|
33
+ puts " " + error.message
34
+ end
34
35
  end
35
- end
36
36
 
37
- Dir.glob("build/**/*.xml").each do |full_path|
38
- if not (full_path.match(/^.*BingSiteAuth.xml$/) || full_path.match(/^.*crossdomain.xml$/) || full_path.match(/^.*Sitemap.xml$/))
39
- puts " validating".blue + " #{full_path}....." + (ValidateNokoGiri.valid(full_path, 'XMLSchema.xsd') == true ? "COMPLETE".green : "ERRORS FOUND".red)
40
- ValidateNokoGiri.validate(full_path, 'XMLSchema.xsd').each do |error|
41
- puts " " + error.message
37
+ Dir.glob("build/**/*.xml").each do |full_path|
38
+ if not (full_path.match(/^.*BingSiteAuth.xml$/) || full_path.match(/^.*crossdomain.xml$/) || full_path.match(/^.*Sitemap.xml$/))
39
+ puts " validating".blue + " #{full_path}....." + (ValidateNokoGiri.valid(full_path, 'XMLSchema.xsd') == true ? "COMPLETE".green : "ERRORS FOUND".red)
40
+ ValidateNokoGiri.validate(full_path, 'XMLSchema.xsd').each do |error|
41
+ puts " " + error.message
42
+ end
42
43
  end
43
44
  end
44
- end
45
45
 
46
- puts "", "Validation with NokoGiri " + "Complete".green, ""
46
+ puts "", "Validation with NokoGiri " + "Complete".green, ""
47
+ end
47
48
  end
49
+ alias :included :registered
48
50
  end
49
- alias :included :registered
50
- end
51
51
 
52
- def self.validate(document_path, schema_path)
53
- schema = Nokogiri::XML::Schema(File.read("lib/schema/" + schema_path))
54
- document = Nokogiri::XML(File.read(document_path))
55
- schema.validate(document)
56
- end
52
+ def self.validate(document_path, schema_path)
53
+ schema = Nokogiri::XML::Schema(File.read("lib/schema/" + schema_path))
54
+ document = Nokogiri::XML(File.read(document_path))
55
+ schema.validate(document)
56
+ end
57
57
 
58
- def self.valid(document_path, schema_path)
59
- schema = Nokogiri::XML::Schema(File.read("lib/schema/" + schema_path))
60
- document = Nokogiri::XML(File.read(document_path))
61
- schema.valid?(document)
58
+ def self.valid(document_path, schema_path)
59
+ schema = Nokogiri::XML::Schema(File.read("lib/schema/" + schema_path))
60
+ document = Nokogiri::XML(File.read(document_path))
61
+ schema.valid?(document)
62
+ end
62
63
  end
63
- end
64
+ end
@@ -1,6 +1,6 @@
1
1
  module Middleman
2
2
  module Xmlvalidator
3
- VERSION = "0.0.14"
3
+ VERSION = "0.0.15"
4
4
  PACKAGE = "middleman-xmlvalidator"
5
5
  end
6
6
  end
@@ -2,6 +2,7 @@
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'middleman/xmlvalidator/version'
5
+ require 'middleman/xmlvalidator/extension'
5
6
 
6
7
  Gem::Specification.new do |gem|
7
8
  gem.name = Middleman::Xmlvalidator::PACKAGE
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-xmlvalidator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: