diff options
| author | Paul Buetow <paul@mimecast.com> | 2018-05-27 12:51:18 +0100 |
|---|---|---|
| committer | Paul Buetow <paul@mimecast.com> | 2018-05-27 12:51:18 +0100 |
| commit | c3b6deb8ab336380b71a07ff6e07eacab4e34888 (patch) | |
| tree | 4fc53d419d7b64150b6f5e3ca7d4e8baf65cd2a5 | |
| parent | 121899b7a3bcdd8249a122740086cd5108857342 (diff) | |
add binary support
| -rw-r--r-- | geheim.rb | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -126,12 +126,21 @@ class Index < CommitFile end end + def is_binary? + if @description.include?(".txt") + false + else + @description.include?(".") + end + end + def get_data(data: nil) GeheimData.new(data_file: @data_file, data: data) end def to_s - "=> #{@description} <= ...#{@hash[-11...-1]}\n" + binary = is_binary? ? "(BINARY) " : "" + "=> #{@description} #{binary}<= ...#{@hash[-11...-1]}\n" end def <=>(other) @@ -165,7 +174,7 @@ class Geheim < Config end indexes.sort.each do |index| print index - print index.get_data if show + print index.get_data if show and !index.is_binary? end end |
