Skip to content

Commit

Permalink
Merge pull request mikel#468 from twg/master
Browse files Browse the repository at this point in the history
Requiring module emits "Loading precompiled parsers from ruby source"
  • Loading branch information
Mikel Lindsaar committed Dec 4, 2012
2 parents ec96741 + 8889d09 commit bac1461
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions lib/load_parsers.rb
Expand Up @@ -8,7 +8,6 @@ module Mail # :doc:

def self.compile_parser(parser)
require 'treetop/compiler'
STDOUT.puts "Compiling parser #{parser} from treetop source"
Treetop.load(File.join(File.dirname(__FILE__)) + "/mail/parsers/#{parser}")
end

Expand All @@ -18,20 +17,15 @@ def self.compile_parser(parser)
content_transfer_encoding content_location ]

if defined?(MAIL_SPEC_SUITE_RUNNING)
STDOUT.puts "Compiling all parsers from treetop source"

parsers.each do |parser|
compile_parser(parser)
end

else
STDOUT.puts "Loading precompiled parsers from ruby source"

parsers.each do |parser|
begin
require "mail/parsers/#{parser}"
rescue LoadError
STDOUT.puts "Couldn't load parser #{parser} from ruby source"
compile_parser(parser)
end
end
Expand Down

0 comments on commit bac1461

Please sign in to comment.