aboutsummaryrefslogtreecommitdiffstats
path: root/guides/w3c_validator.rb
diff options
context:
space:
mode:
authorJaime Iniesta <jaimeiniesta@gmail.com>2012-08-24 11:43:25 +0200
committerJaime Iniesta <jaimeiniesta@gmail.com>2012-08-24 11:43:25 +0200
commitfdeaea6b45e644aa6438c75f2f9723a4794e9223 (patch)
tree83cde30591a05d0a1ea72ede2e2cb6481cfc994b /guides/w3c_validator.rb
parentdfd145630d77e9722787143ac5dad32a2b3ed481 (diff)
downloadrails-fdeaea6b45e644aa6438c75f2f9723a4794e9223.tar.gz
rails-fdeaea6b45e644aa6438c75f2f9723a4794e9223.tar.bz2
rails-fdeaea6b45e644aa6438c75f2f9723a4794e9223.zip
Revert "Fix rake guides:validate task as it should be run from the guides directory; add exception handling"
This kind of changes should go on a pull request instead. This reverts commit ecae2f0ef0452f8d333525a6aed58e5ab8d3ccb1.
Diffstat (limited to 'guides/w3c_validator.rb')
-rw-r--r--guides/w3c_validator.rb21
1 files changed, 8 insertions, 13 deletions
diff --git a/guides/w3c_validator.rb b/guides/w3c_validator.rb
index eac668c9cd..5e340499c4 100644
--- a/guides/w3c_validator.rb
+++ b/guides/w3c_validator.rb
@@ -5,9 +5,9 @@
# Guides are taken from the output directory, from where all .html files are
# submitted to the validator.
#
-# This script is prepared to be launched from the guides directory as a rake task:
+# This script is prepared to be launched from the railties directory as a rake task:
#
-# rake guides:validate
+# rake validate_guides
#
# If nothing is specified, all files will be validated, but you can check just
# some of them using this environment variable:
@@ -17,12 +17,12 @@
# enough:
#
# # validates only association_basics.html
-# rake guides:validate ONLY=assoc
+# ONLY=assoc rake validate_guides
#
# Separate many using commas:
#
# # validates only association_basics.html and migrations.html
-# rake guides:validate ONLY=assoc,migrations
+# ONLY=assoc,migrations rake validate_guides
#
# ---------------------------------------------------------------------------
@@ -38,12 +38,7 @@ module RailsGuides
errors_on_guides = {}
guides_to_validate.each do |f|
- begin
- results = validator.validate_file(f)
- rescue Exception => e
- puts "Could not validate #{f} because of #{e}"
- next
- end
+ results = validator.validate_file(f)
if results.validity
print "."
@@ -58,15 +53,15 @@ module RailsGuides
private
def guides_to_validate
- guides = Dir["./output/*.html"]
- guides.delete("./output/layout.html")
+ guides = Dir["./guides/output/*.html"]
+ guides.delete("./guides/output/layout.html")
ENV.key?('ONLY') ? select_only(guides) : guides
end
def select_only(guides)
prefixes = ENV['ONLY'].split(",").map(&:strip)
guides.select do |guide|
- prefixes.any? {|p| guide.start_with?("./output/#{p}")}
+ prefixes.any? {|p| guide.start_with?("./guides/output/#{p}")}
end
end