Module: PoolParty::SearchablePaths::SingletonMethods
- Defined in:
- lib/poolparty/modules/searchable_paths.rb
Instance Method Summary collapse
- #add_searchable_path(path) ⇒ Object
-
#default_paths ⇒ Object
The default paths are primarily defined in PoolParty::Default.
-
#searchable_paths ⇒ Object
returns the full set of valid searchable paths, given the options.
- #searchable_paths_dir ⇒ Object
- #searchable_paths_dirs ⇒ Object
Instance Method Details
#add_searchable_path(path) ⇒ Object
61 62 63 64 |
# File 'lib/poolparty/modules/searchable_paths.rb', line 61 def add_searchable_path(path) default_paths # instantiate @default_searchable_paths @default_searchable_paths << path end |
#default_paths ⇒ Object
The default paths are primarily defined in PoolParty::Default. These are the default search paths in order:
-
current working directory (Dir.pwd)
-
~/.poolparty
-
~/.ec2
-
/etc/poolparty
-
/var/poolparty
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/poolparty/modules/searchable_paths.rb', line 49 def default_paths @default_searchable_paths ||= [ Dir.pwd, PoolParty::Default.poolparty_home_path, PoolParty::Default.base_keypair_path, PoolParty::Default.poolparty_src_path, PoolParty::Default.poolparty_src_path/:lib/:poolparty, PoolParty::Default.base_config_directory, PoolParty::Default.remote_storage_path ] end |
#searchable_paths ⇒ Object
returns the full set of valid searchable paths, given the options
67 68 69 70 |
# File 'lib/poolparty/modules/searchable_paths.rb', line 67 def searchable_paths return @paths_override if @paths_override && @paths_override.size > 0 @paths_prepend + default_paths + @paths_append end |
#searchable_paths_dir ⇒ Object
37 |
# File 'lib/poolparty/modules/searchable_paths.rb', line 37 def searchable_paths_dir; @searchable_paths_dirs.first; end |
#searchable_paths_dirs ⇒ Object
38 39 40 |
# File 'lib/poolparty/modules/searchable_paths.rb', line 38 def searchable_paths_dirs @searchable_paths_dirs && @searchable_paths_dirs.size > 0 ? @searchable_paths_dirs : ["/"] end |