1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* remove trailing spaces.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-07-09 23:41:44 +00:00
parent 47f0248b08
commit 71110cb745
10 changed files with 29 additions and 29 deletions

View file

@ -278,7 +278,7 @@ For detail, see the MSDN[http://msdn.microsoft.com/library/en-us/sysinfo/base/pr
def CreateKey(hkey, name, opt, desired) def CreateKey(hkey, name, opt, desired)
result = packhandle(0) result = packhandle(0)
disp = packdw(0) disp = packdw(0)
check RegCreateKeyExW.call(hkey, make_wstr(name), 0, 0, opt, desired, check RegCreateKeyExW.call(hkey, make_wstr(name), 0, 0, opt, desired,
0, result, disp) 0, result, disp)
[ unpackhandle(result), unpackdw(disp) ] [ unpackhandle(result), unpackdw(disp) ]

View file

@ -1013,20 +1013,20 @@ module Gem
def register_default_spec(spec) def register_default_spec(spec)
new_format, prefix_pattern = nil new_format, prefix_pattern = nil
spec.files.each do |file| spec.files.each do |file|
if new_format == nil if new_format == nil
new_format = spec.require_paths.any? {|path| file.start_with? path} new_format = spec.require_paths.any? {|path| file.start_with? path}
prefix_group = spec.require_paths.map {|f| f + "/"}.join("|") prefix_group = spec.require_paths.map {|f| f + "/"}.join("|")
prefix_pattern = /^(#{prefix_group})/ prefix_pattern = /^(#{prefix_group})/
end end
if new_format if new_format
file = file.sub(prefix_pattern, "") file = file.sub(prefix_pattern, "")
next unless $~ next unless $~
end end
@path_to_default_spec_map[file] = spec @path_to_default_spec_map[file] = spec
end end
end end

View file

@ -46,7 +46,7 @@ Some examples of 'gem' usage.
* Update all gems on your system: * Update all gems on your system:
gem update gem update
* Update your local version of RubyGems * Update your local version of RubyGems
gem update --system gem update --system

View file

@ -37,7 +37,7 @@ class Gem::Commands::InstallCommand < Gem::Command
'install the listed gems') do |v,o| 'install the listed gems') do |v,o|
o[:gemdeps] = v o[:gemdeps] = v
end end
add_option(:"Install/Update", '--default', add_option(:"Install/Update", '--default',
'Add the gem\'s full specification to', 'Add the gem\'s full specification to',
'specifications/default and extract only its bin') do |v,o| 'specifications/default and extract only its bin') do |v,o|
@ -157,7 +157,7 @@ to write the specification by hand. For example:
alert_error "Can't use --version w/ multiple gems. Use name:ver instead." alert_error "Can't use --version w/ multiple gems. Use name:ver instead."
terminate_interaction 1 terminate_interaction 1
end end
# load post-install hooks appropriate to options # load post-install hooks appropriate to options
if options[:install_as_default] if options[:install_as_default]
require 'rubygems/install_default_message' require 'rubygems/install_default_message'

View file

@ -110,7 +110,7 @@ with extensions.
Gem::RemoteFetcher.fetcher.download_to_cache dep Gem::RemoteFetcher.fetcher.download_to_cache dep
end end
env_shebang = env_shebang =
if options.include? :env_shebang then if options.include? :env_shebang then
options[:env_shebang] options[:env_shebang]
else else

View file

@ -212,17 +212,17 @@ class Gem::Installer
FileUtils.rm_rf gem_dir FileUtils.rm_rf gem_dir
FileUtils.mkdir_p gem_dir FileUtils.mkdir_p gem_dir
if @options[:install_as_default] if @options[:install_as_default]
extract_bin extract_bin
write_default_spec write_default_spec
else else
extract_files extract_files
build_extensions build_extensions
write_build_info_file write_build_info_file
run_post_build_hooks run_post_build_hooks
generate_bin generate_bin
write_spec write_spec
write_cache_file write_cache_file
@ -349,11 +349,11 @@ class Gem::Installer
file.fsync rescue nil # for filesystems without fsync(2) file.fsync rescue nil # for filesystems without fsync(2)
end end
end end
## ##
# Writes the full .gemspec specification (in Ruby) to the gem home's # Writes the full .gemspec specification (in Ruby) to the gem home's
# specifications/default directory. # specifications/default directory.
def write_default_spec def write_default_spec
File.open(default_spec_file, "w") do |file| File.open(default_spec_file, "w") do |file|
file.puts spec.to_ruby file.puts spec.to_ruby
@ -738,12 +738,12 @@ EOF
def extract_files def extract_files
@package.extract_files gem_dir @package.extract_files gem_dir
end end
## ##
# Extracts only the bin/ files from the gem into the gem directory. # Extracts only the bin/ files from the gem into the gem directory.
# This is used by default gems to allow a gem-aware stub to function # This is used by default gems to allow a gem-aware stub to function
# without the full gem installed. # without the full gem installed.
def extract_bin def extract_bin
@package.extract_files gem_dir, "bin/*" @package.extract_files gem_dir, "bin/*"
end end

