Skip to content

Commit

Permalink
Merge branch 'guard-clause' into confident
Browse files Browse the repository at this point in the history
Conflicts:
	lib/cowsay.rb
  • Loading branch information
Avdi Grimm committed Jan 11, 2010
2 parents 37503fe + add4ed3 commit f5a78d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/cowsay.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def initialize(options={})
end end


def say(message, options={}) def say(message, options={})
return "" if message.nil?
options[:cowfile] and assert(options[:cowfile].to_s !~ /^\s*$/) options[:cowfile] and assert(options[:cowfile].to_s !~ /^\s*$/)
command = "cowsay" command = "cowsay"
if options[:strings] && options[:strings][:eyes] if options[:strings] && options[:strings][:eyes]
Expand All @@ -31,7 +32,6 @@ def say(message, options={})
destination = WithPath.new(options[:out]).path destination = WithPath.new(options[:out]).path


messages = Array(message) messages = Array(message)
results = []
results = messages.map { |message| results = messages.map { |message|
checked_popen(command, "w+", lambda{message}) do |process| checked_popen(command, "w+", lambda{message}) do |process|
process.write(message) process.write(message)
Expand Down

0 comments on commit f5a78d8

Please sign in to comment.