file_pool 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/file_pool.rb +8 -3
- data/lib/file_pool/version.rb +1 -1
- metadata +72 -46
- checksums.yaml +0 -7
data/lib/file_pool.rb
CHANGED
|
@@ -74,21 +74,26 @@ module FilePool
|
|
|
74
74
|
# === Return Value:
|
|
75
75
|
#
|
|
76
76
|
# :: *String* containing a new unique ID for the file added.
|
|
77
|
-
def self.add!
|
|
77
|
+
def self.add! orig_path
|
|
78
78
|
newid = uuid
|
|
79
79
|
target = path newid
|
|
80
80
|
|
|
81
81
|
if @@crypted_mode
|
|
82
82
|
FileUtils.mkpath(id2dir_secured newid)
|
|
83
|
-
path = crypt(
|
|
83
|
+
path = crypt(orig_path)
|
|
84
84
|
else
|
|
85
|
+
path = orig_path
|
|
85
86
|
FileUtils.mkpath(id2dir newid)
|
|
86
87
|
end
|
|
87
88
|
|
|
88
89
|
if !@@copy_source and (File.stat(path).dev == File.stat(File.dirname(target)).dev)
|
|
89
90
|
FileUtils.link(path, target)
|
|
90
91
|
else
|
|
91
|
-
FileUtils.copy(path, target)
|
|
92
|
+
FileUtils.copy(path, target)
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# don't chmod if orginal file is same as target (hard-linked)
|
|
96
|
+
if File.stat(orig_path).ino != File.stat(File.dirname(target)).ino
|
|
92
97
|
FileUtils.chmod(@@mode, target) if @@mode
|
|
93
98
|
FileUtils.chown(@@owner, @@group, target)
|
|
94
99
|
end
|
data/lib/file_pool/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,78 +1,104 @@
|
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: file_pool
|
|
3
|
-
version: !ruby/object:Gem::Version
|
|
4
|
-
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
hash: 9
|
|
5
|
+
prerelease:
|
|
6
|
+
segments:
|
|
7
|
+
- 0
|
|
8
|
+
- 5
|
|
9
|
+
- 1
|
|
10
|
+
version: 0.5.1
|
|
5
11
|
platform: ruby
|
|
6
|
-
authors:
|
|
7
|
-
- robokopp (Robert
|
|
12
|
+
authors:
|
|
13
|
+
- "robokopp (Robert Anni\xC3\xA9s)"
|
|
8
14
|
autorequire:
|
|
9
15
|
bindir: bin
|
|
10
16
|
cert_chain: []
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
17
|
+
|
|
18
|
+
date: 2018-03-26 00:00:00 +02:00
|
|
19
|
+
default_executable:
|
|
20
|
+
dependencies:
|
|
21
|
+
- !ruby/object:Gem::Dependency
|
|
14
22
|
name: uuidtools
|
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
|
16
|
-
requirements:
|
|
17
|
-
- - "~>"
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: 2.1.2
|
|
20
|
-
type: :runtime
|
|
21
23
|
prerelease: false
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
|
25
|
+
none: false
|
|
26
|
+
requirements:
|
|
27
|
+
- - ~>
|
|
28
|
+
- !ruby/object:Gem::Version
|
|
29
|
+
hash: 15
|
|
30
|
+
segments:
|
|
31
|
+
- 2
|
|
32
|
+
- 1
|
|
33
|
+
- 2
|
|
26
34
|
version: 2.1.2
|
|
27
|
-
|
|
35
|
+
type: :runtime
|
|
36
|
+
version_requirements: *id001
|
|
37
|
+
- !ruby/object:Gem::Dependency
|
|
28
38
|
name: pry
|
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
|
30
|
-
requirements:
|
|
31
|
-
- - ">="
|
|
32
|
-
- !ruby/object:Gem::Version
|
|
33
|
-
version: '0'
|
|
34
|
-
type: :development
|
|
35
39
|
prerelease: false
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
|
41
|
+
none: false
|
|
42
|
+
requirements:
|
|
38
43
|
- - ">="
|
|
39
|
-
- !ruby/object:Gem::Version
|
|
40
|
-
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
hash: 3
|
|
46
|
+
segments:
|
|
47
|
+
- 0
|
|
48
|
+
version: "0"
|
|
49
|
+
type: :development
|
|
50
|
+
version_requirements: *id002
|
|
41
51
|
description: |
|
|
42
52
|
FilePool helps to manage a large number of files in a Ruby
|
|
43
53
|
project. It takes care of the storage of files in a balanced directory
|
|
44
54
|
tree and generates unique identifiers for all files.
|
|
45
|
-
|
|
55
|
+
|
|
56
|
+
email:
|
|
46
57
|
- robokopp@fernwerk.net
|
|
47
58
|
executables: []
|
|
59
|
+
|
|
48
60
|
extensions: []
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
files:
|
|
61
|
+
|
|
62
|
+
extra_rdoc_files:
|
|
52
63
|
- README.md
|
|
64
|
+
files:
|
|
53
65
|
- lib/file_pool.rb
|
|
54
66
|
- lib/file_pool/version.rb
|
|
67
|
+
- README.md
|
|
68
|
+
has_rdoc: true
|
|
55
69
|
homepage: https://github.com/robokopp/file_pool
|
|
56
70
|
licenses: []
|
|
57
|
-
|
|
71
|
+
|
|
58
72
|
post_install_message:
|
|
59
73
|
rdoc_options: []
|
|
60
|
-
|
|
74
|
+
|
|
75
|
+
require_paths:
|
|
61
76
|
- lib
|
|
62
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
77
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
78
|
+
none: false
|
|
79
|
+
requirements:
|
|
80
|
+
- - ~>
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
hash: 3
|
|
83
|
+
segments:
|
|
84
|
+
- 2
|
|
85
|
+
- 0
|
|
86
|
+
version: "2.0"
|
|
87
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
|
+
none: false
|
|
89
|
+
requirements:
|
|
69
90
|
- - ">="
|
|
70
|
-
- !ruby/object:Gem::Version
|
|
71
|
-
|
|
91
|
+
- !ruby/object:Gem::Version
|
|
92
|
+
hash: 3
|
|
93
|
+
segments:
|
|
94
|
+
- 0
|
|
95
|
+
version: "0"
|
|
72
96
|
requirements: []
|
|
97
|
+
|
|
73
98
|
rubyforge_project:
|
|
74
|
-
rubygems_version:
|
|
99
|
+
rubygems_version: 1.6.2
|
|
75
100
|
signing_key:
|
|
76
|
-
specification_version:
|
|
101
|
+
specification_version: 3
|
|
77
102
|
summary: Manage a large number files in a pool
|
|
78
103
|
test_files: []
|
|
104
|
+
|
checksums.yaml
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
SHA1:
|
|
3
|
-
metadata.gz: 92b693e812622ddf1df122afe233c2bde4907921
|
|
4
|
-
data.tar.gz: e126ad5ff94b137c1bd983ea64b438dd60129aff
|
|
5
|
-
SHA512:
|
|
6
|
-
metadata.gz: 0e34e2384e4d185ef4c6063892c18799d82d2b5e8825090d16c843d34e0b33f58e1b0641158e502252e5559226d206480b21027dc25ef41a37a64143ae45ba35
|
|
7
|
-
data.tar.gz: 0db3ef7390c70efd6cc77cb147a0147273caafe9ef0d905866dbd3b8981dd923d7bc25305d5d54bde87318d1a6e424be63559631e5e22efa1134340018d9280a
|