Class: Puppet::Pops::Loader::LoaderPaths::SmartPath
- Defined in:
- lib/puppet/pops/loader/loader_paths.rb
Overview
# DO NOT REMOVE YET. needed later? when there is the need to decamel a classname
def de_camel(fq_name)
fq_name.to_s.gsub(/::/, '/').
gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
gsub(/([a-z\d])([A-Z])/,'\1_\2').
tr("-", "_").
downcase
end
Direct Known Subclasses
Instance Attribute Summary collapse
-
#generic_path ⇒ Object
readonly
Generic path, in the sense of “if there are any entities of this kind to load, where are they?”.
Instance Method Summary collapse
-
#effective_path(typed_name, start_index_in_name) ⇒ Object
Effective path is the generic path + the name part(s) + extension.
-
#initialize(loader) ⇒ SmartPath
constructor
Creates SmartPath for the given loader (loader knows how to check for existence etc.).
- #instantiator ⇒ Object
- #relative_path ⇒ Object
- #root_path ⇒ Object
Constructor Details
#initialize(loader) ⇒ SmartPath
Creates SmartPath for the given loader (loader knows how to check for existence etc.)
51 52 53 |
# File 'lib/puppet/pops/loader/loader_paths.rb', line 51 def initialize(loader) @loader = loader end |
Instance Attribute Details
#generic_path ⇒ Object (readonly)
Generic path, in the sense of “if there are any entities of this kind to load, where are they?”
48 49 50 |
# File 'lib/puppet/pops/loader/loader_paths.rb', line 48 def generic_path @generic_path end |
Instance Method Details
#effective_path(typed_name, start_index_in_name) ⇒ Object
Effective path is the generic path + the name part(s) + extension.
68 69 70 |
# File 'lib/puppet/pops/loader/loader_paths.rb', line 68 def effective_path(typed_name, start_index_in_name) "#{File.join(generic_path, typed_name.name_parts)}#{extension}" end |
#instantiator ⇒ Object
76 77 78 |
# File 'lib/puppet/pops/loader/loader_paths.rb', line 76 def instantiator() raise NotImplementedError.new end |
#relative_path ⇒ Object
72 73 74 |
# File 'lib/puppet/pops/loader/loader_paths.rb', line 72 def relative_path() raise NotImplementedError.new end |
#root_path ⇒ Object
62 63 64 |
# File 'lib/puppet/pops/loader/loader_paths.rb', line 62 def root_path @loader.path end |