Class: Devpack::Config
- Inherits:
-
Object
- Object
- Devpack::Config
- Defined in:
- lib/devpack/config.rb
Overview
Locates and parses .devpack config file
Constant Summary collapse
- FILENAME =
'.devpack'
- INITIALIZERS_DIRECTORY_NAME =
'.devpack_initializers'
- MAX_PARENTS =
Avoid infinite loops (symlinks/weird file systems)
100
Instance Method Summary collapse
- #devpack_initializer_paths ⇒ Object
- #devpack_initializers_path ⇒ Object
- #devpack_path ⇒ Object
-
#initialize(pwd) ⇒ Config
constructor
A new instance of Config.
- #requested_gems ⇒ Object
Constructor Details
#initialize(pwd) ⇒ Config
Returns a new instance of Config.
10 11 12 |
# File 'lib/devpack/config.rb', line 10 def initialize(pwd) @pwd = Pathname.new(pwd) end |
Instance Method Details
#devpack_initializer_paths ⇒ Object
31 32 33 |
# File 'lib/devpack/config.rb', line 31 def devpack_initializer_paths devpack_initializers_path&.glob(File.join('**', '*.rb'))&.map(&:to_s)&.sort || [] end |
#devpack_initializers_path ⇒ Object
27 28 29 |
# File 'lib/devpack/config.rb', line 27 def devpack_initializers_path @devpack_initializers_path ||= located_path(@pwd, INITIALIZERS_DIRECTORY_NAME, :directory) end |
#devpack_path ⇒ Object
23 24 25 |
# File 'lib/devpack/config.rb', line 23 def devpack_path @devpack_path ||= located_path(@pwd, FILENAME, :file) end |