Class: Headhunter::Runner
- Inherits:
-
Object
- Object
- Headhunter::Runner
- Defined in:
- lib/headhunter/runner.rb
Constant Summary collapse
- ASSETS_PATH =
'public/assets'
Instance Attribute Summary collapse
-
#results ⇒ Object
Returns the value of attribute results.
Instance Method Summary collapse
- #clean_up! ⇒ Object
-
#initialize(root) ⇒ Runner
constructor
A new instance of Runner.
- #process(url, html) ⇒ Object
- #report ⇒ Object
Constructor Details
#initialize(root) ⇒ Runner
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/headhunter/runner.rb', line 9 def initialize(root) @root = root @temporary_assets = [] precompile_assets! @html_validator = HtmlValidator.new @css_hunter = CssHunter.new(stylesheets) @css_validator = CssValidator.new(stylesheets) end |
Instance Attribute Details
#results ⇒ Object
Returns the value of attribute results.
7 8 9 |
# File 'lib/headhunter/runner.rb', line 7 def results @results end |
Instance Method Details
#clean_up! ⇒ Object
26 27 28 29 30 |
# File 'lib/headhunter/runner.rb', line 26 def clean_up! print "Headhunter is removing precompiled assets...".yellow remove_assets! puts " done!".yellow end |
#process(url, html) ⇒ Object
21 22 23 24 |
# File 'lib/headhunter/runner.rb', line 21 def process(url, html) @html_validator.validate(url, html) @css_hunter.process(html) end |
#report ⇒ Object
32 33 34 35 36 37 38 39 |
# File 'lib/headhunter/runner.rb', line 32 def report puts [ @html_validator.statistics, @css_validator.statistics, @css_hunter.statistics ].join "\n\n" puts end |