gem-manage-sources 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -27,9 +27,13 @@ To remove a source
27
27
 
28
28
  gem manage_sources --remove http://source.com
29
29
 
30
+ == Links
31
+
32
+ * Bugtracker: http://github.com/britt/gem-manage-sources/issues
33
+ * Code Metrics: http://bit.ly/6CJtPx
34
+
30
35
  == TODO
31
36
 
32
- * Sources are not being removed when they go active...doh.
33
37
  * Documentation
34
38
  * JRuby (and *Ruby) support
35
39
  * Find a better name
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.2.3
@@ -54,7 +54,7 @@ module Gem
54
54
  list
55
55
  end
56
56
 
57
- def check_sources
57
+ def check_sources
58
58
  sources.unchecked.concat(currently_loaded_sources)
59
59
  sources.verify
60
60
  sources.sync
@@ -65,9 +65,9 @@ module Gem
65
65
  def add_sources(sources_to_add)
66
66
  sources_to_add.each do |source|
67
67
  if sources.add(source)
68
- puts "Added #{source} to gem sources."
68
+ say "Added #{source} to gem sources."
69
69
  else
70
- puts "** #{source} Unavailable ** Added to the list of inactive sources. "
70
+ say "** #{source} Unavailable ** Added to the list of inactive sources. "
71
71
  end
72
72
  end
73
73
  sources.dump(ManageSourcesCommand.sources_file)
@@ -76,21 +76,21 @@ module Gem
76
76
  def remove_sources(sources_to_remove)
77
77
  sources_to_remove.each do |source|
78
78
  sources.remove(source)
79
- puts "Removed #{source} from gem sources."
79
+ say "Removed #{source} from gem sources."
80
80
  end
81
81
  sources.dump(ManageSourcesCommand.sources_file)
82
82
  end
83
83
 
84
84
  def list
85
- puts "*** CURRENT SOURCES ***"
86
- puts ""
87
- puts "** ACTIVE SOURCES **"
88
- puts ""
89
- sources.active.each { |source| puts source }
90
- puts ""
91
- puts "** INACTIVE SOURCES **"
92
- puts ""
93
- sources.inactive.each { |source| puts source }
85
+ say "*** CURRENT SOURCES ***"
86
+ say ""
87
+ say "** ACTIVE SOURCES **"
88
+ say ""
89
+ sources.active.each { |source| say source }
90
+ say ""
91
+ say "** INACTIVE SOURCES **"
92
+ say ""
93
+ sources.inactive.each { |source| say source }
94
94
  end
95
95
 
96
96
  private
@@ -98,6 +98,10 @@ module Gem
98
98
  def sources
99
99
  @sources ||= Gem::Sources::List.load_file(ManageSourcesCommand.sources_file)
100
100
  end
101
+
102
+ def say(message)
103
+ super(message) unless ENV['QUIET']
104
+ end
101
105
  end
102
106
  end
103
107
  end
@@ -4,7 +4,7 @@ require 'net/http'
4
4
  module Gem
5
5
  module Sources
6
6
  def currently_loaded_sources
7
- `gem sources`.split("\n").select { |s| s.start_with?('http') }
7
+ `gem sources`.split("\n").select { |s| /http/ =~ s }
8
8
  end
9
9
 
10
10
  class List
@@ -5,7 +5,7 @@ describe Gem::Sources do
5
5
 
6
6
  describe "#currently_loaded_sources" do
7
7
  it "should load all of the sources from 'gem sources'" do
8
- currently_loaded_sources.should == `gem sources`.split("\n").select { |s| s.start_with?('http') }
8
+ currently_loaded_sources.should == `gem sources`.split("\n").select { |s| /http/ =~ s }
9
9
  end
10
10
  end
11
11
 
data/spec/spec_helper.rb CHANGED
@@ -6,6 +6,8 @@ require 'spec/autorun'
6
6
  require 'pp'
7
7
  require 'tmpdir'
8
8
 
9
+ ENV['QUIET'] = 'true'
10
+
9
11
  Spec::Runner.configure do |config|
10
12
 
11
13
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem-manage-sources
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Britt Crawford