Class: WAMR::Scanner
- Inherits:
-
Object
- Object
- WAMR::Scanner
- Defined in:
- lib/wamr/scanner.rb
Instance Method Summary collapse
-
#initialize(root_path = ".") ⇒ Scanner
constructor
A new instance of Scanner.
- #scan ⇒ Object
Constructor Details
#initialize(root_path = ".") ⇒ Scanner
Returns a new instance of Scanner.
6 7 8 |
# File 'lib/wamr/scanner.rb', line 6 def initialize(root_path = ".") @root_path = File.(root_path) end |
Instance Method Details
#scan ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/wamr/scanner.rb', line 10 def scan command = build_command stdout, stderr, status = Open3.capture3(command) if status.success? paths = stdout.split("\n").map { |p| p.sub(/\/\.git$/, '').strip }.reject(&:empty?) display_results(paths) else puts "Error running command: #{stderr}" end end |