Skip to content

Commit

Permalink
Create a visualize_all task to generate all files.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Colyer committed Oct 18, 2010
1 parent 59b11b1 commit 837a7f5
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Rakefile
Expand Up @@ -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
Expand Down Expand Up @@ -162,7 +175,6 @@ task :visualize, [:language] do |t, args|
end
end


#############################################################################
#
# Packaging tasks
Expand Down

0 comments on commit 837a7f5

Please sign in to comment.