thieve 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/thieve/key_info.rb +4 -5
- data/lib/thieve.rb +9 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8955195cd4af5b54c8800c71577f0d1109550417
|
4
|
+
data.tar.gz: 34c76603bb2f10ea44794f2f6e9449ae8494f245
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 770cf26a24f6a3885c25cf694fade57001d88a282ffd116734cdfb41f0a3b66428beca36d29614b0077b4dc66ff9a26dc3258721fc218a4fad2bee22cbd59142
|
7
|
+
data.tar.gz: 2f6c4339b7fc536a7d3c61e55b3ff410f792d70c06a3cbe39ea905c5b1b2554a163d7ca5ec95f200a4b40416f645bb27ec097e13bd58a273684904f96421b76e
|
data/lib/thieve/key_info.rb
CHANGED
@@ -25,13 +25,13 @@ class Thieve::KeyInfo
|
|
25
25
|
attr_reader :type
|
26
26
|
|
27
27
|
def colorize_file(file = @file)
|
28
|
-
return file if (
|
28
|
+
return file if (!Thieve.colorize?)
|
29
29
|
return file.to_s.light_blue
|
30
30
|
end
|
31
31
|
private :colorize_file
|
32
32
|
|
33
33
|
def colorize_key(key = @key)
|
34
|
-
return key if (
|
34
|
+
return key if (!Thieve.colorize?)
|
35
35
|
return key.split("\n").map do |line|
|
36
36
|
line.light_white
|
37
37
|
end.join("\n")
|
@@ -40,7 +40,7 @@ class Thieve::KeyInfo
|
|
40
40
|
|
41
41
|
def colorize_match(match = @match)
|
42
42
|
return "" if (match.nil?)
|
43
|
-
return "Matches #{match}" if (
|
43
|
+
return "Matches #{match}" if (!Thieve.colorize?)
|
44
44
|
return [
|
45
45
|
"Matches".light_blue,
|
46
46
|
match.light_green
|
@@ -55,8 +55,7 @@ class Thieve::KeyInfo
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
-
def initialize(file, type, key
|
59
|
-
@colorize = colorize
|
58
|
+
def initialize(file, type, key)
|
60
59
|
@ext = type.gsub(/ +/, ".").downcase
|
61
60
|
@file = file
|
62
61
|
@key = key
|
data/lib/thieve.rb
CHANGED
@@ -7,8 +7,13 @@ require "scoobydoo"
|
|
7
7
|
class Thieve
|
8
8
|
attr_accessor :loot
|
9
9
|
|
10
|
+
def self.colorize?
|
11
|
+
@@colorize ||= false
|
12
|
+
return @@colorize
|
13
|
+
end
|
14
|
+
|
10
15
|
def colorize_type(type)
|
11
|
-
return type if (
|
16
|
+
return type if (!@@colorize)
|
12
17
|
return type.light_cyan
|
13
18
|
end
|
14
19
|
private :colorize_type
|
@@ -53,15 +58,10 @@ class Thieve
|
|
53
58
|
@loot[type] ||= Array.new
|
54
59
|
begin
|
55
60
|
@loot[type].push(
|
56
|
-
Thieve::KeyInfo.new(
|
57
|
-
file,
|
58
|
-
type,
|
59
|
-
keydata,
|
60
|
-
@colorize
|
61
|
-
)
|
61
|
+
Thieve::KeyInfo.new(file, type, keydata)
|
62
62
|
)
|
63
63
|
rescue Exception => e
|
64
|
-
if (
|
64
|
+
if (@@colorize)
|
65
65
|
$stderr.puts file.to_s.light_blue
|
66
66
|
keydata.each_line do |line|
|
67
67
|
$stderr.puts line.strip.light_yellow
|
@@ -104,7 +104,7 @@ class Thieve
|
|
104
104
|
raise Thieve::Error::ExecutableNotFound.new("gpg")
|
105
105
|
end
|
106
106
|
|
107
|
-
|
107
|
+
@@colorize = colorize
|
108
108
|
@loot = Hash.new
|
109
109
|
end
|
110
110
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thieve
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miles Whittaker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|