[DRE-commits] [ruby-org] 83/303: Make it easier to get debugging output.

Jérémy Bobbio lunar at alioth.debian.org
Fri Aug 9 17:33:32 UTC 2013


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch master
in repository ruby-org.

commit ba2e6759dfd1f1bb83d04f3bc6aa264a384b6eb4
Author: Brian Dewey <bdewey at gmail.com>
Date:   Wed Jan 27 01:02:17 2010 -0800

    Make it easier to get debugging output.
---
 bin/org-ruby                  |    5 +++++
 lib/org-ruby/output_buffer.rb |    2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/bin/org-ruby b/bin/org-ruby
index 587789b..2a2c33f 100755
--- a/bin/org-ruby
+++ b/bin/org-ruby
@@ -17,6 +17,10 @@ options_parser = OptionParser.new do |opts|
     options[:help] = true
   end
 
+  opts.on("-d", "--debug", "Run with $DEBUG true") do |v|
+    options[:debug] = true
+  end
+
   opts.on("-t", "--translate FORMAT", [:html, :textile],
           "Translate the ORG file to the specified format.") do |v|
     options[:format] = v
@@ -30,6 +34,7 @@ begin
   else
     data = IO.read(ARGV[0])
     p = Orgmode::Parser.new(data)
+    $DEBUG = true if options[:debug]
     puts p.to_html if options[:format] == :html
     puts p.to_textile if options[:format] == :textile
   end
diff --git a/lib/org-ruby/output_buffer.rb b/lib/org-ruby/output_buffer.rb
index 4c704ba..5e15878 100644
--- a/lib/org-ruby/output_buffer.rb
+++ b/lib/org-ruby/output_buffer.rb
@@ -44,7 +44,7 @@ module Orgmode
       @headline_number_stack = []
 
       @logger = Logger.new(STDERR)
-      if ENV['DEBUG']
+      if ENV['DEBUG'] or $DEBUG
         @logger.level = Logger::DEBUG
       else
         @logger.level = Logger::WARN

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-org.git



More information about the Pkg-ruby-extras-commits mailing list