Permalink
Browse files

make debug info optional

  • Loading branch information...
geraldb committed Jun 23, 2012
1 parent ce96aa1 commit d95abeb922d6d9ea03e32cb246b871d557811199
Showing with 43 additions and 7 deletions.
  1. +1 −1 Rakefile
  2. +5 −0 TODO.markdown
  3. +18 −3 lib/markdown/cli/runner.rb
  4. +11 −2 lib/markdown/config.rb
  5. +1 −1 lib/markdown/version.rb
  6. +7 −0 lib/markdown/wrapper.rb
View
@@ -14,7 +14,7 @@ Hoe.spec 'markdown' do
self.email = 'webslideshow@googlegroups.com'
self.extra_deps = [
- ['props','>= 0.2.0'],
+ ['props','>= 1.0.0'],
['textutils','>=0.2.0'],
['kramdown','>= 0.13.7']
]
View
@@ -0,0 +1,5 @@
+
+
+## Minor
+
+* in --about add version of gem dependencies (e.g. props etc.)
View
@@ -116,10 +116,22 @@ def run( args )
puts Markdown.banner
exit
end
+
+ cmd.on( '--about', "(Debug) Show more version info" ) do
+ puts
+ puts Markdown.banner
+ puts
- cmd.on( "--verbose", "Show debug trace" ) do
- logger.datetime_format = "%H:%H:%S"
- logger.level = Logger::DEBUG
+ # dump settings
+ Markdown.dump
+ puts
+
+ exit
+ end
+
+ cmd.on( "--verbose", "(Debug) Show debug trace" ) do
+ logger.datetime_format = "%H:%H:%S"
+ logger.level = Logger::DEBUG
end
## todo: add markdown.lib options (e.g. extensions,etc)
@@ -152,6 +164,9 @@ def run( args )
# force loading of config
Markdown.lib
+ Markdown.dump if logger.level == Logger::DEBUG # dump settings if verbose/debug flag on
+
+
logger.debug "args.length: #{args.length}"
logger.debug "args: >#{args.join(',')}<"
View
@@ -67,6 +67,17 @@ def initialize
require_markdown_libs()
end
+ def dump # for debugging dump all settings
+ puts "Markdown settings:"
+ @props_default.dump if @props_default
+ @props_home.dump if @props_home
+ @props_work.dump if @props_work
+
+ puts
+ puts "Markdown libs:"
+ puts " #{@libs.length} Markdown #{(@libs.length == 1) ? 'library' : 'libraries'} found: #{@libs.join(', ')}"
+ end
+
def markdown_extnames
@props.fetch( 'extnames', nil )
end
@@ -114,8 +125,6 @@ def require_markdown_libs
puts "Markdown library #{lib} not found. Use gem install #{lib} to install."
end
end
-
- puts " Found #{@libs.length} Markdown #{(@libs.length == 1) ? 'library' : 'libraries'}: #{@libs.join(', ')}"
end
def markdown_lib
View
@@ -1,3 +1,3 @@
module Markdown
- VERSION = '0.5.0.beta1'
+ VERSION = '1.0.0'
end
View
@@ -48,6 +48,13 @@ def self.filters
@@config.markdown_filters
end
+ def self.dump # dump settings for debug/verbose flag
+ if @@config.nil?
+ @@config = Config.new
+ end
+ @@config.dump
+ end
+
def self.new( content, options={} )

0 comments on commit d95abeb

Please sign in to comment.