Skip to content
Browse files

Use $stdout, $stderr instead of STDOUT, STDERR. See http://blog.segme…

  • Loading branch information...
1 parent 282bb87 commit 919eaea426a6fcfd1d4bc6e2879fa26006402158 @kjwierenga committed May 7, 2010
Showing with 8 additions and 8 deletions.
  1. +1 −1 bin/ralf
  2. +6 −6 lib/ralf.rb
  3. +1 −1 lib/ralf/option_parser.rb
View
2 bin/ralf
@@ -37,5 +37,5 @@ begin
Ralf.run(options)
end
rescue => e
- STDERR.puts "Error: #{e}"
+ $stderr.puts "Error: #{e}"
end
View
12 lib/ralf.rb
@@ -69,10 +69,10 @@ def self.run(params)
end
def run
- STDOUT.puts "Processing: #{range.begin == range.end ? range.begin : range}"
+ $stdout.puts "Processing: #{range.begin == range.end ? range.begin : range}"
find_buckets_with_logging(@config[:buckets])
- STDOUT.puts @buckets_with_logging.collect {|buc| buc.logging_info.inspect } if ENV['DEBUG']
+ $stdout.puts @buckets_with_logging.collect {|buc| buc.logging_info.inspect } if ENV['DEBUG']
@buckets_with_logging.each do |bucket|
save_logging(bucket)
merge_to_combined(bucket)
@@ -82,11 +82,11 @@ def run
def list_buckets(names)
find_buckets(names).each do |bucket|
- STDOUT.print "#{bucket.name}"
+ $stdout.print "#{bucket.name}"
if bucket.logging_info[:enabled]
- STDOUT.puts " [#{bucket.logging_info[:targetbucket]}/#{bucket.logging_info[:targetprefix]}]"
+ $stdout.puts " [#{bucket.logging_info[:targetbucket]}/#{bucket.logging_info[:targetprefix]}]"
else
- STDOUT.puts " [-]"
+ $stdout.puts " [-]"
end
end
end
@@ -97,7 +97,7 @@ def find_buckets(names)
if names
names.map do |name|
bucket = @s3.bucket(name)
- STDOUT.puts "Bucket '#{name}' not found." if bucket.nil?
+ $stdout.puts "Bucket '#{name}' not found." if bucket.nil?
bucket
end
else
View
2 lib/ralf/option_parser.rb
@@ -3,7 +3,7 @@
class Ralf::OptionParser
- def self.parse(args, output = STDOUT)
+ def self.parse(args, output = $stdout)
options = {}
opts = ::OptionParser.new do |opts|

0 comments on commit 919eaea

Please sign in to comment.
Something went wrong with that request. Please try again.