View file

@ -340,7 +340,7 @@ EOM
open_tar_gz io do |tar| open_tar_gz io do |tar|
tar.each do |entry| tar.each do |entry|
next unless File.fnmatch pattern, entry.full_name next unless File.fnmatch pattern, entry.full_name
destination = install_location entry.full_name, destination_dir destination = install_location entry.full_name, destination_dir
FileUtils.rm_rf destination FileUtils.rm_rf destination

View file

@ -1112,29 +1112,29 @@ class TestGem < Gem::TestCase
assert_equal '["a-1", "b-1", "c-1"]', out.strip assert_equal '["a-1", "b-1", "c-1"]', out.strip
end end
def test_register_default_spec def test_register_default_spec
Gem.clear_default_specs Gem.clear_default_specs
old_style = Gem::Specification.new do |spec| old_style = Gem::Specification.new do |spec|
spec.files = ["foo.rb", "bar.rb"] spec.files = ["foo.rb", "bar.rb"]
end end
Gem.register_default_spec old_style Gem.register_default_spec old_style
assert_equal old_style, Gem.find_unresolved_default_spec("foo.rb") assert_equal old_style, Gem.find_unresolved_default_spec("foo.rb")
assert_equal old_style, Gem.find_unresolved_default_spec("bar.rb") assert_equal old_style, Gem.find_unresolved_default_spec("bar.rb")
assert_equal nil, Gem.find_unresolved_default_spec("baz.rb") assert_equal nil, Gem.find_unresolved_default_spec("baz.rb")
Gem.clear_default_specs Gem.clear_default_specs
new_style = Gem::Specification.new do |spec| new_style = Gem::Specification.new do |spec|
spec.files = ["lib/foo.rb", "ext/bar.rb", "bin/exec", "README"] spec.files = ["lib/foo.rb", "ext/bar.rb", "bin/exec", "README"]
spec.require_paths = ["lib", "ext"] spec.require_paths = ["lib", "ext"]
end end
Gem.register_default_spec new_style Gem.register_default_spec new_style
assert_equal new_style, Gem.find_unresolved_default_spec("foo.rb") assert_equal new_style, Gem.find_unresolved_default_spec("foo.rb")
assert_equal new_style, Gem.find_unresolved_default_spec("bar.rb") assert_equal new_style, Gem.find_unresolved_default_spec("bar.rb")
assert_equal nil, Gem.find_unresolved_default_spec("exec") assert_equal nil, Gem.find_unresolved_default_spec("exec")

View file

@ -6,7 +6,7 @@ class TestGemDependencyResolverDependencyConflict < Gem::TestCase
def test_explanation def test_explanation
root = root =
dependency_request dep('net-ssh', '>= 2.0.13'), 'rye', '0.9.8' dependency_request dep('net-ssh', '>= 2.0.13'), 'rye', '0.9.8'
child = child =
dependency_request dep('net-ssh', '>= 2.6.5'), 'net-ssh', '2.2.2', root dependency_request dep('net-ssh', '>= 2.6.5'), 'net-ssh', '2.2.2', root
conflict = conflict =
@ -23,7 +23,7 @@ class TestGemDependencyResolverDependencyConflict < Gem::TestCase
def test_request_path def test_request_path
root = root =
dependency_request dep('net-ssh', '>= 2.0.13'), 'rye', '0.9.8' dependency_request dep('net-ssh', '>= 2.0.13'), 'rye', '0.9.8'
child = child =
dependency_request dep('net-ssh', '>= 2.6.5'), 'net-ssh', '2.2.2', root dependency_request dep('net-ssh', '>= 2.6.5'), 'net-ssh', '2.2.2', root
conflict = conflict =

View file

@ -600,7 +600,7 @@ gems:
skip 'openssl is missing' unless defined?(OpenSSL::SSL) skip 'openssl is missing' unless defined?(OpenSSL::SSL)
ssl_server = self.class.start_ssl_server({ ssl_server = self.class.start_ssl_server({
:SSLVerifyClient => :SSLVerifyClient =>
OpenSSL::SSL::VERIFY_PEER|OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT}) OpenSSL::SSL::VERIFY_PEER|OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT})
temp_ca_cert = File.join(DIR, 'ca_cert.pem') temp_ca_cert = File.join(DIR, 'ca_cert.pem')
@ -617,7 +617,7 @@ gems:
skip 'openssl is missing' unless defined?(OpenSSL::SSL) skip 'openssl is missing' unless defined?(OpenSSL::SSL)
ssl_server = self.class.start_ssl_server({ ssl_server = self.class.start_ssl_server({
:SSLVerifyClient => :SSLVerifyClient =>
OpenSSL::SSL::VERIFY_PEER|OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT}) OpenSSL::SSL::VERIFY_PEER|OpenSSL::SSL::VERIFY_FAIL_IF_NO_PEER_CERT})
temp_ca_cert = File.join(DIR, 'ca_cert.pem') temp_ca_cert = File.join(DIR, 'ca_cert.pem')