Skip to content

Commit

Permalink
Merge pull request #18 from bpvickers/bug-fix
Browse files Browse the repository at this point in the history
Bug fix for first_match path rows scan.
  • Loading branch information
bpvickers authored Feb 12, 2018
2 parents 6b87729 + cf9797c commit e35cb91
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v0.5.1, 12 February 2018.
*Bug Fix*
- Fix bug when using a path to scan for a first match.

## v0.5.0, 11 February 2018.
*Additions*
- Add the ability to specify an input hash path using path: column types.
Expand Down
2 changes: 1 addition & 1 deletion csv_decision.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

Gem::Specification.new do |spec|
spec.name = 'csv_decision'
spec.version = '0.5.0'
spec.version = '0.5.1'
spec.authors = ['Brett Vickers']
spec.email = ['brett@phillips-vickers.com']
spec.description = 'CSV based Ruby decision tables.'
Expand Down
3 changes: 2 additions & 1 deletion lib/csv_decision/scan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ def self.scan_first_match(input:, decision:, input_hashes:)
data = input_hashes.data(decision: decision, path: path, input: input)
next if data == {}

# Note that +rows+ must be enclosed in an array for this method to work.
result = decision.index_scan_first_match(
scan_cols: data[:scan_cols],
hash: data[:hash],
index_rows: Array(rows)
index_rows: [rows]
)
return result if result != {}
end
Expand Down

0 comments on commit e35cb91

Please sign in to comment.