Skip to content
This repository has been archived by the owner on Jul 30, 2021. It is now read-only.

Commit

Permalink
add csv, json, yaml output
Browse files Browse the repository at this point in the history
  • Loading branch information
noraj committed Mar 15, 2021
1 parent 3fe1a35 commit 3240860
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,3 @@ Homepage / Documentation: https://sec-it.github.io/pass-station/
## Author

Made by Alexandre ZANNI ([@noraj](https://pwn.by/noraj/)), pentester at [SEC-IT](https://sec-it.fr).

## TODO list / Roadmap:

- [ ] CSV, JSON, YAML output formatter
- [ ] publish on BA & pentoo
24 changes: 24 additions & 0 deletions lib/pass_station/output.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,5 +200,29 @@ def headers(colsizes)
protected :dividers, :headers, :justify_row, :justify
end
end

class Csv
class << self
def format(table)
CSV::Table.new(table).to_csv.split("\n")
end
end
end

class Json
class << self
def format(table)
[table.map(&:to_h).to_json]
end
end
end

class Yaml
class << self
def format(table)
[table.map(&:to_h).to_yaml]
end
end
end
end
end

0 comments on commit 3240860

Please sign in to comment.