parsefile 0.0.1 → 0.0.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/lib/extractmetadata.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06411fba942946a2f8946a545d75018c3638fe3c
|
4
|
+
data.tar.gz: 47108b8867072ecffe7d383a991712b95b47d651
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed1ab41eef012a454b2b6f694b2829c1360627521e1f9964cf3a3d5588e9cf10a2f406627cc0592017b8bf09ff3967e1b92c7cae2b08ea582f7b4321834efce2
|
7
|
+
data.tar.gz: 469780b671827136b57b43e36870c3584e09f18dcfd332e638f42eec5b7003e8361cdd1ab5cedfec09c122bf91110a294f019713c46987c121a22b397772ac4e
|
data/lib/extractmetadata.rb
CHANGED
@@ -15,6 +15,7 @@ class ExtractMetadata
|
|
15
15
|
# Get relative path
|
16
16
|
@rel_path = get_rel_path
|
17
17
|
outhash[:rel_path] = @rel_path
|
18
|
+
outhash[:folders] = get_folders
|
18
19
|
|
19
20
|
# Get formatted name and file type
|
20
21
|
outhash[:formatted_name] = get_formatted_name
|
@@ -25,6 +26,17 @@ class ExtractMetadata
|
|
25
26
|
return outhash
|
26
27
|
end
|
27
28
|
|
29
|
+
# Split relative path and get array of directories
|
30
|
+
def get_folders
|
31
|
+
folders = @rel_path.split("/")
|
32
|
+
|
33
|
+
# Remove file and empty items
|
34
|
+
folders.delete(folders.last)
|
35
|
+
folders.delete("")
|
36
|
+
|
37
|
+
return folders
|
38
|
+
end
|
39
|
+
|
28
40
|
# Get the relative path
|
29
41
|
def get_rel_path
|
30
42
|
@path.gsub(@input_dir, "")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parsefile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- M. C. McGrath
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: OCR file and extract metadata
|
14
14
|
email: shidash@shidash.com
|