Skip to content

Commit

Permalink
[Command::Spec::Linter] Minor improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiopelosin committed May 4, 2012
1 parent 43d8dc6 commit a942ac1
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions lib/cocoapods/command/spec.rb
Expand Up @@ -220,7 +220,9 @@ def notes
def peform_multiplatform_analysis
platform_names.each do |platform_name|
set_up_lint_environment
puts "\n\n#{spec} - Analyzing on #{Platform.new platform_name} platform.".green.reversed if config.verbose?
install_pod(platform_name)
puts "Building with xcodebuild.\n".yellow if config.verbose?
xcodebuild_output.concat(xcodebuild_output_for_platfrom(platform_name))
file_patterns_errors.concat(file_patterns_errors_for_platfrom(platform_name))
tear_down_lint_environment
Expand All @@ -232,13 +234,21 @@ def platform_names
end

def install_pod(platform_name)
puts "\n\n#{spec} - generating build errors for #{platform_name} platform".yellow.reversed if config.verbose?
podfile = podfile_from_spec(platform_name)
config.verbose
Installer.new(podfile).install!
config.silent
end

def podfile_from_spec(platform_name)
name = spec.name
podspec = file.realpath.to_s
podfile = Pod::Podfile.new do
platform platform_name
dependency name, :podspec => podspec
end
end

def set_up_lint_environment
tmp_dir.rmtree if tmp_dir.exist?
tmp_dir.mkpath
Expand Down Expand Up @@ -334,7 +344,7 @@ def github_source?
def deprecation_warnings
text = @file.read
deprecations = []
deprecations << "`config.ios?' and `config.osx' will be removed in version 0.7" if text. =~ /config\..os?/
deprecations << "`config.ios?' and `config.osx?' are deprecated and will be removed in version 0.7" if text. =~ /config\..?os.?/
deprecations << "The `post_install' hook is reserved for edge cases" if text. =~ /post_install/
deprecations
end
Expand Down Expand Up @@ -366,15 +376,6 @@ def xcodebuild_output_for_platfrom(platform_name)
messages
end

def podfile_from_spec(platform_name)
name = spec.name
podspec = file.realpath.to_s
podfile = Pod::Podfile.new do
platform platform_name
dependency name, :podspec => podspec
end
end

def process_xcode_build_output(output)
output_by_line = output.split("\n")
selected_lines = output_by_line.select do |l|
Expand Down

0 comments on commit a942ac1

Please sign in to comment.