attach 1.0.4 → 1.0.5

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: c38d4921602d73e9b662beaf1ee0a268ddd1f770
4
- data.tar.gz: fa4e5e7c75f918dfb7cb62949d48f95afdaa8ea3
3
+ metadata.gz: 2056ebcc16201f4fe826932ed8db99a711d32e27
4
+ data.tar.gz: 06ccf7d7fe3d431341cbebc15492ce557a5daed8
5
5
  SHA512:
6
- metadata.gz: 6a4a15b37879bffac8fa5ae9e47dba4309d730368a7499eb810551df28f2bfbff3bcfe03c93917df53473f8e65cacf1c651f363dd15da8963238fa69fa357c7d
7
- data.tar.gz: 19249900c3911df22dc0dcf33fca12630245bf14f42e0b29c197e644c206a874eff3bc443a26f7cdd8649c095adec0b5edccb5121b621a147ddeb15f0a9be351
6
+ metadata.gz: 2b769025cdcc24a045e155db751f7a0feaa8094d17b5bec19e5c1b104e791e78113b471f400ee80bf792288e4709047eb632ffc1797677b2fc48e346c67fbb55
7
+ data.tar.gz: 68071df914675ff62f3c862ff93dc8024b8b480158fe72ca64ebc1632c25cac8fcc224e2ea953eec3d1a1a90497debec58f634635b6e4ae3e974bcfd26de98d5
@@ -6,20 +6,20 @@ module Attach
6
6
  class FileSystem < Abstract
7
7
 
8
8
  def read(attachment)
9
- File.read(path_for_attachment(attachment))
9
+ ::File.read(path_for_attachment(attachment))
10
10
  end
11
11
 
12
12
  def write(attachment, data)
13
13
  path = path_for_attachment(attachment)
14
- FileUtils.mkdir_p(File.dirname(path))
15
- File.open(path, 'wb') do |f|
14
+ FileUtils.mkdir_p(::File.dirname(path))
15
+ ::File.open(path, 'wb') do |f|
16
16
  f.write(data)
17
17
  end
18
18
  end
19
19
 
20
20
  def delete(attachment)
21
21
  path = path_for_attachment(attachment)
22
- FileUtils.rm(path) if File.file?(path)
22
+ FileUtils.rm(path) if ::File.file?(path)
23
23
  end
24
24
 
25
25
  private
@@ -29,7 +29,7 @@ module Attach
29
29
  end
30
30
 
31
31
  def path_for_attachment(attachment)
32
- File.join(root_dir, attachment.token[0,2], attachment.token[2,2], attachment.token[4,40])
32
+ ::File.join(root_dir, attachment.token[0,2], attachment.token[2,2], attachment.token[4,40])
33
33
  end
34
34
 
35
35
  end
@@ -14,7 +14,7 @@ module Attach
14
14
  'Content-Length' => attachment.file_size.to_s,
15
15
  'Content-Type' => attachment.file_type,
16
16
  'Cache-Control' => "#{attachment.cache_type || 'private'}, immutable, max-age=#{attachment.cache_max_age || 30.days.to_i}",
17
- 'Content-Disposition' => "#{attachment.disposition || 'attachment'}; filename=\"#{attachment.file_name}\","
17
+ 'Content-Disposition' => "#{attachment.disposition || 'attachment'}; filename=\"#{attachment.file_name}\""
18
18
  },
19
19
  [attachment.binary]]
20
20
  else
@@ -1,3 +1,3 @@
1
1
  module Attach
2
- VERSION = '1.0.4'
2
+ VERSION = '1.0.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attach
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Cooke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-23 00:00:00.000000000 Z
11
+ date: 2019-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: records_manipulator