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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7d7ccbe2f5bb121c1513b812108f858f324345fd
4
- data.tar.gz: 2d7b4fadd579a01084a07c4ab3fb14dadba178ad
3
+ metadata.gz: '0697012f29b19bf39c9ebec84a2c6cfef69b8d39'
4
+ data.tar.gz: 1f601a1bfef0dab266c7955c2f1a4ffc11896dae
5
5
  SHA512:
6
- metadata.gz: 42a936bc086cf5eb2d2486cff4383b096970ce4523680be4fd57a94de87fd171e146813d2367745a55956cd3c6cd2316ce79b00c48541e9e1a5503ea2e996fc4
7
- data.tar.gz: bb89b98caaa4696db89d18c7f4e6859534ef7fecdd46096fb46810794d935fcec02aa2fb00317bff23546625d6ea3c9566c55679e90f8e0dc9c0a6f92d4e4ff1
6
+ metadata.gz: aeaaadc2312f0f72cc78e262e3df5f933f71921f9f3c067206f110e73b588866f7296c18da3e7d2fab40c7768a8bddd2c83c89120ba8a88a01e8c04f7ec1ac41
7
+ data.tar.gz: d9c61b78815803272b97b45ac9e27c2d0b36cbec905bf9996f44cff35a409d67458776d50320c77d2bd1fc90ff968fd784ffefb28551a21751086c7d27879006
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.5.6]
6
+ ### Changed
7
+ - Allow specifying file attributes when creating files
8
+
5
9
  ## [0.5.5]
6
10
  ### Fixed
7
11
  - Remove overly strict dependencies
@@ -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
- directory.files.create(key: @pathname.to_s, body: @body.dup)
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
@@ -1,3 +1,3 @@
1
1
  module Pansophy
2
- VERSION = '0.5.5'
2
+ VERSION = '0.5.6'
3
3
  end
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.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-05-12 00:00:00.000000000 Z
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.4.8
272
+ rubygems_version: 2.6.12
273
273
  signing_key:
274
274
  specification_version: 4
275
275
  summary: Information sharing via centralised repository