Module: Steep::Drivers::Utils::DriverHelper
- Included in:
- Annotations, Check, Init, Langserver, PrintProject, Validate, Watch
- Defined in:
- lib/steep/drivers/utils/driver_helper.rb
Instance Attribute Summary collapse
-
#steepfile ⇒ Object
Returns the value of attribute steepfile.
Instance Method Summary collapse
Instance Attribute Details
#steepfile ⇒ Object
Returns the value of attribute steepfile.
5 6 7 |
# File 'lib/steep/drivers/utils/driver_helper.rb', line 5 def steepfile @steepfile end |
Instance Method Details
#load_config(path: steepfile || Pathname("Steepfile")) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/steep/drivers/utils/driver_helper.rb', line 7 def load_config(path: steepfile || Pathname("Steepfile")) raise "Cannot find a configuration at #{path}: `steep init` to scaffold" unless path.file? steep_file_path = path.absolute? ? path : Pathname.pwd + path Project.new(base_dir: steep_file_path.parent).tap do |project| Project::DSL.parse(project, path.read, filename: path.to_s) end end |