Class: LicenseFinder::Core
- Inherits:
-
Object
- Object
- LicenseFinder::Core
- Extended by:
- Forwardable
- Defined in:
- lib/license_finder/core.rb
Overview
Coordinates setup
Instance Attribute Summary collapse
-
#decisions ⇒ Object
readonly
Returns the value of attribute decisions.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Core
constructor
Default
options
: { project_path: Pathname.pwd logger: {}, # can include quiet: true or debug: true decisions_file: “doc/dependency_decisions.yml”, gradle_command: “gradle”, rebar_command: “rebar”, rebar_deps_dir: “deps”, }. - #modifying ⇒ Object
- #project_name ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Core
Default options
:
project_path: Pathname.pwd
logger: {, # can include quiet: true or debug: true
decisions_file: "doc/dependency_decisions.yml",
gradle_command: "gradle",
rebar_command: "rebar",
rebar_deps_dir: "deps",
}
27 28 29 30 31 32 |
# File 'lib/license_finder/core.rb', line 27 def initialize( = {}) @logger = Logger.new(.fetch(:logger, {})) @project_path = Pathname(.fetch(:project_path, Pathname.pwd)) @config = Configuration.with_optional_saved_config(, project_path) @decisions = Decisions.saved!(config.decisions_file) end |
Instance Attribute Details
#decisions ⇒ Object (readonly)
Returns the value of attribute decisions.
41 42 43 |
# File 'lib/license_finder/core.rb', line 41 def decisions @decisions end |
Class Method Details
Instance Method Details
#modifying ⇒ Object
34 35 36 37 |
# File 'lib/license_finder/core.rb', line 34 def yield decisions.save!(config.decisions_file) end |
#project_name ⇒ Object
43 44 45 |
# File 'lib/license_finder/core.rb', line 43 def project_name decisions.project_name || project_path.basename.to_s end |