lib/renuo/cli/app/redmine/csv_base_service.rb in renuo-cli-3.1.7 vs lib/renuo/cli/app/redmine/csv_base_service.rb in renuo-cli-4.2.0
- old
+ new
@@ -1,10 +1,12 @@
+# frozen_string_literal: true
+
require 'csv'
module Redmine
class CsvBaseService
- API_LOCATION = 'https://redmine.renuo.ch'.freeze
+ API_LOCATION = 'https://redmine.renuo.ch'
def initialize(token)
@token = token
end
@@ -38,10 +40,10 @@
def parse_csv(body)
separated_csv_entries = CSV.parse(body, col_sep: ',')
keys = separated_csv_entries.shift[1..-2]
entries = separated_csv_entries.shift[1..-2]
- Hash[keys.zip(entries)]
+ keys.zip(entries).to_h
rescue CSV::MalformedCSVError
raise_bad_data_error
end
def raise_bad_data_error