Skip to content

Commit

Permalink
Merge branch 'patch-1' of github.com:MichaelCordingley/jekyll into pa…
Browse files Browse the repository at this point in the history
…tch-1
  • Loading branch information
MichaelCordingley committed Mar 22, 2022
2 parents 2887593 + 93625f4 commit 81eb8f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions lib/jekyll/readers/data_reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def tsv_config
# @param config_key [String]
# @param overrides [Hash]
# @return [Hash]
# @see https://ruby-doc.org/stdlib-2.6.1/libdoc/csv/rdoc/CSV.html#Converters
# @see https://ruby-doc.org/stdlib-2.5.0/libdoc/csv/rdoc/CSV.html#Converters
def read_config(config_key, overrides = {})
reader_config = config[config_key] || {}

Expand All @@ -107,9 +107,7 @@ def config
# @param row [Array, CSV::Row]
# @return [Array, Hash]
def convert_row(row)
return row.to_hash if row.instance_of? CSV::Row

row
row.instance_of?(CSV::Row) ? row.to_hash : row
end
end
end
2 changes: 1 addition & 1 deletion test/test_data_reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class TestDataReader < JekyllUnitTest
setup do
reader_config = {
"csv_converters" => [:numeric],
"headers" => false,
"headers" => false,
}

@reader = DataReader.new(
Expand Down

0 comments on commit 81eb8f4

Please sign in to comment.