class StyleGuide::Config

Attributes

paths[R]

Public Class Methods

bootstrap_glob() click to toggle source
# File lib/style_guide/config.rb, line 5
def self.bootstrap_glob
  StyleGuide::Engine.root.join("app", "views", "bootstrap", "*")
end
new(options = {}) click to toggle source
# File lib/style_guide/config.rb, line 9
def initialize(options = {})
  @paths = options[:paths] || [self.class.bootstrap_glob]
end

Public Instance Methods

paths=(paths) click to toggle source
# File lib/style_guide/config.rb, line 13
def paths=(paths)
  if paths.is_a?(Array)
    @paths = paths
  else
    @paths = [paths]
  end
end
sections() click to toggle source
# File lib/style_guide/config.rb, line 21
def sections
  StyleGuide::Section.from_paths(expanded_paths)
end

Private Instance Methods

expanded_paths() click to toggle source
# File lib/style_guide/config.rb, line 27
def expanded_paths
  globbed_paths.flatten.uniq.select(&:directory?)
end
globbed_paths() click to toggle source
# File lib/style_guide/config.rb, line 31
def globbed_paths
  paths.map { |path| Pathname.glob(path) }
end