Class: StillActive::Config
- Inherits:
-
Object
- Object
- StillActive::Config
- Defined in:
- lib/still_active/config.rb
Instance Attribute Summary collapse
-
#baseline_path ⇒ Object
Returns the value of attribute baseline_path.
-
#critical_warning_emoji ⇒ Object
Returns the value of attribute critical_warning_emoji.
-
#cyclonedx_path ⇒ Object
Returns the value of attribute cyclonedx_path.
-
#cyclonedx_version ⇒ Object
Returns the value of attribute cyclonedx_version.
-
#fail_if_critical ⇒ Object
Returns the value of attribute fail_if_critical.
-
#fail_if_outdated ⇒ Object
Returns the value of attribute fail_if_outdated.
-
#fail_if_vulnerable ⇒ Object
Returns the value of attribute fail_if_vulnerable.
-
#fail_if_warning ⇒ Object
Returns the value of attribute fail_if_warning.
-
#futurist_emoji ⇒ Object
Returns the value of attribute futurist_emoji.
-
#gemfile_path ⇒ Object
Lazy so that running with –gems=…
-
#gems ⇒ Object
Returns the value of attribute gems.
- #github_oauth_token ⇒ Object
- #gitlab_token ⇒ Object
-
#ignored_gems ⇒ Object
Returns the value of attribute ignored_gems.
-
#no_warning_range_end ⇒ Object
Returns the value of attribute no_warning_range_end.
-
#output_format ⇒ Object
Returns the value of attribute output_format.
-
#parallelism ⇒ Object
Returns the value of attribute parallelism.
-
#sarif_path ⇒ Object
Returns the value of attribute sarif_path.
-
#success_emoji ⇒ Object
Returns the value of attribute success_emoji.
-
#unsure_emoji ⇒ Object
Returns the value of attribute unsure_emoji.
-
#warning_emoji ⇒ Object
Returns the value of attribute warning_emoji.
-
#warning_range_end ⇒ Object
Returns the value of attribute warning_range_end.
Instance Method Summary collapse
- #github_client ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/still_active/config.rb', line 30 def initialize @fail_if_critical = false @fail_if_outdated = nil @fail_if_vulnerable = nil @fail_if_warning = false @gemfile_path = nil @gems = [] @ignored_gems = [] @github_oauth_token = nil @gitlab_token = nil @parallelism = 10 @output_format = :auto @sarif_path = nil @baseline_path = nil @cyclonedx_path = nil @cyclonedx_version = "1.6" @critical_warning_emoji = "🚩" @futurist_emoji = "🔮" @success_emoji = "✅" @unsure_emoji = "❓" @warning_emoji = "⚠️" @no_warning_range_end = 1 @warning_range_end = 3 end |
Instance Attribute Details
#baseline_path ⇒ Object
Returns the value of attribute baseline_path.
10 11 12 |
# File 'lib/still_active/config.rb', line 10 def baseline_path @baseline_path end |
#critical_warning_emoji ⇒ Object
Returns the value of attribute critical_warning_emoji.
10 11 12 |
# File 'lib/still_active/config.rb', line 10 def critical_warning_emoji @critical_warning_emoji end |
#cyclonedx_path ⇒ Object
Returns the value of attribute cyclonedx_path.
10 11 12 |
# File 'lib/still_active/config.rb', line 10 def cyclonedx_path @cyclonedx_path end |
#cyclonedx_version ⇒ Object
Returns the value of attribute cyclonedx_version.
10 11 12 |
# File 'lib/still_active/config.rb', line 10 def cyclonedx_version @cyclonedx_version end |
#fail_if_critical ⇒ Object
Returns the value of attribute fail_if_critical.
10 11 12 |
# File 'lib/still_active/config.rb', line 10 def fail_if_critical @fail_if_critical end |
#fail_if_outdated ⇒ Object
Returns the value of attribute fail_if_outdated.
10 11 12 |
# File 'lib/still_active/config.rb', line 10 def fail_if_outdated @fail_if_outdated end |
#fail_if_vulnerable ⇒ Object
Returns the value of attribute fail_if_vulnerable.
10 11 12 |
# File 'lib/still_active/config.rb', line 10 def fail_if_vulnerable @fail_if_vulnerable end |
#fail_if_warning ⇒ Object
Returns the value of attribute fail_if_warning.
10 11 12 |
# File 'lib/still_active/config.rb', line 10 def fail_if_warning @fail_if_warning end |
#futurist_emoji ⇒ Object
Returns the value of attribute futurist_emoji.
10 11 12 |
# File 'lib/still_active/config.rb', line 10 def futurist_emoji @futurist_emoji end |
#gemfile_path ⇒ Object
Lazy so that running with –gems=… (no Gemfile needed) doesn’t crash when invoked from a directory without a Gemfile in the tree.
74 75 76 77 78 79 80 |
# File 'lib/still_active/config.rb', line 74 def gemfile_path @gemfile_path ||= begin Bundler.default_gemfile.to_s rescue Bundler::GemfileNotFound File.join(Dir.pwd, "Gemfile") end end |
#gems ⇒ Object
Returns the value of attribute gems.
10 11 12 |
# File 'lib/still_active/config.rb', line 10 def gems @gems end |
#github_oauth_token ⇒ Object
64 65 66 |
# File 'lib/still_active/config.rb', line 64 def github_oauth_token @github_oauth_token ||= presence(ENV["GITHUB_TOKEN"]) || presence(ENV["GH_TOKEN"]) || gh_cli_token end |
#gitlab_token ⇒ Object
68 69 70 |
# File 'lib/still_active/config.rb', line 68 def gitlab_token @gitlab_token ||= presence(ENV["GITLAB_TOKEN"]) || glab_cli_token end |
#ignored_gems ⇒ Object
Returns the value of attribute ignored_gems.
10 11 12 |
# File 'lib/still_active/config.rb', line 10 def ignored_gems @ignored_gems end |
#no_warning_range_end ⇒ Object
Returns the value of attribute no_warning_range_end.
10 11 12 |
# File 'lib/still_active/config.rb', line 10 def no_warning_range_end @no_warning_range_end end |
#output_format ⇒ Object
Returns the value of attribute output_format.
10 11 12 |
# File 'lib/still_active/config.rb', line 10 def output_format @output_format end |
#parallelism ⇒ Object
Returns the value of attribute parallelism.
10 11 12 |
# File 'lib/still_active/config.rb', line 10 def parallelism @parallelism end |
#sarif_path ⇒ Object
Returns the value of attribute sarif_path.
10 11 12 |
# File 'lib/still_active/config.rb', line 10 def sarif_path @sarif_path end |
#success_emoji ⇒ Object
Returns the value of attribute success_emoji.
10 11 12 |
# File 'lib/still_active/config.rb', line 10 def success_emoji @success_emoji end |
#unsure_emoji ⇒ Object
Returns the value of attribute unsure_emoji.
10 11 12 |
# File 'lib/still_active/config.rb', line 10 def unsure_emoji @unsure_emoji end |
#warning_emoji ⇒ Object
Returns the value of attribute warning_emoji.
10 11 12 |
# File 'lib/still_active/config.rb', line 10 def warning_emoji @warning_emoji end |
#warning_range_end ⇒ Object
Returns the value of attribute warning_range_end.
10 11 12 |
# File 'lib/still_active/config.rb', line 10 def warning_range_end @warning_range_end end |
Instance Method Details
#github_client ⇒ Object
59 60 61 62 |
# File 'lib/still_active/config.rb', line 59 def github_client @github_client ||= Octokit::Client.new(access_token: github_oauth_token) end |