pansophy 0.5.5 → 0.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/pansophy/remote/create_file.rb +22 -1
- data/lib/pansophy/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0697012f29b19bf39c9ebec84a2c6cfef69b8d39'
|
4
|
+
data.tar.gz: 1f601a1bfef0dab266c7955c2f1a4ffc11896dae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aeaaadc2312f0f72cc78e262e3df5f933f71921f9f3c067206f110e73b588866f7296c18da3e7d2fab40c7768a8bddd2c83c89120ba8a88a01e8c04f7ec1ac41
|
7
|
+
data.tar.gz: d9c61b78815803272b97b45ac9e27c2d0b36cbec905bf9996f44cff35a409d67458776d50320c77d2bd1fc90ff968fd784ffefb28551a21751086c7d27879006
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,28 @@
|
|
1
|
+
require 'facets/hash/slice'
|
2
|
+
|
1
3
|
module Pansophy
|
2
4
|
module Remote
|
3
5
|
class CreateFile
|
4
6
|
include Adamantium::Flat
|
5
7
|
|
8
|
+
ALLOWED_ATTRS = %i[
|
9
|
+
cache_control
|
10
|
+
content_disposition
|
11
|
+
content_encoding
|
12
|
+
content_length
|
13
|
+
content_md5
|
14
|
+
content_type
|
15
|
+
etag
|
16
|
+
expires
|
17
|
+
last_modified
|
18
|
+
metadata
|
19
|
+
owner
|
20
|
+
storage_class
|
21
|
+
encryption
|
22
|
+
encryption_key
|
23
|
+
version
|
24
|
+
].freeze
|
25
|
+
|
6
26
|
def initialize(bucket, path, body)
|
7
27
|
@bucket = bucket
|
8
28
|
@pathname = Pathname.new(path)
|
@@ -11,7 +31,8 @@ module Pansophy
|
|
11
31
|
|
12
32
|
def call(options = {})
|
13
33
|
prevent_overwrite! unless options[:overwrite]
|
14
|
-
|
34
|
+
file_attributes = options.slice(*ALLOWED_ATTRS)
|
35
|
+
directory.files.create(file_attributes.merge(key: @pathname.to_s, body: @body.dup))
|
15
36
|
end
|
16
37
|
|
17
38
|
private
|
data/lib/pansophy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pansophy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alessandro Berardi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-aws
|
@@ -269,7 +269,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
269
269
|
version: '0'
|
270
270
|
requirements: []
|
271
271
|
rubyforge_project:
|
272
|
-
rubygems_version: 2.
|
272
|
+
rubygems_version: 2.6.12
|
273
273
|
signing_key:
|
274
274
|
specification_version: 4
|
275
275
|
summary: Information sharing via centralised repository
|