instance method
draw
Ruby on Rails 2.1.0
Since v1.0.3 Last seen in v2.2.3Signature
draw(path = nil, &block)
No documentation comment.
Parameters
-
pathopt = nil -
blockblock
Source
# File lib/importmap/map.rb, line 13
def draw(path = nil, &block)
if path && File.exist?(path)
begin
instance_eval(File.read(path), path.to_s)
rescue StandardError => e
Rails.logger.error "Unable to parse import map from #{path}: #{e.message}"
raise InvalidFile, "Unable to parse import map from #{path}: #{e.message}"
end
elsif block_given?
instance_eval(&block)
end
self
end
Defined in lib/importmap/map.rb line 13
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Importmap::Map