parsefile 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/extractmetadata.rb +12 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 565694f0c2197d0c77b3b6e96e4da03ee02930b5
4
- data.tar.gz: c008fd5f1e9ae074e79bacb8aabb4e2b8ef3755d
3
+ metadata.gz: 06411fba942946a2f8946a545d75018c3638fe3c
4
+ data.tar.gz: 47108b8867072ecffe7d383a991712b95b47d651
5
5
  SHA512:
6
- metadata.gz: 27fb72e4c92ebf5a6ab0b21f47a2278067af42a7572622c5cbb2320677235017d2bca030dcb415c1d50820db1f0009e8dcc7f7f06fcb8b311d7d8e973d50a79a
7
- data.tar.gz: 4e83e5644beb7ca4e073f7e5ef07e8ec697016d242f14462bf7eddf54a9fab6c75750fdaa934c5936594327f1317cd23477a9d9a76723408c648ad2ebb94c0b0
6
+ metadata.gz: ed1ab41eef012a454b2b6f694b2829c1360627521e1f9964cf3a3d5588e9cf10a2f406627cc0592017b8bf09ff3967e1b92c7cae2b08ea582f7b4321834efce2
7
+ data.tar.gz: 469780b671827136b57b43e36870c3584e09f18dcfd332e638f42eec5b7003e8361cdd1ab5cedfec09c122bf91110a294f019713c46987c121a22b397772ac4e
@@ -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.1
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-28 00:00:00.000000000 Z
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