data_processor 0.2.0 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8992f6b170310848c8c18c5d9e6dda6f61c60e6e
4
- data.tar.gz: 2fbc81f4985ac7edc2e7c253817ed8da22e0067b
3
+ metadata.gz: 80248b8f5804b4fe7f7705f03b7bda963c88d24b
4
+ data.tar.gz: 83b8aac9a9223031922abd1e2072bf6a0bfb96be
5
5
  SHA512:
6
- metadata.gz: e550edb2a630fd902e2306dc59d8e923f85750cf2bd183b640766961182cdac820f691e762805b05d4f49fe866dc2d5d8603521437e3747fff32b37c30a97c2f
7
- data.tar.gz: 2334a1d7b9810dc805235e4992cc97afe5a12d97103509c081650c46dfc164c1d1375f5436f526f6e8871b8e44de7b283d85ae6c65287dc484f6e3e86a56ee38
6
+ metadata.gz: 13b93d46d1534845fe80a58e2e74892a9a74b30dfeeb62a7af2f45b7a6ca15806a2a36100a4708c89c9415f59c6570e665cd0e6a2c9ae0c7cdd5731865dd7eba
7
+ data.tar.gz: 6b79c57cf12e660e3a617daebf2c2158fe1e0d11b2215ce8eae5c6a59111edffa70ec746fc4f39443721003c44a63569d86da029721ba0eb6f1fb6e9f4ef5dd4
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # Changelog
2
2
 
3
3
 
4
+ ## 0.2.1
5
+
6
+ - Ensure correct paths (ie. fix trailing & leading slashes)
7
+
8
+
4
9
  ## 0.2.0
5
10
 
6
11
  - Path traversing is now a seperate method (helpers module)
@@ -16,8 +16,8 @@ class DataProcessor
16
16
  include DataProcessor::Output
17
17
 
18
18
  def initialize(initial_path="./")
19
+ @initial_path = initial_path.sub(/\/+$/, "")
19
20
  @data = {}
20
- @initial_path = initial_path
21
21
 
22
22
  create_markdown_parser
23
23
  end
@@ -2,10 +2,11 @@ class DataProcessor
2
2
  module Import
3
3
 
4
4
  def import(path="", data_obj=nil)
5
- path = path.sub(/^\//, "")
5
+ path = path.sub(/^\/+/, "")
6
+ path = path.sub(/\/+$/, "")
6
7
 
7
8
  data_hash = data_obj || @data
8
- full_path = @initial_path + path
9
+ full_path = File.join(@initial_path, path)
9
10
 
10
11
  Dir.foreach(full_path) do |filename|
11
12
  next if filename[0] == "."
@@ -1,3 +1,3 @@
1
1
  class DataProcessor
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_processor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Vandevelde