Permalink
Browse files

Create a visualize_all task to generate all files.

  • Loading branch information...
1 parent 59b11b1 commit 837a7f566df25e280695ddff82cb5c9cbbfaf4b6 Matt Colyer committed Oct 18, 2010
Showing with 15 additions and 3 deletions.
  1. +15 −3 Rakefile
View
@@ -105,14 +105,27 @@ task :test, [:language] do |t, args|
end
end
+desc "Generate an HTML file for all languages"
+task :visualize_all do |t|
+ Dir.glob("data/*").each do |path|
+ dir,file = path.split("/")
+ generate_html(file)
+ end
+end
+
desc "Generates an HTML file which previews all of the characters included"
task :visualize, [:language] do |t, args|
unless args.language
failure "You must specify a language to visualize. Try rake visualize[en]"
end
- language = Speakeasy::Language.new(args.language)
- filename = "#{args.language}.html"
+ generate_html(args.language)
+end
+
+
+def generate_html(language_id)
+ language = Speakeasy::Language.new(language_id)
+ filename = "#{language_id}.html"
File.open(filename, "w") do |f|
f.write <<-eos
@@ -162,7 +175,6 @@ task :visualize, [:language] do |t, args|
end
end
-
#############################################################################
#
# Packaging tasks

0 comments on commit 837a7f5

Please sign in to comment.