From 03d09105f3e5a09c05b54ae5f5d7bbc45cc18ddc Mon Sep 17 00:00:00 2001 From: Bill Niblock Date: Sun, 14 May 2017 14:12:32 -0400 Subject: [PATCH] gardner.rb: Add debug options and information --- lib/sapling/gardner.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/sapling/gardner.rb b/lib/sapling/gardner.rb index c09a759..3a75dbb 100644 --- a/lib/sapling/gardner.rb +++ b/lib/sapling/gardner.rb @@ -48,8 +48,10 @@ module Gardner # Format and display the trunk # # @param trunk [Hash] The trunk hash - def self.display_trunk(trunk) + # @param debug [Boolean] The status of showing debug information + def self.display_trunk(trunk, debug=false) 40.times { print "-" } + puts "\n[ Trunk ]\n" if debug puts "\n#{trunk["trunk"]}" 40.times { print "-" } puts "\n" @@ -60,7 +62,7 @@ module Gardner # @param branch [Hash] A branch data set # @param branch_no [Integer] The branch number # @param debug [Boolean] Status of showing debug information - def self.display_branch(branch, branch_no, debug) + def self.display_branch(branch, branch_no, debug=false) puts "\n[ Branch: #{branch_no} ]" if debug puts "\n#{branch["desc"]}\n\n"