Commit 437c0b30 authored by Samuel Giddins's avatar Samuel Giddins

[Bundle] Update RuboCop to 0.34

parent f650a391
# This configuration was generated by `rubocop --auto-gen-config` # This configuration was generated by
# on 2015-03-15 18:04:06 -0700 using RuboCop version 0.29.1. # `rubocop --auto-gen-config`
# on 2015-09-25 20:32:21 -0500 using RuboCop version 0.34.2.
# The point is for the user to remove these configuration records # The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base. # one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new # Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again. # versions of RuboCop, may require this file to be generated again.
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: AlignWith, SupportedStyles, AutoCorrect.
Lint/EndAlignment:
Enabled: false
# Offense count: 1
Lint/NonLocalExitFromIterator:
Exclude:
- 'spec/unit/installer_spec.rb'
# Offense count: 3 # Offense count: 3
Lint/UselessAccessModifier: Lint/UselessAccessModifier:
Enabled: false Exclude:
- 'lib/cocoapods/config.rb'
- 'lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb'
# Offense count: 1278 # Offense count: 1511
# Configuration parameters: AllowURI, URISchemes. # Configuration parameters: AllowURI, URISchemes.
Metrics/LineLength: Metrics/LineLength:
Max: 292 Max: 281
# Offense count: 12
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes.
Style/RegexpLiteral:
Exclude:
- 'lib/cocoapods/installer/file_references_installer.rb'
- 'lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb'
- 'lib/cocoapods/sandbox/path_list.rb'
- 'lib/cocoapods/sources_manager.rb'
- 'lib/cocoapods/validator.rb'
- 'spec/integration.rb'
- 'spec/unit/external_sources/path_source_spec.rb'
- 'spec/unit/external_sources/podspec_source_spec.rb'
- 'spec/unit/resolver_spec.rb'
...@@ -106,9 +106,9 @@ GEM ...@@ -106,9 +106,9 @@ GEM
thread_safe (~> 0.3, >= 0.3.4) thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1) tzinfo (~> 1.1)
addressable (2.3.6) addressable (2.3.6)
ast (2.0.0) ast (2.1.0)
astrolabe (1.3.0) astrolabe (1.3.1)
parser (>= 2.2.0.pre.3, < 3.0) parser (~> 2.2)
awesome_print (1.6.1) awesome_print (1.6.1)
bacon (1.2.0) bacon (1.2.0)
clintegracon (0.6.1) clintegracon (0.6.1)
...@@ -147,9 +147,9 @@ GEM ...@@ -147,9 +147,9 @@ GEM
nap (1.0.0) nap (1.0.0)
netrc (0.7.8) netrc (0.7.8)
notify (0.5.2) notify (0.5.2)
parser (2.2.0.3) parser (2.2.2.6)
ast (>= 1.1, < 3.0) ast (>= 1.1, < 3.0)
powerpack (0.1.0) powerpack (0.1.1)
prettybacon (0.0.2) prettybacon (0.0.2)
bacon (~> 1.2) bacon (~> 1.2)
pry (0.10.1) pry (0.10.1)
...@@ -163,14 +163,14 @@ GEM ...@@ -163,14 +163,14 @@ GEM
ffi (>= 0.5.0) ffi (>= 0.5.0)
rb-kqueue (0.2.3) rb-kqueue (0.2.3)
ffi (>= 0.5.0) ffi (>= 0.5.0)
rubocop (0.29.1) rubocop (0.34.2)
astrolabe (~> 1.3) astrolabe (~> 1.3)
parser (>= 2.2.0.1, < 3.0) parser (>= 2.2.2.5, < 3.0)
powerpack (~> 0.1) powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0) rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.4) ruby-progressbar (~> 1.4)
ruby-prof (0.15.2) ruby-prof (0.15.2)
ruby-progressbar (1.7.1) ruby-progressbar (1.7.5)
safe_yaml (1.0.4) safe_yaml (1.0.4)
slop (3.6.0) slop (3.6.0)
sparkr (0.4.1) sparkr (0.4.1)
......
...@@ -23,7 +23,9 @@ module Pod ...@@ -23,7 +23,9 @@ module Pod
def initialize(argv) def initialize(argv)
@shallow = argv.flag?('shallow', false) @shallow = argv.flag?('shallow', false)
@name, @url, @branch = argv.shift_argument, argv.shift_argument, argv.shift_argument @name = argv.shift_argument
@url = argv.shift_argument
@branch = argv.shift_argument
super super
end end
......
...@@ -48,7 +48,7 @@ module Pod ...@@ -48,7 +48,7 @@ module Pod
set = sets.find { |s| s.name == spec } set = sets.find { |s| s.name == spec }
else else
names = sets.map(&:name) * ', ' names = sets.map(&:name) * ', '
raise Informative, "More than one spec found for '#{ spec }':\n#{ names }" raise Informative, "More than one spec found for '#{spec}':\n#{names}"
end end
unless show_all unless show_all
...@@ -77,7 +77,7 @@ module Pod ...@@ -77,7 +77,7 @@ module Pod
versions.each do |version| versions.each do |version|
spec = source.specification(set.name, version) spec = source.specification(set.name, version)
paths += "#{ pathname_from_spec(spec, source) }\n" paths += "#{pathname_from_spec(spec, source)}\n"
end end
end end
...@@ -102,7 +102,7 @@ module Pod ...@@ -102,7 +102,7 @@ module Pod
end end
if !best_source || !best_version if !best_source || !best_version
raise Informative, "Unable to locate highest known specification for `#{ set.name }'" raise Informative, "Unable to locate highest known specification for `#{set.name}'"
end end
[best_source.specification(set.name, best_version), best_source] [best_source.specification(set.name, best_version), best_source]
......
...@@ -37,7 +37,7 @@ module Pod ...@@ -37,7 +37,7 @@ module Pod
query = @use_regex ? @query : Regexp.escape(@query) query = @use_regex ? @query : Regexp.escape(@query)
filepath = if @show_all filepath = if @show_all
specs = get_path_of_spec(query, @show_all).split(/\n/) specs = get_path_of_spec(query, @show_all).split(/\n/)
index = UI.choose_from_array(specs, "Which spec would you like to print [1-#{ specs.count }]? ") index = UI.choose_from_array(specs, "Which spec would you like to print [1-#{specs.count}]? ")
specs[index] specs[index]
else else
get_path_of_spec(query) get_path_of_spec(query)
......
...@@ -15,7 +15,8 @@ module Pod ...@@ -15,7 +15,8 @@ module Pod
] ]
def initialize(argv) def initialize(argv)
@name_or_url, @url = argv.shift_argument, argv.shift_argument @name_or_url = argv.shift_argument
@url = argv.shift_argument
super super
end end
......
...@@ -45,7 +45,7 @@ module Pod ...@@ -45,7 +45,7 @@ module Pod
end end
exec_editor(filepath.to_s) if File.exist? filepath exec_editor(filepath.to_s) if File.exist? filepath
raise Informative, "#{ filepath } doesn't exist." raise Informative, "#{filepath} doesn't exist."
end end
# Looks up an executable in the search paths # Looks up an executable in the search paths
......
...@@ -34,7 +34,7 @@ module Pod ...@@ -34,7 +34,7 @@ module Pod
result = cache.download_pod(request) result = cache.download_pod(request)
else else
require 'cocoapods/installer/pod_source_preparer' require 'cocoapods/installer/pod_source_preparer'
result, _ = download_request(request, target) result, = download_request(request, target)
Installer::PodSourcePreparer.new(result.spec, result.location).prepare! Installer::PodSourcePreparer.new(result.spec, result.location).prepare!
end end
......
...@@ -54,13 +54,16 @@ module Pod ...@@ -54,13 +54,16 @@ module Pod
if Config.instance.verbose? if Config.instance.verbose?
UI.message("$ #{full_command}") UI.message("$ #{full_command}")
stdout, stderr = Indenter.new(STDOUT), Indenter.new(STDERR) stdout = Indenter.new(STDOUT)
stderr = Indenter.new(STDERR)
else else
stdout, stderr = Indenter.new, Indenter.new stdout = Indenter.new
stderr = Indenter.new
end end
status = popen3(bin, command, stdout, stderr) status = popen3(bin, command, stdout, stderr)
stdout, stderr = stdout.join, stderr.join stdout = stdout.join
stderr = stderr.join
output = stdout + stderr output = stdout + stderr
unless status.success? unless status.success?
if raise_on_failure if raise_on_failure
...@@ -197,7 +200,7 @@ module Pod ...@@ -197,7 +200,7 @@ module Pod
# #
def <<(value) def <<(value)
super super
io << "#{ indent }#{ value }" if io io << "#{indent}#{value}" if io
end end
end end
end end
......
...@@ -77,7 +77,7 @@ module Pod ...@@ -77,7 +77,7 @@ module Pod
if license_file.exist? if license_file.exist?
text = IO.read(license_file) text = IO.read(license_file)
else else
UI.warn "Unable to read the license file `#{license_file }` " \ UI.warn "Unable to read the license file `#{license_file}` " \
"for the spec `#{spec}`" "for the spec `#{spec}`"
end end
end end
......
...@@ -105,7 +105,7 @@ module Pod ...@@ -105,7 +105,7 @@ module Pod
if registrations if registrations
hooks = registrations[name] hooks = registrations[name]
if hooks if hooks
UI.message "- Running #{name.to_s.gsub('_', ' ')} hooks" do UI.message "- Running #{name.to_s.tr('_', ' ')} hooks" do
hooks.each do |hook| hooks.each do |hook|
next if whitelisted_plugins && !whitelisted_plugins.key?(hook.plugin_name) next if whitelisted_plugins && !whitelisted_plugins.key?(hook.plugin_name)
UI.message "- #{hook.plugin_name || 'unknown plugin'} from " \ UI.message "- #{hook.plugin_name || 'unknown plugin'} from " \
......
...@@ -732,7 +732,7 @@ module Pod ...@@ -732,7 +732,7 @@ module Pod
# information in the lockfile. # information in the lockfile.
# #
def integrate_user_project def integrate_user_project
UI.section "Integrating client #{'project'.pluralize(aggregate_targets.map(&:user_project_path).uniq.count) }" do UI.section "Integrating client #{'project'.pluralize(aggregate_targets.map(&:user_project_path).uniq.count)}" do
installation_root = config.installation_root installation_root = config.installation_root
integrator = UserProjectIntegrator.new(podfile, sandbox, installation_root, aggregate_targets) integrator = UserProjectIntegrator.new(podfile, sandbox, installation_root, aggregate_targets)
integrator.integrate! integrator.integrate!
......
...@@ -293,7 +293,7 @@ module Pod ...@@ -293,7 +293,7 @@ module Pod
if targets_by_distinctors.count > 1 if targets_by_distinctors.count > 1
# There are different sets of subspecs or the spec is used across different platforms # There are different sets of subspecs or the spec is used across different platforms
targets_by_distinctors.map do |distinctor, target_definitions| targets_by_distinctors.map do |distinctor, target_definitions|
specs, _ = *distinctor specs, = *distinctor
generate_pod_target(target_definitions, specs, :scoped => true) generate_pod_target(target_definitions, specs, :scoped => true)
end end
else else
......
...@@ -252,7 +252,8 @@ module Pod ...@@ -252,7 +252,8 @@ module Pod
def check_version_information(dir) def check_version_information(dir)
versions = version_information(dir) versions = version_information(dir)
unless repo_compatible?(dir) unless repo_compatible?(dir)
min, max = versions['min'], versions['max'] min = versions['min']
max = versions['max']
version_msg = (min == max) ? min : "#{min} - #{max}" version_msg = (min == max) ? min : "#{min} - #{max}"
raise Informative, "The `#{dir.basename}` repo requires " \ raise Informative, "The `#{dir.basename}` repo requires " \
"CocoaPods #{version_msg} (currently using #{Pod::VERSION})\n".red + "CocoaPods #{version_msg} (currently using #{Pod::VERSION})\n".red +
...@@ -293,7 +294,8 @@ module Pod ...@@ -293,7 +294,8 @@ module Pod
def repo_compatible?(dir) def repo_compatible?(dir)
versions = version_information(dir) versions = version_information(dir)
min, max = versions['min'], versions['max'] min = versions['min']
max = versions['max']
bin_version = Gem::Version.new(Pod::VERSION) bin_version = Gem::Version.new(Pod::VERSION)
supports_min = !min || bin_version >= Gem::Version.new(min) supports_min = !min || bin_version >= Gem::Version.new(min)
supports_max = !max || bin_version <= Gem::Version.new(max) supports_max = !max || bin_version <= Gem::Version.new(max)
......
...@@ -298,14 +298,14 @@ module Pod ...@@ -298,14 +298,14 @@ module Pod
# #
def choose_from_array(array, message) def choose_from_array(array, message)
array.each_with_index do |item, index| array.each_with_index do |item, index|
UI.puts "#{ index + 1 }: #{ item }" UI.puts "#{index + 1}: #{item}"
end end
UI.puts message UI.puts message
index = UI.gets.chomp.to_i - 1 index = UI.gets.chomp.to_i - 1
if index < 0 || index > array.count - 1 if index < 0 || index > array.count - 1
raise Informative, "#{ index + 1 } is invalid [1-#{ array.count }]" raise Informative, "#{index + 1} is invalid [1-#{array.count}]"
else else
index index
end end
......
...@@ -4,7 +4,9 @@ require File.expand_path('../../../spec_helper', __FILE__) ...@@ -4,7 +4,9 @@ require File.expand_path('../../../spec_helper', __FILE__)
module Pod module Pod
describe Installer::PreInstallHooksContext do describe Installer::PreInstallHooksContext do
it 'offers a convenience method to be generated' do it 'offers a convenience method to be generated' do
sandbox, podfile, lockfile = stub, stub, stub sandbox = stub
podfile = stub
lockfile = stub
result = Installer::PreInstallHooksContext.generate(sandbox, podfile, lockfile) result = Installer::PreInstallHooksContext.generate(sandbox, podfile, lockfile)
result.class.should == Installer::PreInstallHooksContext result.class.should == Installer::PreInstallHooksContext
......
...@@ -69,6 +69,7 @@ module Pod ...@@ -69,6 +69,7 @@ module Pod
def @installer.run_podfile_pre_install_hooks def @installer.run_podfile_pre_install_hooks
@hook_called = true @hook_called = true
end end
def @installer.clean_pod_sources def @installer.clean_pod_sources
@hook_called.should.be.true @hook_called.should.be.true
end end
...@@ -87,6 +88,7 @@ module Pod ...@@ -87,6 +88,7 @@ module Pod
def @installer.run_podfile_post_install_hooks def @installer.run_podfile_post_install_hooks
@hook_called = true @hook_called = true
end end
def @installer.write_pod_project def @installer.write_pod_project
@hook_called.should.be.true @hook_called.should.be.true
end end
...@@ -102,6 +104,7 @@ module Pod ...@@ -102,6 +104,7 @@ module Pod
def @installer.run_source_provider_hooks def @installer.run_source_provider_hooks
@hook_called = true @hook_called = true
end end
def @installer.analyze(*) def @installer.analyze(*)
@hook_called.should.be.true @hook_called.should.be.true
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment