rickshaw 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +34 -34
- data/lib/core_ext/string/to_sha1.rb +5 -5
- data/lib/rickshaw.rb +18 -18
- data/lib/rickshaw/version.rb +1 -1
- data/rickshaw.gemspec +1 -1
- 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: 373a033ada96551864e5809866f17720afebf697
|
4
|
+
data.tar.gz: 152251c3ffec14039a432e866af0257a1e3b6f94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d71b65483287ab4b6ab5d216ad63b1880df5fc9600ca8fee2c8aed9cc7851952dbb4129875cad928cf423fe109184e04443b3d22fcb59e658e28541fe14a86a7
|
7
|
+
data.tar.gz: 582df51ae1f51227072727b6ea1b4e09587cd18889dbf3a1c162af8f50b5f7c162d6a9c79250fa506df8c701c7fc8f73f680e7cd7789640c68c7ff0028b0e719
|
data/README.md
CHANGED
@@ -1,34 +1,34 @@
|
|
1
|
-
# Rickshaw
|
2
|
-
|
3
|
-
Easy way to get a SHA1 hash
|
4
|
-
|
5
|
-
yes I'm this lazy.
|
6
|
-
|
7
|
-
## Installation
|
8
|
-
|
9
|
-
Add this line to your application's Gemfile:
|
10
|
-
|
11
|
-
gem 'rickshaw'
|
12
|
-
|
13
|
-
And then execute:
|
14
|
-
|
15
|
-
$ bundle
|
16
|
-
|
17
|
-
Or install it yourself as:
|
18
|
-
|
19
|
-
$ gem install rickshaw
|
20
|
-
|
21
|
-
## Usage
|
22
|
-
> Rickshaw::SHA1.hash('LICENSE.txt')
|
23
|
-
=> "4659d94e7082a65ca39e7b6725094f08a413250a"
|
24
|
-
|
25
|
-
> "hello world".to_sha1
|
26
|
-
=> "2aae6c35c94fcfb415dbe95f408b9ce91ee846ed"
|
27
|
-
|
28
|
-
## Contributing
|
29
|
-
|
30
|
-
1. Fork it
|
31
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
32
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
33
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
34
|
-
5. Create new Pull Request
|
1
|
+
# Rickshaw
|
2
|
+
|
3
|
+
Easy way to get a SHA1 hash
|
4
|
+
|
5
|
+
yes I'm this lazy.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
gem 'rickshaw'
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install rickshaw
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
> Rickshaw::SHA1.hash('LICENSE.txt')
|
23
|
+
=> "4659d94e7082a65ca39e7b6725094f08a413250a"
|
24
|
+
|
25
|
+
> "hello world".to_sha1
|
26
|
+
=> "2aae6c35c94fcfb415dbe95f408b9ce91ee846ed"
|
27
|
+
|
28
|
+
## Contributing
|
29
|
+
|
30
|
+
1. Fork it
|
31
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
32
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
33
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
34
|
+
5. Create new Pull Request
|
@@ -1,5 +1,5 @@
|
|
1
|
-
class String
|
2
|
-
def to_sha1
|
3
|
-
Digest::SHA1.hexdigest self
|
4
|
-
end
|
5
|
-
end
|
1
|
+
class String
|
2
|
+
def to_sha1
|
3
|
+
Digest::SHA1.hexdigest self
|
4
|
+
end
|
5
|
+
end
|
data/lib/rickshaw.rb
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
require 'digest/sha1'
|
2
|
-
require 'rickshaw/version'
|
3
|
-
require 'core_ext/string/to_sha1'
|
4
|
-
|
5
|
-
module Rickshaw
|
6
|
-
module SHA1
|
7
|
-
def self.hash(file_path)
|
8
|
-
hash = Digest::SHA1.new
|
9
|
-
open(file_path, 'r') do |io|
|
10
|
-
until io.eof?
|
11
|
-
buffer = io.read(1024)
|
12
|
-
hash.update(buffer)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
hash.hexdigest
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
1
|
+
require 'digest/sha1'
|
2
|
+
require 'rickshaw/version'
|
3
|
+
require 'core_ext/string/to_sha1'
|
4
|
+
|
5
|
+
module Rickshaw
|
6
|
+
module SHA1
|
7
|
+
def self.hash(file_path)
|
8
|
+
hash = Digest::SHA1.new
|
9
|
+
open(file_path, 'r') do |io|
|
10
|
+
until io.eof?
|
11
|
+
buffer = io.read(1024)
|
12
|
+
hash.update(buffer)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
hash.hexdigest
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/rickshaw/version.rb
CHANGED
data/rickshaw.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["gregory.ostermayr@gmail.com"]
|
11
11
|
spec.description = %q{Get SHA1 hashes easily}
|
12
12
|
spec.summary = %q{Get SHA1 hashes easily}
|
13
|
-
spec.homepage = ""
|
13
|
+
spec.homepage = "https://github.com/gregors/rickshaw"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rickshaw
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregory Ostermayr
|
@@ -54,7 +54,7 @@ files:
|
|
54
54
|
- lib/rickshaw.rb
|
55
55
|
- lib/rickshaw/version.rb
|
56
56
|
- rickshaw.gemspec
|
57
|
-
homepage:
|
57
|
+
homepage: https://github.com/gregors/rickshaw
|
58
58
|
licenses:
|
59
59
|
- MIT
|
60
60
|
metadata: {}
|