Exception: Darkroom::MissingLibraryError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/darkroom/errors/missing_library_error.rb

Overview

Error class used when a needed library cannot be loaded. See Asset#require_libs.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(library, need, extension) ⇒ MissingLibraryError

Public: Create a new instance.

library - String name of the library that’s missing. need - Symbol or String reason the library is needed (:compile, :finalize, or :minify). extension - String extension of the type of asset that needs the library.



13
14
15
16
17
18
19
20
# File 'lib/darkroom/errors/missing_library_error.rb', line 13

def initialize(library, need, extension)
  super("Cannot #{need} #{extension} files: '#{library}' library not available [hint: try adding " \
    "gem('#{library}') to your Gemfile]")

  @library = library
  @need = need
  @extension = extension
end

Instance Attribute Details

#extensionObject (readonly)

Returns the value of attribute extension.



6
7
8
# File 'lib/darkroom/errors/missing_library_error.rb', line 6

def extension
  @extension
end

#libraryObject (readonly)

Returns the value of attribute library.



6
7
8
# File 'lib/darkroom/errors/missing_library_error.rb', line 6

def library
  @library
end

#needObject (readonly)

Returns the value of attribute need.



6
7
8
# File 'lib/darkroom/errors/missing_library_error.rb', line 6

def need
  @need
end