Skip to content

Commit

Permalink
Set default config output_style
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Bridges committed Apr 7, 2012
1 parent e6a4bcc commit 739c6b3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/transplant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@
%w[version configuration stats planter].each do |klass|
require "transplant/#{klass}"
end

Transplant::Configuration.setup do |config|
config.root_path = Rails.root if defined?(Rails)
config.output_style = :both
end
4 changes: 3 additions & 1 deletion lib/transplant/stats.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ def output_to_file
end

def add_to_results(output)
@result_set << output
style = ::Transplant::Configuration.output_style
puts output if [:both, :output].include?(style)
@result_set << output if [:both, :file].include?(style)
end

def output(header, input = {}, depth = 0, sub_output = false)
Expand Down

0 comments on commit 739c6b3

Please sign in to comment.