Permalink
Browse files

print to stderr, so output stays clean

  • Loading branch information...
grosser committed May 9, 2011
1 parent ec73c2c commit 3f0a8e720d0c9305e7d0a6f5f3f200b8dd0f7846
Showing with 8 additions and 9 deletions.
  1. +2 −3 gem-dependent.gemspec
  2. +6 −6 lib/rubygems/dependent.rb
View
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Michael Grosser"]
- s.date = %q{2010-11-06}
+ s.date = %q{2011-05-09}
s.email = %q{grosser.michael@gmail.com}
s.files = [
"Gemfile",
@@ -35,14 +35,13 @@ gem install parallel
}
s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"]
- s.rubygems_version = %q{1.3.7}
+ s.rubygems_version = %q{1.6.2}
s.summary = %q{See which gems depend on your gems}
s.test_files = [
"spec/dependent_spec.rb"
]
if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 3
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
View
@@ -19,13 +19,13 @@ def self.find(gem, options={})
end
if options[:progress]
- puts "Downloading specs for #{specs_and_sources.size} gems"
+ $stderr.puts "Downloading specs for #{specs_and_sources.size} gems"
end
gems_and_dependencies = fetch_all_dependencies(specs_and_sources, options) do
print_dot if options[:progress]
end
- print "\n" if options[:progress]
+ $stderr.print "\n" if options[:progress]
select_dependent(gems_and_dependencies, gem)
end
@@ -61,8 +61,8 @@ def self.select_dependent(gems_and_dependencies, gem)
end
def self.print_dot
- print '.'
- $stdout.flush if rand(20) == 0 # make progress visible
+ $stderr.print '.'
+ $stderr.flush if rand(20) == 0 # make progress visible
end
def self.all_specs_and_sources
@@ -72,7 +72,7 @@ def self.all_specs_and_sources
prerelease = false
matcher = Gem::Dependency.new(//, Gem::Requirement.default) # any name, any version
specs_and_sources = fetcher.find_matching matcher, all, matching_platform, prerelease
- uniq_by(specs_and_sources){|a| a.first.first }
+ uniq_by(specs_and_sources){|a| a.first.first }
end
# get unique elements from an array (last found is used)
@@ -104,4 +104,4 @@ def self.with_changed_gem_source(sources)
end
end
end
-end
+end

0 comments on commit 3f0a8e7

Please sign in to comment.