smarter_csv 1.10.0 → 1.10.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f1d0b58acf0135b621e3182470674230ef73b48c829810e74fffa975fc318cf5
4
- data.tar.gz: ee404c5c485748d35cda36b8d249cb6813a3f80005182fe8c05feac1694aba57
3
+ metadata.gz: '0219682a1b64a05b1310b3fb288d6ac69f2af7702308160d4fa808dcbaaa1243'
4
+ data.tar.gz: 5fced0b9dd9334842aa7bad61073e0a90048dc0e6ba0ac30df59fe4187d9a58d
5
5
  SHA512:
6
- metadata.gz: 4fee097fe2237f863510100155062da6815237260da5b15189f104f54596f7d5ff0479deb80596544e0bb1b9ba7b78126d2251798721e8d2f91e06b430950cd6
7
- data.tar.gz: c30562965452ef296b5e5aaf2a9a12887aa42d8e8396780b73b34f99a2386d232bf020578618fcbd65186fc864518c81a3e7555cae9b00a005322f3599e18c5a
6
+ metadata.gz: 2ecc95c635c6d8eff39355f4af85422aebd05ca8a599085854e976073ca450f71bd49c498619593d455bd2cb9e4c6c705bc37900d012b5759fdc2077fceb893a
7
+ data.tar.gz: d3b3d7f062c9f2f5838ef2099e1d5a7fedca4061d4f6c7d8e91ecb55b61d73a18efda8b5f00aa68c96452b4385e062d439cc04dd7df8e89395fab94e472e9ab7
data/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
 
2
2
  # SmarterCSV 1.x Change Log
3
3
 
4
+ ## 1.10.2 (2024-02-11)
5
+ * improve error message for missing keys
6
+
7
+ ## 1.10.1 (2024-01-07)
8
+ * fix incorrect warning about UTF-8 (issue #268, thanks hirowatari)
9
+
4
10
  ## 1.10.0 (2023-12-31) ⚡ BREAKING ⚡
5
11
 
6
12
  * BREAKING CHANGES:
data/CONTRIBUTORS.md CHANGED
@@ -51,3 +51,4 @@ A Big Thank you to everyone who filed issues, sent comments, and who contributed
51
51
  * [Rahul Chaudhary](https://github.com/rahulch95)
52
52
  * [Alessandro Fazzi](https://github.com/pioneerskies)
53
53
  * [JP Camara](https://github.com/jpcamara)
54
+ * [Kenton Hirowatari](https://github.com/hirowatari)
data/README.md CHANGED
@@ -23,13 +23,8 @@
23
23
 
24
24
  * default branch is `main` for 1.x development
25
25
 
26
- * 2.x development is on `2.0-development` (check this branch for 2.0 documentation)
27
- - This is an EXPERIMENTAL branch - DO NOT USE in production
28
-
29
- #### Work towards Future Version 2.x
30
-
31
- * Work towards SmarterCSV 2.x is still ongoing, with improved features, and more streamlined options, but consider it as experimental at this time.
32
- Please check the [2.0-develop branch](https://github.com/tilo/smarter_csv/tree/2.0-develop), open any issues and pull requests with mention of tag v2.0.
26
+ * 2.x development is [MOVED TO THIS PR](https://github.com/tilo/smarter_csv/pull/267)
27
+ - 2.x behavior is still EXPERIMENTAL - DO NOT USE in production
33
28
 
34
29
  ---------------
35
30
 
@@ -26,7 +26,7 @@ module SmarterCSV
26
26
  missing_keys = options[:required_keys].select { |k| !headers_set.include?(k) }
27
27
 
28
28
  unless missing_keys.empty?
29
- raise SmarterCSV::MissingKeys, "ERROR: missing attributes: #{missing_keys.join(',')}"
29
+ raise SmarterCSV::MissingKeys, "ERROR: missing attributes: #{missing_keys.join(',')}. Check `SmarterCSV.headers` for original headers."
30
30
  end
31
31
  end
32
32
  end
@@ -22,7 +22,7 @@ module SmarterCSV
22
22
  begin
23
23
  fh = input.respond_to?(:readline) ? input : File.open(input, "r:#{options[:file_encoding]}")
24
24
 
25
- if @enforce_utf8 && (fh.respond_to?(:external_encoding) && fh.external_encoding != Encoding.find('UTF-8') || fh.respond_to?(:encoding) && fh.encoding != Encoding.find('UTF-8'))
25
+ if (options[:force_utf8] || options[:file_encoding] =~ /utf-8/i) && (fh.respond_to?(:external_encoding) && fh.external_encoding != Encoding.find('UTF-8') || fh.respond_to?(:encoding) && fh.encoding != Encoding.find('UTF-8'))
26
26
  puts 'WARNING: you are trying to process UTF-8 input, but did not open the input with "b:utf-8" option. See README file "NOTES about File Encodings".'
27
27
  end
28
28
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SmarterCSV
4
- VERSION = "1.10.0"
4
+ VERSION = "1.10.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smarter_csv
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tilo Sloboda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-31 00:00:00.000000000 Z
11
+ date: 2024-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  requirements: []
154
- rubygems_version: 3.5.3
154
+ rubygems_version: 3.2.3
155
155
  signing_key:
156
156
  specification_version: 4
157
157
  summary: Ruby Gem for smarter importing of CSV Files (and CSV-like files), with lots