Class: Pod::Specification::Linter

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-imy-bin/native/linter.rb

Instance Method Summary collapse

Instance Method Details

#validate_root_namevoid

This method returns an undefined value.

Checks that the spec’s root name matches the filename.



14
15
16
17
18
19
20
21
22
23
# File 'lib/cocoapods-imy-bin/native/linter.rb', line 14

def validate_root_name
  if spec.root.name && file
    acceptable_names = Specification::VALID_EXTNAME.map { |extname| "#{spec.root.name}#{extname}" }
    names_match = acceptable_names.include?(file.basename.to_s)
    unless names_match
      results.add_error('name', 'The name of the spec should match the ' \
                        'name of the file.')
    end
  end
end