Class: LicenseFinder::Configuration
- Inherits:
-
Object
- Object
- LicenseFinder::Configuration
- Defined in:
- lib/license_finder/configuration.rb
Instance Attribute Summary collapse
-
#strict_matching ⇒ Object
Returns the value of attribute strict_matching.
Class Method Summary collapse
Instance Method Summary collapse
- #aggregate_paths ⇒ Object
- #columns ⇒ Object
- #composer_check_require_only ⇒ Object
- #conda_bash_setup_script ⇒ Object
- #decisions_file_path ⇒ Object
- #elixir_command ⇒ Object
- #enabled_package_manager_ids ⇒ Object
- #format ⇒ Object
- #go_full_version ⇒ Object
- #gradle_command ⇒ Object
- #gradle_include_groups ⇒ Object
-
#initialize(primary_config, saved_config) ⇒ Configuration
constructor
A new instance of Configuration.
- #log_directory ⇒ Object
- #logger_mode ⇒ Object
- #maven_include_groups ⇒ Object
- #maven_options ⇒ Object
- #merge(other_hash) ⇒ Object
- #mix_command ⇒ Object
- #mix_deps_dir ⇒ Object
- #npm_options ⇒ Object
- #pip_requirements_path ⇒ Object
- #pnpm_options ⇒ Object
- #prepare ⇒ Object
- #prepare_no_fail ⇒ Object
- #project_path ⇒ Object
- #python_version ⇒ Object
- #rebar_command ⇒ Object
- #rebar_deps_dir ⇒ Object
- #recursive ⇒ Object
- #save_file ⇒ Object
- #sbt_include_groups ⇒ Object
- #use_spdx_id ⇒ Object
- #valid_project_path? ⇒ Boolean
- #write_headers ⇒ Object
- #yarn_options ⇒ Object
Constructor Details
#initialize(primary_config, saved_config) ⇒ Configuration
Returns a new instance of Configuration.
14 15 16 17 |
# File 'lib/license_finder/configuration.rb', line 14 def initialize(primary_config, saved_config) @primary_config = primary_config @saved_config = saved_config end |
Instance Attribute Details
#strict_matching ⇒ Object
Returns the value of attribute strict_matching.
168 169 170 |
# File 'lib/license_finder/configuration.rb', line 168 def strict_matching @strict_matching end |
Class Method Details
.with_optional_saved_config(primary_config) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/license_finder/configuration.rb', line 7 def self.with_optional_saved_config(primary_config) project_path = Pathname(primary_config.fetch(:project_path, Pathname.pwd)). config_file = project_path.join('config', 'license_finder.yml') saved_config = config_file.exist? ? YAML.safe_load(config_file.read) : {} new(primary_config, saved_config) end |
Instance Method Details
#aggregate_paths ⇒ Object
140 141 142 |
# File 'lib/license_finder/configuration.rb', line 140 def aggregate_paths get(:aggregate_paths) end |
#columns ⇒ Object
152 153 154 |
# File 'lib/license_finder/configuration.rb', line 152 def columns get(:columns) end |
#composer_check_require_only ⇒ Object
164 165 166 |
# File 'lib/license_finder/configuration.rb', line 164 def composer_check_require_only get(:composer_check_require_only) end |
#conda_bash_setup_script ⇒ Object
112 113 114 |
# File 'lib/license_finder/configuration.rb', line 112 def conda_bash_setup_script get(:conda_bash_setup_script) end |
#decisions_file_path ⇒ Object
47 48 49 50 51 52 |
# File 'lib/license_finder/configuration.rb', line 47 def decisions_file_path path = File.join(project_path, 'doc/dependency_decisions.yml') unless project_path.nil? path = get(:decisions_file) unless get(:decisions_file).nil? path = 'doc/dependency_decisions.yml' if path.nil? Pathname.new(path) end |
#elixir_command ⇒ Object
25 26 27 |
# File 'lib/license_finder/configuration.rb', line 25 def elixir_command get(:elixir_command) || 'elixir' end |
#enabled_package_manager_ids ⇒ Object
68 69 70 |
# File 'lib/license_finder/configuration.rb', line 68 def enabled_package_manager_ids get(:enabled_package_managers) end |
#format ⇒ Object
148 149 150 |
# File 'lib/license_finder/configuration.rb', line 148 def format get(:format) end |
#go_full_version ⇒ Object
80 81 82 |
# File 'lib/license_finder/configuration.rb', line 80 def go_full_version get(:go_full_version) end |
#gradle_command ⇒ Object
76 77 78 |
# File 'lib/license_finder/configuration.rb', line 76 def gradle_command get(:gradle_command) end |
#gradle_include_groups ⇒ Object
84 85 86 |
# File 'lib/license_finder/configuration.rb', line 84 def gradle_include_groups get(:gradle_include_groups) end |
#log_directory ⇒ Object
54 55 56 57 58 59 60 61 62 |
# File 'lib/license_finder/configuration.rb', line 54 def log_directory path = get(:log_directory) || 'lf_logs' if (aggregate_paths || recursive) && project_path == '' Pathname(path). else project_path.join(path). end end |
#logger_mode ⇒ Object
72 73 74 |
# File 'lib/license_finder/configuration.rb', line 72 def logger_mode get(:logger) end |
#maven_include_groups ⇒ Object
88 89 90 |
# File 'lib/license_finder/configuration.rb', line 88 def maven_include_groups get(:maven_include_groups) end |
#maven_options ⇒ Object
92 93 94 |
# File 'lib/license_finder/configuration.rb', line 92 def get(:maven_options) end |
#merge(other_hash) ⇒ Object
33 34 35 |
# File 'lib/license_finder/configuration.rb', line 33 def merge(other_hash) dup_with other_hash end |
#mix_command ⇒ Object
29 30 31 |
# File 'lib/license_finder/configuration.rb', line 29 def mix_command get(:mix_command) || 'mix' end |
#mix_deps_dir ⇒ Object
42 43 44 45 |
# File 'lib/license_finder/configuration.rb', line 42 def mix_deps_dir path = get(:mix_deps_dir) || 'deps' project_path.join(path). end |
#npm_options ⇒ Object
96 97 98 |
# File 'lib/license_finder/configuration.rb', line 96 def get(:npm_options) end |
#pip_requirements_path ⇒ Object
108 109 110 |
# File 'lib/license_finder/configuration.rb', line 108 def pip_requirements_path get(:pip_requirements_path) end |
#pnpm_options ⇒ Object
104 105 106 |
# File 'lib/license_finder/configuration.rb', line 104 def get(:pnpm_options) end |
#prepare ⇒ Object
124 125 126 |
# File 'lib/license_finder/configuration.rb', line 124 def prepare get(:prepare) || prepare_no_fail end |
#prepare_no_fail ⇒ Object
128 129 130 |
# File 'lib/license_finder/configuration.rb', line 128 def prepare_no_fail get(:prepare_no_fail) end |
#project_path ⇒ Object
64 65 66 |
# File 'lib/license_finder/configuration.rb', line 64 def project_path Pathname(path_prefix). end |
#python_version ⇒ Object
116 117 118 |
# File 'lib/license_finder/configuration.rb', line 116 def python_version get(:python_version) end |
#rebar_command ⇒ Object
120 121 122 |
# File 'lib/license_finder/configuration.rb', line 120 def get(:rebar_command) end |
#rebar_deps_dir ⇒ Object
37 38 39 40 |
# File 'lib/license_finder/configuration.rb', line 37 def path = get(:rebar_deps_dir) || '_build/default/lib' project_path.join(path). end |
#recursive ⇒ Object
144 145 146 |
# File 'lib/license_finder/configuration.rb', line 144 def recursive get(:recursive) end |
#save_file ⇒ Object
136 137 138 |
# File 'lib/license_finder/configuration.rb', line 136 def save_file get(:save) end |
#sbt_include_groups ⇒ Object
160 161 162 |
# File 'lib/license_finder/configuration.rb', line 160 def sbt_include_groups get(:sbt_include_groups) end |
#use_spdx_id ⇒ Object
156 157 158 |
# File 'lib/license_finder/configuration.rb', line 156 def use_spdx_id get(:use_spdx_id) end |
#valid_project_path? ⇒ Boolean
19 20 21 22 23 |
# File 'lib/license_finder/configuration.rb', line 19 def valid_project_path? return project_path.exist? if get(:project_path) true end |
#write_headers ⇒ Object
132 133 134 |
# File 'lib/license_finder/configuration.rb', line 132 def write_headers get(:write_headers) end |
#yarn_options ⇒ Object
100 101 102 |
# File 'lib/license_finder/configuration.rb', line 100 def get(:yarn_options) end |