module Pod::Extension::Development::DSL
Public Instance Methods
run(url)
click to toggle source
# File lib/cocoapods-extension/development/dsl.rb, line 42 def run 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