Commit a16ba2de authored by Fabio Pelosin's avatar Fabio Pelosin

[Validator] Clean up

parent 7a148635
......@@ -6,11 +6,11 @@ end
gemspec
group :development do
# gem "cocoapods-core", :git => "git://github.com/CocoaPods/Core.git"
gem "cocoapods-core", :git => "git://github.com/CocoaPods/Core.git"
gem "xcodeproj", :git => "git://github.com/CocoaPods/Xcodeproj.git"
gem "cocoapods-downloader", :git => "git://github.com/CocoaPods/cocoapods-downloader"
gem "cocoapods-core", :path => "../Core"
# gem "cocoapods-core", :path => "../Core"
# gem "xcodeproj", :path => "../Xcodeproj"
# gem "cocoapods-downloader", :path => "../cocoapods-downloader"
......
......@@ -56,19 +56,14 @@ module Pod
#
def validate
@results = []
unless disable_ui_output
print " -> #{spec ? spec.name : file.basename}\r" unless config.silent?
$stdout.flush
end
UI.print " -> #{spec ? spec.name : file.basename}\r" unless config.silent?
$stdout.flush
perform_linting
check_repo_path if spec && repo_path
perform_extensive_analysis if spec && !quick
unless disable_ui_output
UI.puts " -> ".send(result_color) << (spec ? spec.to_s : file.basename.to_s)
print_results
end
UI.puts " -> ".send(result_color) << (spec ? spec.to_s : file.basename.to_s)
print_results
validated?
end
......@@ -98,16 +93,6 @@ module Pod
# @!group Configuration
# @return [Bool] Whether the validator should print the results of the
# validation. This is useful for clients which want to customize
# output.
#
attr_accessor :disable_ui_output
# @return [Pathname] whether the validation should be performed against a repo.
#
attr_accessor :repo_path
# @return [Bool] whether the validation should skip the checks that
# requires the download of the library.
#
......@@ -182,16 +167,6 @@ module Pod
@results.concat(linter.results)
end
#
#
def check_repo_path
expected_path = "#{spec.name}/#{spec.version}/#{spec.name}.podspec"
path = file.relative_path_from(repo_path).to_s
unless path == expected_path
error "Incorrect path, the path is `#{file}` and should be `#{expected_path}`"
end
end
#
#
def perform_extensive_analysis
......
......@@ -30,7 +30,6 @@ module Pod
it "validates a correct podspec" do
validator = Validator.new(podspec_path)
validator.repo_path = fixture('spec-repos/master')
validator.quick = true
validator.validate
validator.results.should == []
......@@ -47,15 +46,6 @@ module Pod
validator.validated?.should.be.false
end
it "checks the path of the specification if a repo path is provided" do
validator = Validator.new(podspec_path)
validator.quick = true
validator.repo_path = fixture('.')
validator.validate
validator.results.map(&:to_s).first.should.match /Incorrect path/
validator.validated?.should.be.false
end
it "uses xcodebuild to generate notes and warnings" do
validator = Validator.new(podspec_path)
validator.stubs(:check_file_patterns)
......
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