Class: SolrMakr::Configsets::Node
- Inherits:
-
Object
- Object
- SolrMakr::Configsets::Node
- Defined in:
- lib/solr_makr/configsets/node.rb
Instance Attribute Summary collapse
- #content ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#content ⇒ String (readonly)
19 20 21 |
# File 'lib/solr_makr/configsets/node.rb', line 19 attr_lazy_reader :content do path.read end |
Class Method Details
.gather(root:) ⇒ <SolrMakr::Configsets::Node>
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# 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 |
Instance Method Details
#full_name(prefix: '') ⇒ String
13 14 15 |
# File 'lib/solr_makr/configsets/node.rb', line 13 def full_name(prefix: '') File.join(prefix, name) end |
#readable? ⇒ Boolean
23 24 25 |
# File 'lib/solr_makr/configsets/node.rb', line 23 def readable? content rescue false end |