Class: Rubyzen::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/rubyzen.rb

Overview

Holds project path configuration with auto-discovery support.

Resolution order:

  1. Explicit paths via #paths= (set via Rubyzen.configure)

  2. Auto-discovery of app/, lib/, src/, spec/ from Dir.pwd

Examples:

Rubyzen.configure { |c| c.paths = ['app/models', 'app/controllers'] }
Rubyzen.configuration.project_paths #=> ["/full/path/app/models", "/full/path/app/controllers"]

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#paths=(value) ⇒ Object (writeonly)

Sets explicit paths to scan. Relative paths are resolved against Dir.pwd.

Parameters:

  • value (Array<String>)

    directories to analyze



70
71
72
# File 'lib/rubyzen.rb', line 70

def paths=(value)
  @paths = value
end

Instance Method Details

#project_pathsArray<String>

Returns the resolved project paths.

Returns:

  • (Array<String>)

    absolute paths to directories to analyze



75
76
77
# File 'lib/rubyzen.rb', line 75

def project_paths
  resolve_paths(@paths) || auto_discover_paths
end