Module: Mudguard::Domain::Texts

Included in:
Dependencies, Policies
Defined in:
lib/mudguard/domain/texts.rb

Overview

Builds texts to be displayed to a user

Instance Method Summary collapse

Instance Method Details

#dependency_allowed(dependency) ⇒ Object



23
24
25
# File 'lib/mudguard/domain/texts.rb', line 23

def dependency_allowed(dependency)
  dependency.to_s
end

#dependency_not_allowed(dependency) ⇒ Object



13
14
15
# File 'lib/mudguard/domain/texts.rb', line 13

def dependency_not_allowed(dependency)
  "#{dependency} not allowed"
end

#dependency_summary(file_count, dependency_count) ⇒ Object



17
18
19
20
21
# File 'lib/mudguard/domain/texts.rb', line 17

def dependency_summary(file_count, dependency_count)
  files = pluralize("file", file_count)
  "#{file_count} #{files} inspected, #{count(dependency_count)}\
 good #{dependency(dependency_count)} detected"
end

#summary(file_count, violation_count) ⇒ Object



7
8
9
10
11
# File 'lib/mudguard/domain/texts.rb', line 7

def summary(file_count, violation_count)
  files = pluralize("file", file_count)
  "#{file_count} #{files} inspected, #{count(violation_count)}\
 bad #{dependency(violation_count)} detected"
end