blobsterix 0.0.26 → 0.0.27
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 +4 -4
- data/CHANGELOG.txt +2 -0
- data/lib/blobsterix/storage/file_system_meta_data.rb +9 -3
- data/lib/blobsterix/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: 68fb2005862b18ec60e73f2864bad3eb88b9bd4c
|
4
|
+
data.tar.gz: 1ac5546d2811121064aaf564b30342dfb8b911a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40889006e4d459f5d62a9828175a37ffa804b96e14d8692f64cb91df9362e0d0f8a599df3b070f0f85866ce7901a95005431a71f9d921d50bd140ec0e76d64f9
|
7
|
+
data.tar.gz: cf49a09033e107cf4070e8739c586ff4a2d4bb0e9bdb89812874a24102f45cd70aea6862bad495a2053e8eb686982e01d80c6662cb2cb28cac2201c560667876
|
data/CHANGELOG.txt
CHANGED
@@ -75,7 +75,7 @@ module Blobsterix
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def payload
|
78
|
-
@payload
|
78
|
+
@payload||={}
|
79
79
|
end
|
80
80
|
|
81
81
|
def write
|
@@ -119,16 +119,22 @@ module Blobsterix
|
|
119
119
|
end
|
120
120
|
|
121
121
|
def as_json
|
122
|
-
{'mimetype' => mimetype, 'mediatype' => mediatype, 'etag' => etag, 'size' => size,'payload' =>
|
122
|
+
{'mimetype' => mimetype, 'mediatype' => mediatype, 'etag' => etag, 'size' => size,'payload' => payload.to_json}
|
123
123
|
end
|
124
124
|
|
125
125
|
private
|
126
|
+
def mime_path
|
127
|
+
unzip_trafo = (payload[:trafo].select do |t|
|
128
|
+
t[0] == "unzip"
|
129
|
+
end if payload && payload[:trafo]) || [[nil,nil]]
|
130
|
+
(unzip_trafo[0][1] if unzip_trafo[0]) || path
|
131
|
+
end
|
126
132
|
def meta_path
|
127
133
|
@meta_path ||= "#{path}.meta"
|
128
134
|
end
|
129
135
|
|
130
136
|
def get_mime
|
131
|
-
@mimeclass ||= (MimeMagic.by_magic(File.open(path)) if File.exists?(path) )|| MimeMagic.new("text/plain")
|
137
|
+
@mimeclass ||= (MimeMagic.by_path(mime_path) || ((MimeMagic.by_magic(File.open(path)) if File.exists?(path)) ) || MimeMagic.new("text/plain"))
|
132
138
|
end
|
133
139
|
def save_meta_file
|
134
140
|
return if not valid
|
data/lib/blobsterix/version.rb
CHANGED