hashsum 2.1.2 → 2.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/hashsum +45 -0
  3. metadata +4 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0f20dd406e1f1f1c76dc09a2c979498fc3a5ac4c
4
- data.tar.gz: 2be665ab826eed3c7cb12691a0d75303f560f1be
3
+ metadata.gz: d24b82348b01eee6f0a7a64d8b8f463190fc13bd
4
+ data.tar.gz: 4b88c384fdb806da7460bc5db65c683c38343195
5
5
  SHA512:
6
- metadata.gz: ccfe03f3c462af42ef2f2389e9aed5afdb482e4effe34b56fe865a5a0b2167b5d24309e9e14f7e9e7bd68ac9cb22aa85650c7daa68c70441376368d652016686
7
- data.tar.gz: d3a1b077c1e431a7fdd77f75d2b65117ab42059eab1fde4a107bcca1978b60af84bf445f87ba2cbc4ac5f433b067f6e008897842bd4c5597202c76c8a816f75d
6
+ metadata.gz: 70de88e6cbcbaa23272b088e0e10839c484c068b028637a490a7b77e54ca165d7629b0c04a3dbbfc35ef0debab9117139f6715b745a7e465544ee65b2b428d0a
7
+ data.tar.gz: dbf6a48866b2da1c4ec6f05ec4bf7f1f9ce24af29e033369e7ce298efb582a8bc2504e2323ff90ea286195ff1972374bdc09bedb714eda045183c08c375080e4
data/bin/hashsum ADDED
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'hashsum'
4
+
5
+ HELP = <<-EOS
6
+ Usage:
7
+ hashsum -h/--help
8
+ hashsum -v/--version
9
+ hashsum -a/--algorithm [default: "sha1"]
10
+ hashsum command [arguments...] [options...]
11
+
12
+ Examples:
13
+ hashsum foo
14
+ hashsum foo bar
15
+ hashsum -a md5 foo
16
+ EOS
17
+
18
+ VERSION = '2.1.3'
19
+
20
+ case ARGV.first
21
+ when '-h', '--help'
22
+ puts HELP
23
+ when '-v', '--version'
24
+ puts VERSION
25
+ when '-a', '--algorithm'
26
+ algorithm = ARGV[1]
27
+
28
+ ARGV.shift
29
+ ARGV.shift
30
+
31
+ ARGV.each do |arg|
32
+ puts arg.hashsum(:md5) + ' ' + arg if algorithm == 'md5'
33
+ puts arg.hashsum(:sha1) + ' ' + arg if algorithm == 'sha1'
34
+ puts arg.hashsum(:sha2) + ' ' + arg if algorithm == 'sha2'
35
+ puts arg.hashsum(:sha256) + ' ' + arg if algorithm == 'sha256'
36
+ puts arg.hashsum(:sha384) + ' ' + arg if algorithm == 'sha384'
37
+ puts arg.hashsum(:sha512) + ' ' + arg if algorithm == 'sha512'
38
+ end
39
+ when nil
40
+ puts "\e[31mERROR\e[0m: Invalid option. See 'hashsum -h'"
41
+ else
42
+ ARGV.each do |arg|
43
+ puts arg.hashsum(:sha1) + ' ' + arg
44
+ end
45
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hashsum
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francesco Russo
@@ -12,11 +12,13 @@ date: 2013-09-17 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Add hashing methods to String class
14
14
  email: fraskyrusso@gmail.com
15
- executables: []
15
+ executables:
16
+ - hashsum
16
17
  extensions: []
17
18
  extra_rdoc_files: []
18
19
  files:
19
20
  - lib/hashsum.rb
21
+ - bin/hashsum
20
22
  homepage: http://github.com/fraskyrusso/hashsum
21
23
  licenses:
22
24
  - MIT