file_distribution 0.2.0 → 0.2.2
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.
- checksums.yaml +4 -4
- data/LICENSE +2 -2
- data/lib/file_distribution.rb +4 -5
- data/test/test_file_distribution.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9c5d0ae4ba5ce7f6dd69fc75b1b82855e17a402
|
4
|
+
data.tar.gz: b34fb80cc78f1e2e7258554c079b85707a1da796
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42646d716562e95aef5d89f06d4ef74644c404b307ffdf7c75b69af99944c986899271091220e72a8146672a866fa9f3282e43fcaf42444cbea7c01146b68a42
|
7
|
+
data.tar.gz: ae6017973fbdbf7bab4738af3dac7281519eabee810ffc98db6ab61977fa6dabc3be3f7bda7f3d7040546181b4201bd50e13abbbc6071d099ae07b3bab6dca86
|
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
(The MIT License)
|
2
2
|
|
3
|
-
Copyright (c) 2013 Adam Kubica <
|
3
|
+
Copyright (c) 2013 Adam Kubica <xcdr@kaizen-step.com>
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
6
6
|
a copy of this software and associated documentation files (the
|
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
19
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
20
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
21
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/file_distribution.rb
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
#
|
2
|
-
# @author: Adam Kubica (
|
2
|
+
# @author: Adam Kubica (xcdr) <xcdr@kaizen-step.com>
|
3
3
|
#
|
4
4
|
|
5
5
|
#
|
6
6
|
# Class for manage hashed file distribution.
|
7
7
|
#
|
8
8
|
class FileDistribution
|
9
|
-
|
10
9
|
# Creates new instance with directory prefix.
|
11
10
|
#
|
12
11
|
# Params:
|
@@ -22,7 +21,7 @@ class FileDistribution
|
|
22
21
|
def set_extension(ext)
|
23
22
|
@ext = ext
|
24
23
|
|
25
|
-
@ext =
|
24
|
+
@ext = format('.%s', ext) if !ext.empty? && ext.chars.first != '.'
|
26
25
|
end
|
27
26
|
|
28
27
|
# Returns Destination path.
|
@@ -33,8 +32,8 @@ class FileDistribution
|
|
33
32
|
# Params:
|
34
33
|
# - id: database file ID etc.
|
35
34
|
def hex_path(id)
|
36
|
-
hex =
|
37
|
-
hex =
|
35
|
+
hex = format('%x', id)
|
36
|
+
hex = format('0%s', hex) if hex.length.odd?
|
38
37
|
@path = File.join(@prefix, hex.scan(/../))
|
39
38
|
@path += @ext
|
40
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: file_distribution
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Kubica
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: 10.0.0
|
33
33
|
description: Simple library that allows organize distribution of files within hex
|
34
34
|
based tree.
|
35
|
-
email:
|
35
|
+
email: xcdr@kaizen-step.com
|
36
36
|
executables: []
|
37
37
|
extensions: []
|
38
38
|
extra_rdoc_files: []
|
@@ -41,7 +41,7 @@ files:
|
|
41
41
|
- Rakefile
|
42
42
|
- lib/file_distribution.rb
|
43
43
|
- test/test_file_distribution.rb
|
44
|
-
homepage:
|
44
|
+
homepage: https://github.com/xcdr/fdist-ruby
|
45
45
|
licenses:
|
46
46
|
- MIT
|
47
47
|
metadata: {}
|
@@ -62,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
62
62
|
version: '0'
|
63
63
|
requirements: []
|
64
64
|
rubyforge_project:
|
65
|
-
rubygems_version: 2.
|
65
|
+
rubygems_version: 2.6.11
|
66
66
|
signing_key:
|
67
67
|
specification_version: 4
|
68
68
|
summary: Simple file distribution library.
|