Class: RailsProof::TargetDiscovery
- Inherits:
-
Object
- Object
- RailsProof::TargetDiscovery
- Defined in:
- lib/rails_proof/target_discovery.rb
Defined Under Namespace
Classes: Target
Constant Summary collapse
- SUPPORTED_DIRECTORIES =
{ "app/models" => :model, "app/controllers" => :controller }.freeze
Instance Attribute Summary collapse
-
#root ⇒ Object
readonly
Returns the value of attribute root.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Instance Method Summary collapse
-
#initialize(root:, scope: nil) ⇒ TargetDiscovery
constructor
A new instance of TargetDiscovery.
- #targets ⇒ Object
Constructor Details
#initialize(root:, scope: nil) ⇒ TargetDiscovery
Returns a new instance of TargetDiscovery.
20 21 22 23 |
# File 'lib/rails_proof/target_discovery.rb', line 20 def initialize(root:, scope: nil) @root = Pathname.new(root) @scope = scope end |
Instance Attribute Details
#root ⇒ Object (readonly)
Returns the value of attribute root.
18 19 20 |
# File 'lib/rails_proof/target_discovery.rb', line 18 def root @root end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
18 19 20 |
# File 'lib/rails_proof/target_discovery.rb', line 18 def scope @scope end |
Instance Method Details
#targets ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/rails_proof/target_discovery.rb', line 25 def targets @targets ||= if normalized_scope discover_scope(normalized_scope) else discover_all end end |