module Pod::X::BuilderDSL

Public Instance Methods

build(url) click to toggle source
# File lib/cocoapods-x/extension/installer/dsl.rb, line 68
def build url
    contents = File.exist?(url) ? File.open(url, 'r:utf-8', &:read) : nil
    # Work around for Rubinius incomplete encoding in 1.9 mode
    if !contents.nil? && contents.respond_to?(:encoding) && contents.encoding.name != 'UTF-8'
        contents.encode!('UTF-8')
    end
    if !contents.nil? && contents.tr!('“”‘’‛', %(""'''))
        # Changes have been made
        CoreUI.warn "Smart quotes were detected and ignored in your #{File.basename(url)}. " \
                    'To avoid issues in the future, you should not use ' \
                    'TextEdit for editing it. If you are not using TextEdit, ' \
                    'you should turn off smart quotes in your editor of choice.'
    end
    unless contents.nil?
        begin
            eval(contents, nil, url.to_s)
        rescue Exception => e
            message = "Invalid `#{File.basename(url)}` file: #{e.message}"
            raise DSLError.new(message, url, e, contents)
        end
    end
end