Permalink
Browse files

Added extra debugging and a workaround for a bug in polyglot

  • Loading branch information...
zenspider committed Aug 27, 2011
1 parent a1eeca8 commit 7c412950e3dcabb2c26b55cca08d0359a357a029
Showing with 5 additions and 0 deletions.
  1. +1 −0 bin/enterprise
  2. +3 −0 lib/enterprise/file_loader.rb
  3. +1 −0 lib/enterprise/sexml.rb
View
@@ -19,6 +19,7 @@ ARGV.each do |path|
end
files.each do |path|
+ $stderr.puts path if ENV['ENTERPRISE_DEBUG']
sexml = Enterprise::SEXML File.read(path), path
File.open(path.sub(/\.rb/, '.xml'), 'wb') do |f|
sexml.write_to f
@@ -1,8 +1,11 @@
module Enterprise
module FileLoader
def self.load filename, options = nil, &block
+ return true if $".include?(filename) # bug in polyglot
+
$stderr.puts filename if ENV['ENTERPRISE_DEBUG']
sexml = Nokogiri::XML(File.read(filename)) { |cmd| cmd.noblanks }
+ $" << filename
Kernel.eval sexml.to_ruby, TOPLEVEL_BINDING
end
end
View
@@ -4,6 +4,7 @@
module Enterprise
def self.SEXML codes, filename = nil
sexp = RubyParser.new.parse codes, filename
+ sexp ||= s(:nil)
doc = sexp.to_xml
doc.encoding = "UTF-8"
doc

0 comments on commit 7c41295

Please sign in to comment.