summaryrefslogtreecommitdiff
path: root/lib/rubygems/specification_policy.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <[email protected]>2020-06-10 19:46:05 +0200
committerHiroshi SHIBATA <[email protected]>2020-06-15 21:20:37 +0900
commit955f1837a180d8936f90ab6cf039ccb8f751be72 ()
tree0d48749501febfccefda3b1376511c421d4118e4 /lib/rubygems/specification_policy.rb
parentef481c120c55bf0351a586739f9b5d704f3f7a7d (diff)
Use space inside block braces everywhere
To make rubygems code style consistent with bundler.
Notes: Merged: https://.com/ruby/ruby/pull/3229
-rw-r--r--lib/rubygems/specification_policy.rb14
1 files changed, 7 insertions, 7 deletions
@@ -154,7 +154,7 @@ class Gem::SpecificationPolicy
def validate_duplicate_dependencies # :nodoc:
# NOTE: see REFACTOR note in Gem::Dependency about types - this might be brittle
- seen = Gem::Dependency::TYPES.inject({}) { |types, type| types.merge({ type => {}}) }
error_messages = []
@specification.dependencies.each do |dep|
@@ -215,7 +215,7 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use:
end
end
if warning_messages.any?
- warning_messages.each { |warning_message| warning warning_message }
end
end
@@ -292,7 +292,7 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use:
def validate_non_files
return unless packaging
- non_files = @specification.files.reject {|x| File.file?(x) || File.symlink?(x)}
unless non_files.empty?
error "[\"#{non_files.join "\", \""}\"] are not files"
@@ -338,7 +338,7 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use:
String
end
- unless Array === val and val.all? {|x| x.kind_of?(klass)}
error "#{field} must be an Array of #{klass}"
end
end
@@ -369,7 +369,7 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use:
license value '#{license}' is invalid. Use a license identifier from
http://spdx.org/licenses or '#{Gem::Licenses::NONSTANDARD}' for a nonstandard license.
WARNING
- message += "Did you mean #{suggestions.map { |s| "'#{s}'"}.join(', ')}?\n" unless suggestions.nil?
warning(message)
end
end
@@ -433,7 +433,7 @@ http://spdx.org/licenses or '#{Gem::Licenses::NONSTANDARD}' for a nonstandard li
validate_shebang_line_in(executable)
end
- @specification.files.select { |f| File.symlink?(f) }.each do |file|
warning "#{file} is a symlink, which is not supported on all platforms"
end
end
@@ -461,7 +461,7 @@ http://spdx.org/licenses or '#{Gem::Licenses::NONSTANDARD}' for a nonstandard li
builder = Gem::Ext::Builder.new(@specification)
rake_extension = @specification.extensions.any? {|s| builder.builder_for(s) == Gem::Ext::RakeBuilder }
- rake_dependency = @specification.dependencies.any? {|d| d.name == 'rake'}
warning <<-WARNING if rake_extension && !rake_dependency
You have specified rake based extension, but rake is not added as dependency. It is recommended to add rake as a dependency in gemspec since there's no guarantee rake will be already installed.