cellar 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cellar.rb +5 -4
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3cec8c74c1ac06565b7f325100c42d170feaa8bcbd83734f713c3a4d721f0cbf
4
- data.tar.gz: 3403ae1a85d904ffe717ce70e7a74e4bdaec3a9a95abb11e3aa72e499db4bb12
3
+ metadata.gz: 8673b22bfc18be6cd4c5a213584c61f537c084ccc46350014b641abc5842f616
4
+ data.tar.gz: b2da2314a3dc9bd428eceff45005544a42e34f423c0be44a78997cafd4beb5e3
5
5
  SHA512:
6
- metadata.gz: 8db25ee26837b86486b09db2e9bb4c763391c1c910f9e4a906659219ce6b88cccee20fec9e76f939e1835846fe9361e7a44082a40129b4fc9cc2103543e4962d
7
- data.tar.gz: b80b8af43331bd3120fee05da3b51d31c7a8ad3ac6f4bcd5f7f107e8750d239b9151198dd07dcd60ba3f25b02fe98eaba21db689d3912f4c298bf40147174db7
6
+ metadata.gz: 35177971cabb780bc9af73dcd11d8e2502376422a21be2712744b7fdfab576681956319b958c37fa7a84a57c8e764c81ddde9c6027ae78b57ba020fde0d71aad
7
+ data.tar.gz: '08ff64300ed51e6d9b334a4d8e7a05dcf122181218a270ebc851b20561fafbfb4874904b94f7233a630eed150571b7e8bcc55a56f5095f8155ba52e3ebb59e9c'
data/lib/cellar.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  # cellar - Ruby gem to deal with cells of data in rows and columns
3
3
  #
4
4
  # Author: Steve Shreeve (steve.shreeve@gmail.com)
5
- # Date: October 19, 2024
5
+ # Date: January 8, 2025
6
6
  #
7
7
  # TODO:
8
8
  # • Should we failover to empty strings like this: (value || "")
@@ -28,17 +28,18 @@ class Object
28
28
  end
29
29
 
30
30
  class Cellar
31
- VERSION="0.2.1"
31
+ VERSION="0.2.2"
32
32
 
33
33
  attr_reader :fields
34
34
  attr_reader :values
35
35
  attr_accessor :strict
36
36
 
37
- def initialize(obj=nil, header: true, strict: true, index: nil)
37
+ def initialize(obj=nil, header: true, strict: true, warn: true, index: nil)
38
38
  @fields = []
39
39
  @values = []
40
40
  @finder = {}
41
41
  @seeker = {}
42
+ @warn = warn
42
43
  @index = index
43
44
  @widest = 0
44
45
 
@@ -60,7 +61,7 @@ class Cellar
60
61
  @fields << field
61
62
  finders = @finder.size
62
63
  @finder[field.downcase.gsub(/\W/,'_')] ||= index
63
- @finder.size == finders + 1 or warn "field clash for #{field.inspect}"
64
+ @finder.size == finders + 1 or (@warn and warn "field clash for #{field.inspect}")
64
65
  @finder[field] ||= index
65
66
  @widest = field.length if field.length > @widest
66
67
  index
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cellar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Shreeve
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-19 00:00:00.000000000 Z
11
+ date: 2025-01-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby gem to deal with cells of data in rows and columns
14
14
  email: steve.shreeve@gmail.com
@@ -39,7 +39,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  requirements: []
42
- rubygems_version: 3.5.21
42
+ rubygems_version: 3.5.22
43
43
  signing_key:
44
44
  specification_version: 4
45
45
  summary: A Ruby gem to deal with cells of data in rows and columns