Class: Saml::Kit::Cli::SignatureReport
- Inherits:
-
Object
- Object
- Saml::Kit::Cli::SignatureReport
- Defined in:
- lib/saml/kit/cli/signature_report.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path, format:) ⇒ SignatureReport
constructor
A new instance of SignatureReport.
- #print(shell) ⇒ Object
Constructor Details
#initialize(path, format:) ⇒ SignatureReport
Returns a new instance of SignatureReport.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/saml/kit/cli/signature_report.rb', line 9 def initialize(path, format:) @format = format @path = path if File.exist?(File.(path)) @content = IO.read(File.(path)) else uri = URI.parse(path) @content = Net::HTTP.get_response(uri).body.chomp end end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
7 8 9 |
# File 'lib/saml/kit/cli/signature_report.rb', line 7 def content @content end |
#format ⇒ Object (readonly)
Returns the value of attribute format.
7 8 9 |
# File 'lib/saml/kit/cli/signature_report.rb', line 7 def format @format end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
7 8 9 |
# File 'lib/saml/kit/cli/signature_report.rb', line 7 def path @path end |
Instance Method Details
#print(shell) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/saml/kit/cli/signature_report.rb', line 20 def print(shell) shell.say to_xml return shell.say_status :success, "#{path} is valid", :green if valid? errors.each { |error| shell.say_status(:error, error, :red) } return unless full? invalid_signatures.each { |x| shell.say(x.to_xml(indent: 2), :red) } end |