Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/concurrent ruby rails70 testing #137

Merged
merged 2 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
## [Unreleased]
### Fixed
* Fix CSV parsing bug

### Added
* Column zipping functionality *
* Capturing Column name *
Expand Down
3 changes: 3 additions & 0 deletions gemfiles/Gemfile.rails61
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ source 'https://rubygems.org'
gemspec path: '..'

gem 'activesupport', '~> 6.1.0'

# Latest concurrent-ruby breaks Rails < 7.1. See https://github.com/rails/rails/issues/54260
gem 'concurrent-ruby', '1.3.4'
3 changes: 3 additions & 0 deletions gemfiles/Gemfile.rails70
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ source 'https://rubygems.org'
gemspec path: '..'

gem 'activesupport', '~> 7.0.0'

# Latest concurrent-ruby breaks Rails < 7.1. See https://github.com/rails/rails/issues/54260
gem 'concurrent-ruby', '1.3.4'
4 changes: 2 additions & 2 deletions lib/ndr_import/helpers/file/delimited.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ def delimited_tables(path, col_sep = nil, liberal = false)
end

# Iterate through the file line by line, yielding each one in turn.
def delimited_rows(path, col_sep = nil, liberal = false)
def delimited_rows(path, col_sep = nil, liberal = false) # rubocop:disable Style/OptionalBooleanParameter
return enum_for(:delimited_rows, path, col_sep, liberal) unless block_given?

safe_path = SafeFile.safepath_to_string(path)
options = determine_encodings!(safe_path, col_sep, liberal)

# By now, we know `options` should let us read the whole
# file succesfully; if there are problems, we should crash.
CSV.foreach(safe_path, options.delete(:mode), **options) do |line|
CSV.foreach(safe_path, options[:mode], **options.except(:mode)) do |line|
yield line.map(&:to_s)
end
end
Expand Down