Class: Jekyll::ThemeAssetsReader

Inherits:
Object
  • Object
show all
Defined in:
lib/jekyll/readers/theme_assets_reader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(site) ⇒ ThemeAssetsReader

Returns a new instance of ThemeAssetsReader.



6
7
8
# File 'lib/jekyll/readers/theme_assets_reader.rb', line 6

def initialize(site)
  @site = site
end

Instance Attribute Details

#siteObject (readonly)

Returns the value of attribute site.



5
6
7
# File 'lib/jekyll/readers/theme_assets_reader.rb', line 5

def site
  @site
end

Instance Method Details

#readObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/jekyll/readers/theme_assets_reader.rb', line 10

def read
  return unless site.theme && site.theme.assets_path

  Find.find(site.theme.assets_path) do |path|
    next if File.directory?(path)
    if File.symlink?(path)
      Jekyll.logger.warn "Theme reader:", "Ignored symlinked asset: #{path}"
    else
      read_theme_asset(path)
    end
  end
end