rickshaw 0.1.0 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a38dc506e80cb438e33b33e1c598e5bca41c120a
4
- data.tar.gz: 4dc19977ef4121a41ad5ded8f75e155f30fd5c8d
3
+ metadata.gz: 930afcc689f9116cc0c789b6bdc14e0f6ff5476f
4
+ data.tar.gz: b2606280e29c199d56c1fc5d90c07135b2f0633e
5
5
  SHA512:
6
- metadata.gz: c855f39a4a5f81af81eb3ad4246df01e0c83838012cbf26ce22de11903f611e5c4bccaa2fbd186a7acc8367bfaaf612eb554b127e95c58ad9b6b5986f5ed6e68
7
- data.tar.gz: 1e5862c9f732860924281639708df572c988d2e48404eacac0ded5ba30ddd3440c8b01785567947f436cd688a18a1d0a7f184a0b6d36a90b0597aa7c368ba936
6
+ metadata.gz: 7193026aece9ad7d995312fa323da7901e2f8f7088c649c194e45197eef328d47c3ee7c0d48a7d914e4876b844459be105055bb9f47c8fccaa1dc507f88787c4
7
+ data.tar.gz: 6533b4007fa041e5a8799d7c5c8d408adb9f6936363b8b8a280ede8e571edc363ebcff17faa5e11af0410727bdeac970f55587703b9cb5e67cd17483603dd34b
data/README.md CHANGED
@@ -25,6 +25,12 @@ Or install it yourself as:
25
25
  > "hello world".to_sha1
26
26
  => "2aae6c35c94fcfb415dbe95f408b9ce91ee846ed"
27
27
 
28
+ > Rickshaw::SHA256.hash("LICENSE.txt")
29
+ => "34c15a6c0d68a79f320f7c0d11ab50f2cb9b0cb9f8bd791ce06340f7448df289"
30
+
31
+ > "hello world".to_sha256
32
+ => "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"
33
+
28
34
  ## Contributing
29
35
 
30
36
  1. Fork it
@@ -0,0 +1,5 @@
1
+ class String
2
+ def to_md5
3
+ Digest::MD5.hexdigest self
4
+ end
5
+ end
@@ -1,10 +1,25 @@
1
+ require 'digest/md5'
1
2
  require 'digest/sha1'
2
3
  require 'digest/sha2'
3
4
  require 'rickshaw/version'
5
+ require 'core_ext/string/to_md5'
4
6
  require 'core_ext/string/to_sha1'
5
7
  require 'core_ext/string/to_sha256'
6
8
 
7
9
  module Rickshaw
10
+ module MD5
11
+ def self.hash(file_path)
12
+ hash = Digest::MD5.new
13
+ open(file_path, 'r') do |io|
14
+ until io.eof?
15
+ buffer = io.read(1024)
16
+ hash.update(buffer)
17
+ end
18
+ end
19
+ hash.hexdigest
20
+ end
21
+ end
22
+
8
23
  module SHA1
9
24
  def self.hash(file_path)
10
25
  hash = Digest::SHA1.new
@@ -1,3 +1,3 @@
1
1
  module Rickshaw
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rickshaw
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregory Ostermayr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-01 00:00:00.000000000 Z
11
+ date: 2014-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -50,6 +50,7 @@ files:
50
50
  - LICENSE.txt
51
51
  - README.md
52
52
  - Rakefile
53
+ - lib/core_ext/string/to_md5.rb
53
54
  - lib/core_ext/string/to_sha1.rb
54
55
  - lib/core_ext/string/to_sha256.rb
55
56
  - lib/rickshaw.rb