Skip to content

Commit

Permalink
Hide gemcutter_key in gem env
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://rubyforge.org/var/svn/rubygems/trunk@2498 3d4018f9-ac1a-0410-99e9-8a154d859a19
  • Loading branch information
drbrain committed Apr 22, 2010
1 parent 20d8202 commit 6b64042
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

* lib/rubygems/commands/contents_command.rb: Make --prefix the
default as specified in --help. Bug #27211 by Mamoru Tasaka.
* lib/rubygems/commands/environment_command.rb: Hide gemcutter_key to
for security.

2010-04-21 Evan Phoenix <evan@fallingsnow.net>

Expand Down
1 change: 1 addition & 0 deletions lib/rubygems/commands/environment_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def execute

out << " - GEM CONFIGURATION:\n"
Gem.configuration.each do |name, value|
value = value.gsub(/./, 'X') if name == 'gemcutter_key'
out << " - #{name.inspect} => #{value.inspect}\n"
end

Expand Down
2 changes: 2 additions & 0 deletions test/test_gem_commands_environment_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def setup
def test_execute
orig_sources = Gem.sources.dup
Gem.sources.replace %w[http://gems.example.com]
Gem.configuration['gemcutter_key'] = 'blah'

@cmd.send :handle_options, %w[]

Expand All @@ -32,6 +33,7 @@ def test_execute
assert_match %r|GEM PATHS:|, @ui.output
assert_match %r|- #{Regexp.escape @gemhome}|, @ui.output
assert_match %r|GEM CONFIGURATION:|, @ui.output
assert_match %r|"gemcutter_key" => "XXXX"|, @ui.output
assert_match %r|:verbose => |, @ui.output
assert_match %r|REMOTE SOURCES:|, @ui.output
assert_equal '', @ui.error
Expand Down

0 comments on commit 6b64042

Please sign in to comment.