Sha256: 261bd92f57d30a916b36f57b6642dcbe0a42fcde647f7e5cb0ee89a227d9c6fb

Contents?: true

Size: 574 Bytes

Versions: 1

Compression:

Stored size: 574 Bytes

Contents

class Dependency < Array
  
  # Override inherited << method to only add existing files
  def << obj
    if File.exists?("#{::Rails.root}#{File::SEPARATOR}public#{File::SEPARATOR}javascripts#{File::SEPARATOR}#{obj}") || File.exists?("#{::Rails.root}#{File::SEPARATOR}public#{File::SEPARATOR}javascripts#{File::SEPARATOR}#{obj}.js")
      super(obj)
    else
      ::Rails.logger.warn "'#{obj}' wasn't found in '#{::Rails.root}#{File::SEPARATOR}public#{File::SEPARATOR}javascripts' but seems to be required. Your app might not work as expected."
      self
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
javascript_auto_include-0.2.0 lib/javascript_auto_include/dependency.rb