Skip to content

Commit

Permalink
added validator type and some defaults and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SidOfc committed Apr 23, 2017
1 parent 8c63d60 commit 12659b4
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 13 deletions.
26 changes: 13 additions & 13 deletions lib/browserino/definitions/matchers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,33 +202,33 @@
version: %r{download\sdemon/([\d\.]+)}i
end

# automatically set type to :library for each defined matcher
libraries do
match %r{php}i, name: :php
match %r{python}i, name: :python, version: %r{-urllib/([\d\.]+)}i
match %r{perl}i, name: :perl
match %r{java}i, name: :java
match %r{pycurl}i, name: :pycurl
match %r{curl}i, name: :curl
end

# automatically set type to :library for each defined matcher
validators do
match %r{cse\shtml\svalidator}i, name: :cse_html_validator
match %r{csschecl}i, name: :csschecl
match %r{csscheck}i, name: :csscheck
match %r{htmlparser}i, name: :htmlparser
match %r{p3p_validator}i, name: :p3p_validator
match %r{p3p\svalidator}i, name: :p3p_validator
match %r{wdg_validator}i, name: :wdg_validator
match %r{w3c_validator}i, name: :w3c_validator

match %r{cynthia}i, name: :cynthia,
version: %r{cynthia\s([\d\.]+)}i

match %r{w3c_css_validator}i,
name: :w3c_validator,
name: :w3c_css_validator,
version: %r{w3c_css_validator_jfouffa/([\d\.]+)}i
end

# automatically set type to :library for each defined matcher
libraries do
match %r{php}i, name: :php
match %r{python}i, name: :python, version: %r{-urllib/([\d\.]+)}i
match %r{perl}i, name: :perl
match %r{java}i, name: :java
match %r{pycurl}i, name: :pycurl
match %r{curl}i, name: :curl
end

# inherit properties a standard set of properties by the name of a
# previously defined matcher, overwritten by properties added within matchers
# inherit properties from Identity where name == :chrome
Expand Down
41 changes: 41 additions & 0 deletions spec/files/validators.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
:validators:
- :user_agent: CSE HTML Validator Lite Online (http://online.htmlvalidator.com/php/onlinevallite.php)
:name: :cse_html_validator
:version:
:to_s: 'cse_html_validator'

- :user_agent: CSSCheck/1.2.2
:name: :csscheck
:version: '1.2.2'
:to_s: 'csscheck csscheck1'

- :user_agent: Cynthia 1.0
:name: :cynthia
:version: '1.0'
:to_s: 'cynthia cynthia1'

- :user_agent: HTMLParser/1.6
:name: :htmlparser
:version: '1.6'
:to_s: 'htmlparser htmlparser1'

- :user_agent: P3P Validator
:name: :p3p_validator
:version:
:to_s: 'p3p_validator'

- :user_agent: Jigsaw/2.2.5 W3C_CSS_Validator_JFouffa/2.0
:name: :w3c_css_validator
:version: '2.0.0'
:to_s: 'w3c_css_validator w3c_css_validator2'

- :user_agent: WDG_Validator/1.6.2
:name: :wdg_validator
:version: '1.6.2'
:to_s: 'wdg_validator wdg_validator1'

- :user_agent: W3C_Validator/1.654
:name: :w3c_validator
:version: '1.654'
:to_s: 'w3c_validator w3c_validator1'

0 comments on commit 12659b4

Please sign in to comment.