digestif 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +10 -0
- data/lib/digestif/cli.rb +11 -6
- data/lib/digestif/hasher.rb +1 -1
- data/lib/digestif/version.rb +1 -1
- metadata +4 -4
data/History.txt
CHANGED
data/lib/digestif/cli.rb
CHANGED
@@ -9,6 +9,14 @@ module Digestif
|
|
9
9
|
new(args).run
|
10
10
|
end
|
11
11
|
|
12
|
+
def self.default_options
|
13
|
+
options = OpenStruct.new
|
14
|
+
options.digest = :sha1
|
15
|
+
options.seek_size = 1024
|
16
|
+
options.read_size = 512
|
17
|
+
options
|
18
|
+
end
|
19
|
+
|
12
20
|
attr_accessor :args, :options
|
13
21
|
|
14
22
|
def initialize(args)
|
@@ -31,11 +39,7 @@ module Digestif
|
|
31
39
|
end
|
32
40
|
|
33
41
|
def parse_options
|
34
|
-
|
35
|
-
options = OpenStruct.new
|
36
|
-
options.digest = :sha1
|
37
|
-
options.seek_size = 1024
|
38
|
-
options.read_size = 512
|
42
|
+
options = CLI.default_options
|
39
43
|
|
40
44
|
parser = OptionParser.new do |p|
|
41
45
|
p.banner = "Usage: digestif [options] filename"
|
@@ -46,7 +50,8 @@ module Digestif
|
|
46
50
|
|
47
51
|
p.on("-d", "--digest DIGEST", [:md5, :sha1],
|
48
52
|
"Digest algorithm to use. Currently supported:",
|
49
|
-
" md5", " sha1",
|
53
|
+
" md5", " sha1",
|
54
|
+
"(default #{options.digest.to_s})", ' ') do |digest|
|
50
55
|
options.digest = digest
|
51
56
|
end
|
52
57
|
|
data/lib/digestif/hasher.rb
CHANGED
data/lib/digestif/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: digestif
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 3
|
10
|
+
version: 1.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andrew Roberts
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-01-
|
18
|
+
date: 2011-01-20 00:00:00 -05:00
|
19
19
|
default_executable: digestif
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|