Commit a16ba2de authored by Fabio Pelosin's avatar Fabio Pelosin

[Validator] Clean up

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