nsisam 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/nsisam/client.rb +4 -3
- data/lib/nsisam/response.rb +4 -4
- data/nsisam.gemspec +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.1
|
data/lib/nsisam/client.rb
CHANGED
@@ -54,8 +54,8 @@ module NSISam
|
|
54
54
|
# @example
|
55
55
|
# nsisam.store_file(File.read("foo.txt"))
|
56
56
|
# nsisam.store_file(File.read("foo.txt"), :video)
|
57
|
-
def store_file(file_content, type=:file)
|
58
|
-
store(type => Base64.encode64(file_content))
|
57
|
+
def store_file(file_content, filename, type=:file)
|
58
|
+
store(type => Base64.encode64(file_content), :filename => filename)
|
59
59
|
end
|
60
60
|
|
61
61
|
# Delete data at a given SAM key
|
@@ -113,7 +113,8 @@ module NSISam
|
|
113
113
|
Response.new(
|
114
114
|
'key' => response.key,
|
115
115
|
'checksum' => response.checksum,
|
116
|
-
'
|
116
|
+
'filename' => response.data['filename'],
|
117
|
+
'file' => Base64.decode64(response.data[type.to_s]),
|
117
118
|
'deleted' => response.deleted?)
|
118
119
|
end
|
119
120
|
|
data/lib/nsisam/response.rb
CHANGED
@@ -4,11 +4,11 @@ module NSISam
|
|
4
4
|
# @attr [Hash, String, Array] data The stored object
|
5
5
|
class Response
|
6
6
|
def initialize(hash)
|
7
|
-
@key, @checksum, @data, @deleted = hash.values_at(
|
8
|
-
'key', 'checksum', 'data', 'deleted')
|
7
|
+
@key, @checksum, @data, @deleted, @filename, @file = hash.values_at(
|
8
|
+
'key', 'checksum', 'data', 'deleted', 'filename', 'file')
|
9
9
|
end
|
10
10
|
|
11
|
-
attr_reader :key, :checksum, :data
|
11
|
+
attr_reader :key, :checksum, :data, :filename, :file
|
12
12
|
|
13
13
|
# Check if some data was deleted sucessfully
|
14
14
|
#
|
@@ -18,4 +18,4 @@ module NSISam
|
|
18
18
|
!!@deleted
|
19
19
|
end
|
20
20
|
end
|
21
|
-
end
|
21
|
+
end
|
data/nsisam.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nsisam
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -172,7 +172,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
172
172
|
version: '0'
|
173
173
|
segments:
|
174
174
|
- 0
|
175
|
-
hash:
|
175
|
+
hash: 2048548786722952462
|
176
176
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
177
177
|
none: false
|
178
178
|
requirements:
|