Class: Pod::Source::Acceptor

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-core/source/acceptor.rb

Overview

Checks whether a podspec can be accepted by a source. The check takes into account the introduction of 0.0.1 version if there are already tagged ones or whether there is change in the source.

Instance Attribute Summary collapse

Actions collapse

Instance Method Summary collapse

Constructor Details

#initialize(repo) ⇒ Acceptor



16
17
18
# File 'lib/cocoapods-core/source/acceptor.rb', line 16

def initialize(repo)
  @source = Source.new(repo)
end

Instance Attribute Details

#sourceSource (readonly)



12
13
14
# File 'lib/cocoapods-core/source/acceptor.rb', line 12

def source
  @source
end

Instance Method Details

#analyze(spec, previous_spec = nil) ⇒ Array<String>

Checks whether the given specification can be accepted.



30
31
32
33
34
35
36
37
# File 'lib/cocoapods-core/source/acceptor.rb', line 30

def analyze(spec, previous_spec = nil)
  errors = []
  check_spec_source_change(spec, errors)
  check_if_untagged_version_is_acceptable(spec, previous_spec, errors)
  check_commit_change_for_untagged_version(spec, previous_spec, errors)
  check_dependencies(spec, errors)
  errors
end

#analyze_path(spec_path) ⇒ Array<String>

Checks whether the specification at the given path can be accepted.



44
45
46
47
48
49
# File 'lib/cocoapods-core/source/acceptor.rb', line 44

def analyze_path(spec_path)
  spec = Specification.from_file(spec_path)
  analyze(spec)
rescue
  ["Unable to load the specification."]
end