MrMurano 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/MrMurano/Solution-File.rb +15 -3
- data/lib/MrMurano/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ba16e5f2344bf987358a56dada5f3e3b8c4cc88
|
4
|
+
data.tar.gz: 6528a533043deae3b1e81493e52fee94772506c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c66eccf67ca91de551b15493faa4059c648eb83f60c6b6fc39839a6938ab91a35795e3291c3630df1ac660cb0fcb0ff82b96afcea8353b84ef5a0d1855f1cfbe
|
7
|
+
data.tar.gz: 29c38a617d405be2c6d732e19369c4f46147f98ffa82bc86394ffaabc34693d7696fcd38df139506732829948f9f26c3090650adf381b1fb49f57ccb606fbe34
|
@@ -120,10 +120,22 @@ module MrMurano
|
|
120
120
|
|
121
121
|
mime = MIME::Types.type_for(path.to_s)[0] || MIME::Types["application/octet-stream"][0]
|
122
122
|
|
123
|
-
#
|
124
|
-
|
123
|
+
# It does not actually take the SHA1 of the file.
|
124
|
+
# It first converts the file to hex, then takes the SHA1 of that string
|
125
|
+
#sha1 = Digest::SHA1.file(path.to_s).hexdigest
|
126
|
+
def hexit(str)
|
127
|
+
ret=''
|
128
|
+
str.each_byte{|b| ret << "%02x" % b}
|
129
|
+
ret
|
130
|
+
end
|
131
|
+
sha1 = Digest::SHA1.new
|
132
|
+
path.open('rb:ASCII-8BIT') do |io|
|
133
|
+
while chunk = io.read(4096) do
|
134
|
+
sha1 << hexit(chunk)
|
135
|
+
end
|
136
|
+
end
|
125
137
|
|
126
|
-
{:path=>name, :mime_type=>mime.simplified, :checksum=>sha1}
|
138
|
+
{:path=>name, :mime_type=>mime.simplified, :checksum=>sha1.hexdigest}
|
127
139
|
end
|
128
140
|
|
129
141
|
def synckey(item)
|
data/lib/MrMurano/version.rb
CHANGED