bfs 0.6.4 → 0.6.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
  SHA256:
3
- metadata.gz: d726d92a3fceb9313a497b3de260dde2d7ac4a26bbf7bbdcbdcd8b4b9f85225b
4
- data.tar.gz: de306b8f11a3b5de6f5bfef0a5e18325c30cd92bccb9aae05c09299ffae7275b
3
+ metadata.gz: 42c7ec0b9c8599e48be9756f29d10f2f023cac4ed533567ce3e25f3b9ccdcbfc
4
+ data.tar.gz: 2d63d874378606434e6311491c80b5993a21da95d465ec71c526e80faa2aa989
5
5
  SHA512:
6
- metadata.gz: 5e09611641b682056651a500e17a6913004c45f0f852264cad2fa4133910d51241039370824b171c2eb49f5fee0ad60f7ea8ad9982b40539a0542f965a94d191
7
- data.tar.gz: 793230a864db0e7ed4c6e01b2dad75c5a71c2fc0dbaf593003d0050f3b4b39e7d7eb679483b55cb4f107a5898e9cac7be17f1c291aa95d6e5287dad132efa69c
6
+ metadata.gz: 05f54cb6d54163291b5c4ba7df49d3bb358aa9ac524d2b73492265a67635b864be8fd710a0f5a7eca10c7420d8060fe64483e28d5b135a4e1272bb11000ce8cf
7
+ data.tar.gz: a4d43696270f615cd187952a88949b3e45fd3cfd0ad34a52d5cb2d8e52c1d50dba250d03a8bcb2f4ff85f1b12894ddcf464078555da98b0a13e3c8f962588a0d
@@ -9,9 +9,15 @@ module BFS
9
9
  # @param [Hash] opts options
10
10
  # @option opts [String] :encoding Custom encoding. Default: Encoding.default_external.
11
11
  # @option opts [Integer] :perm optional file permissions. Default: 0600.
12
- def initialize(encoding: Encoding.default_external, **_opts)
12
+ def initialize(encoding: Encoding.default_external, perm: nil, **_opts)
13
13
  @encoding = encoding
14
- @perm = perm
14
+
15
+ case perm
16
+ when Integer
17
+ @perm = perm
18
+ when String
19
+ @perm = perm.to_i(8)
20
+ end
15
21
  end
16
22
 
17
23
  # Lists the contents of a bucket using a glob pattern
@@ -17,7 +17,14 @@ RSpec.describe BFS::Bucket::FS do
17
17
  expect(bucket.ls.to_a).to eq(['test.txt'])
18
18
  end
19
19
 
20
- it 'should support custom perms' do
20
+ it 'should support custom perms on #initialize' do
21
+ blob = BFS::Blob.new("file://#{tmpdir}/test.txt?perm=0666")
22
+ blob.create {|w| w.write 'foo' }
23
+ expect(blob.info.mode).to eq(0o666)
24
+ blob.close
25
+ end
26
+
27
+ it 'should support custom perms on #create' do
21
28
  blob = BFS::Blob.new("file://#{tmpdir}/test.txt")
22
29
  blob.create(perm: 0o666) {|w| w.write 'foo' }
23
30
  expect(blob.info.mode).to eq(0o666)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bfs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimitrij Denissenko