Module: Bundler::Security::Voting::BuildFailure
- Defined in:
- lib/bundler/security/voting/build_failure.rb
Overview
Build failure security verdict
Class Method Summary collapse
-
.build(policy_type, command, errors) ⇒ String
Builds failure security verdict message.
-
.call(policy_type, command, errors) ⇒ Object
Prints failure security verdict.
-
.message_type(policy_type) ⇒ String
Builds a message based on policy type.
Class Method Details
.build(policy_type, command, errors) ⇒ String
Builds failure security verdict message
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/bundler/security/voting/build_failure.rb', line 27 def build(policy_type, command, errors) [ "\n", (policy_type), ", blocking #{command}", "\n\n", errors.join("\n"), "\n\n" ].join end |
.call(policy_type, command, errors) ⇒ Object
Prints failure security verdict
14 15 16 17 18 |
# File 'lib/bundler/security/voting/build_failure.rb', line 14 def call(policy_type, command, errors) Bundler.ui.error( build(policy_type, command, errors) ) end |
.message_type(policy_type) ⇒ String
Builds a message based on policy type
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/bundler/security/voting/build_failure.rb', line 45 def (policy_type) case policy_type when 'organization' 'Not enough reviews on your organization' when 'community' 'Not enough reviews in the community' else raise InvalidPolicyType, policy_type end end |