Module: Samlr::Command
- Defined in:
- lib/samlr/command.rb
Overview
Helper module for command line options
Constant Summary collapse
- COMMANDS =
[ :verify, :schema_validate, :print ]
Class Method Summary collapse
Class Method Details
.execute(options, path = nil) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/samlr/command.rb', line 9 def self.execute(, path = nil) Samlr.logger.level = Logger::DEBUG if [:verbose] Samlr.validation_mode = :log if [:skip_validation] if [:verify] if File.directory?(path) result = [] Dir.glob("#{path}/*.*").each do |file| result << execute_verify(file, ) end result.join("\n") else execute_verify(path, ) end elsif [:schema_validate] Samlr::Tools.validate(:path => path) elsif [:print] Samlr::Response.parse(File.read(path)).to_xml end end |