Class: Jekyll::Favicon::StaticFile

Inherits:
StaticFile
  • Object
show all
Includes:
Referenceable, Sourceable, Taggable
Defined in:
lib/jekyll/favicon/static_file.rb,
lib/jekyll/favicon/static_file/mutable.rb,
lib/jekyll/favicon/static_file/taggable.rb,
lib/jekyll/favicon/static_file/sourceable.rb,
lib/jekyll/favicon/static_file/convertible.rb,
lib/jekyll/favicon/static_file/referenceable.rb

Overview

Class for static files from with spec dictionary Modify source from spec source Enable tags from spec tags Enable refer

Direct Known Subclasses

StaticDataFile, StaticGraphicFile

Defined Under Namespace

Modules: Convertible, Mutable, Referenceable, Sourceable, Taggable

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Referenceable

#refer, #referenceable?

Methods included from Configuration::Defaults

base_name_to_parts, camelcase_to_snakecase, define_defaults, included, load_defaults, load_file

Methods included from Taggable

#tags

Methods included from Sourceable

#path, #source, source_filter, source_normalize, #source_relative_path, #sourceable?

Constructor Details

#initialize(site, spec = {}) ⇒ StaticFile

Returns a new instance of StaticFile.

Raises:

  • (StandardError)


25
26
27
28
29
30
31
# File 'lib/jekyll/favicon/static_file.rb', line 25

def initialize(site, spec = {})
  raise StandardError unless spec.include? "name"

  @spec = spec
  spec_dir, spec_name = File.split spec_relative_path
  super site, site.source, spec_dir, spec_name
end

Instance Attribute Details

#siteObject (readonly)

Returns the value of attribute site.



23
24
25
# File 'lib/jekyll/favicon/static_file.rb', line 23

def site
  @site
end

#specObject (readonly)

Returns the value of attribute spec.



23
24
25
# File 'lib/jekyll/favicon/static_file.rb', line 23

def spec
  @spec
end

Instance Method Details

#generable?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/jekyll/favicon/static_file.rb', line 33

def generable?
  sourceable?
end

#hrefObject



45
46
47
48
49
# File 'lib/jekyll/favicon/static_file.rb', line 45

def href
  Pathname.new("/")
    .join(*[site.baseurl, url].compact)
    .to_s
end

#patch(configuration) ⇒ Object



41
42
43
# File 'lib/jekyll/favicon/static_file.rb', line 41

def patch(configuration)
  taggable_patch spec_patch configuration
end

#taggable?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/jekyll/favicon/static_file.rb', line 37

def taggable?
  generable? && super
end