class SolrMakr::Configsets::Node

Private Class Methods

gather(root:) click to toggle source

@param [Pathname] root @return [<SolrMakr::Configsets::Node>]

# File lib/solr_makr/configsets/node.rb, line 38
def gather(root:)
  [].tap do |nodes|
    root.find do |path|
      unless path.directory?
        nodes << SolrMakr::Configsets::Node.new(root: root, path: path)
      else
        if path.basename.to_s[0] == '.'
          Find.prune
        else
          next
        end
      end
    end
  end
end

Public Instance Methods

full_name(prefix: '') click to toggle source

@return [String]

# File lib/solr_makr/configsets/node.rb, line 13
def full_name(prefix: '')
  File.join(prefix, name)
end
readable?() click to toggle source
# File lib/solr_makr/configsets/node.rb, line 23
def readable?
  content rescue false
end

Private Instance Methods

default_name() click to toggle source

Derive the name of the node by removing the root path component.

@return [String]

# File lib/solr_makr/configsets/node.rb, line 31
def default_name
  path.relative_path_from(root).to_s
end