tabular 0.4.4 → 0.4.6

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: 5ce838dbb77478ecdf4a58442fb9fee69e859d8f3493d5c54b311c6b30ca180d
4
- data.tar.gz: e449231b4f9803f3ec9054165383da2f598815cc309706c42c40698b6e82b55a
3
+ metadata.gz: c5c35d4ee76851e8d43c72b1caaabbc44764b70ccbeb05ce513262209f5b28d3
4
+ data.tar.gz: 48f2bc1d8234c3c869cab6f3c595b823029220c2bc949f573a0012c5b583e01c
5
5
  SHA512:
6
- metadata.gz: 31c9d86d64bfc59100a556a89ca6d0b7751540362d2a45e9a0bd7c4d75b581e00937cbe0d22f8df4039b0241e83366deed590ca65faead606750b354e7d0dcbb
7
- data.tar.gz: 24a656adf8b0321694fcfc27f2301a060488de6339eb47fa0752609123f5fb9a1f2fa63d784fc46cc3e160c859540cb1e032f18f709e8661a293533fc9f6dbd9
6
+ metadata.gz: f360ad4dcf92ea57edbc925f2ed1de3785a7acdf26f0cd8258d9d3973586afce38d7c4395b1a725802bb0d565c222aefbdf05965d374972d789a0f52d86df128
7
+ data.tar.gz: cac61fba15e8858ef709f1c1634e9acd2bed3410f0c438cdb1f328e0c0c46b40485b533aaebbd8e17a688ea9ef9865333c4449378f4b5f959dbb4d4c04b6c18c
data/Gemfile CHANGED
@@ -1,10 +1,16 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source "https://rubygems.org"
2
4
 
5
+ ruby ">= 2.4.0"
6
+
3
7
  git_source(:github) { |name| "https://github.com/#{name}.git" }
4
8
 
5
- gem "minitest", "~> 5.8"
6
- gem "rake", "~> 10.4"
7
- gem "roo-xls", "~> 0.0.1", github: "roo-rb/roo-xls", ref: "a316a88d042ca6e28a83c46a0db1906a9feebb62"
8
- gem "roo", "~> 2.0", github: "roo-rb/roo", ref: "12f3f7b1b9c7cc31cada36db360125531d408405"
9
+ gem "bundler", ">= 2.0"
10
+ gem "bundler-audit"
11
+ gem "minitest"
12
+ gem "rake"
13
+ gem "roo", github: "scottwillson/roo"
14
+ gem "roo-xls"
9
15
 
10
16
  gemspec
@@ -1,49 +1,51 @@
1
1
  GIT
2
- remote: https://github.com/roo-rb/roo-xls.git
3
- revision: a316a88d042ca6e28a83c46a0db1906a9feebb62
4
- ref: a316a88d042ca6e28a83c46a0db1906a9feebb62
2
+ remote: https://github.com/scottwillson/roo.git
3
+ revision: 7affb556878466faf1a476f2ed5802f6af5b1066
5
4
  specs:
6
- roo-xls (0.0.1)
7
- nokogiri
8
- roo (>= 2.0.0)
9
- spreadsheet (> 0.9.0)
10
-
11
- GIT
12
- remote: https://github.com/roo-rb/roo.git
13
- revision: 12f3f7b1b9c7cc31cada36db360125531d408405
14
- ref: 12f3f7b1b9c7cc31cada36db360125531d408405
15
- specs:
16
- roo (2.0.0)
17
- nokogiri
18
- rubyzip (>= 1.0.0)
5
+ roo (2.8.2)
6
+ nokogiri (~> 1)
7
+ rubyzip (>= 1.2.1, < 2.0.0)
19
8
 
20
9
  PATH
21
10
  remote: .
22
11
  specs:
23
- tabular (0.4.3)
12
+ tabular (0.4.5)
24
13
 
25
14
  GEM
26
15
  remote: https://rubygems.org/
27
16
  specs:
17
+ bundler-audit (0.6.1)
18
+ bundler (>= 1.2.0, < 3)
19
+ thor (~> 0.18)
28
20
  mini_portile2 (2.4.0)
29
21
  minitest (5.11.3)
30
- nokogiri (1.10.0)
22
+ nokogiri (1.10.3)
31
23
  mini_portile2 (~> 2.4.0)
32
- rake (10.5.0)
33
- ruby-ole (1.2.12.1)
24
+ rake (12.3.2)
25
+ roo-xls (1.2.0)
26
+ nokogiri
27
+ roo (>= 2.0.0, < 3)
28
+ spreadsheet (> 0.9.0)
29
+ ruby-ole (1.2.12.2)
34
30
  rubyzip (1.2.2)
35
- spreadsheet (1.1.8)
31
+ spreadsheet (1.2.3)
36
32
  ruby-ole (>= 1.0)
33
+ thor (0.20.3)
37
34
 
38
35
  PLATFORMS
39
36
  ruby
40
37
 
41
38
  DEPENDENCIES
42
- minitest (~> 5.8)
43
- rake (~> 10.4)
44
- roo (~> 2.0)!
45
- roo-xls (~> 0.0.1)!
39
+ bundler (>= 2.0)
40
+ bundler-audit
41
+ minitest
42
+ rake
43
+ roo!
44
+ roo-xls
46
45
  tabular!
47
46
 
47
+ RUBY VERSION
48
+ ruby 2.6.0p0
49
+
48
50
  BUNDLED WITH
49
51
  2.0.1
data/README CHANGED
@@ -62,6 +62,7 @@ There's basic test coverage. More comprehensive test coverage needs to be extrac
62
62
 
63
63
  Changes
64
64
  -------
65
+ 0.4.6 Gem updates. Lint.
65
66
  0.4.3 Gem updates
66
67
  0.4.2 Refactor minor ugly things. No behavior changes.
67
68
  0.4.0 rchristensen: Add sheet argument to Table.read
data/Rakefile CHANGED
@@ -1,21 +1,23 @@
1
- require 'rubygems'
2
- require 'rake'
1
+ # frozen_string_literal: true
3
2
 
4
- require 'rake/testtask'
3
+ require "rubygems"
4
+ require "rake"
5
+
6
+ require "rake/testtask"
5
7
  Rake::TestTask.new(:test) do |test|
6
- test.libs << 'lib' << 'test'
7
- test.pattern = 'test/**/*_test.rb'
8
+ test.libs << "lib" << "test"
9
+ test.pattern = "test/**/*_test.rb"
8
10
  test.verbose = true
9
11
  end
10
12
 
11
- task :default => :test
13
+ task default: :test
12
14
 
13
- require 'rdoc/task'
15
+ require "rdoc/task"
14
16
  Rake::RDocTask.new do |rdoc|
15
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
17
+ version = File.exist?("VERSION") ? File.read("VERSION") : ""
16
18
 
17
- rdoc.rdoc_dir = 'rdoc'
19
+ rdoc.rdoc_dir = "rdoc"
18
20
  rdoc.title = "tabular #{version}"
19
- rdoc.rdoc_files.include('README*')
20
- rdoc.rdoc_files.include('lib/**/*.rb')
21
+ rdoc.rdoc_files.include("README*")
22
+ rdoc.rdoc_files.include("lib/**/*.rb")
21
23
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "rubygems"
2
4
 
3
5
  $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/../lib")
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tabular
2
4
  # Don't mess with Object
3
5
  module Blank
4
- def is_blank?(object)
6
+ def is_blank?(object) # rubocop:disable Naming/PredicateName
5
7
  case object
6
8
  when NilClass
7
9
  true
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tabular
2
4
  class Column
3
5
  attr_reader :key, :column_type
@@ -10,13 +12,13 @@ module Tabular
10
12
  @table = table
11
13
  @key = self.columns.column_mapper.map(key)
12
14
 
13
- if @key && @key.to_s["date"]
14
- @column_type = :date
15
- elsif @key && @key.to_s[/\?\z/]
16
- @column_type = :boolean
17
- else
18
- @column_type = :string
19
- end
15
+ @column_type = if @key && @key.to_s["date"]
16
+ :date
17
+ elsif @key && @key.to_s[/\?\z/]
18
+ :boolean
19
+ else
20
+ :string
21
+ end
20
22
  end
21
23
 
22
24
  def rows
@@ -35,7 +37,7 @@ module Tabular
35
37
 
36
38
  # Number of zeros to the right of the decimal point. Useful for formtting time data.
37
39
  def precision
38
- @precision ||= cells.map(&:to_f).map {|n| n.round(3) }.map {|n| n.to_s.split(".").last.gsub(/0+$/, "").length }.max
40
+ @precision ||= cells.map(&:to_f).map { |n| n.round(3) }.map { |n| n.to_s.split(".").last.gsub(/0+$/, "").length }.max
39
41
  end
40
42
 
41
43
  # Widest string in column
@@ -65,7 +67,6 @@ module Tabular
65
67
  key.to_s
66
68
  end
67
69
 
68
-
69
70
  protected
70
71
 
71
72
  def columns
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tabular
2
4
  class ColumnMapper
3
5
  include Tabular::Blank
@@ -5,22 +7,21 @@ module Tabular
5
7
  # Convert +key+ to normalized symbol. Subclass for more complex mapping.
6
8
  def map(key)
7
9
  return nil if is_blank?(key)
10
+
8
11
  symbolize key
9
12
  end
10
13
 
11
14
  def symbolize(key)
12
- begin
13
- key.to_s.strip.gsub(/::/, '/').
14
- gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
15
- gsub(/([a-z\d])([A-Z])/,'\1_\2').
16
- tr("-", "_").
17
- gsub(/ +/, "_").
18
- delete(";").
19
- downcase.
20
- to_sym
21
- rescue
22
- nil
23
- end
15
+ key.to_s.strip.gsub(/::/, "/")
16
+ .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
17
+ .gsub(/([a-z\d])([A-Z])/, '\1_\2')
18
+ .tr("-", "_")
19
+ .gsub(/ +/, "_")
20
+ .delete(";")
21
+ .downcase
22
+ .to_sym
23
+ rescue StandardError
24
+ nil
24
25
  end
25
26
  end
26
27
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tabular
2
4
  # The Table's header: a list of Columns.
3
5
  class Columns
@@ -5,8 +7,8 @@ module Tabular
5
7
  include Tabular::Blank
6
8
  include Tabular::Keys
7
9
 
8
- attr_accessor :column_mapper
9
- attr_accessor :renderer
10
+ attr_writer :column_mapper
11
+ attr_writer :renderer
10
12
 
11
13
  # +table+ -- Table
12
14
  # +data+ -- array of header names
@@ -28,9 +30,7 @@ module Tabular
28
30
  def set_columns(table = Table.new, names = [])
29
31
  index = 0
30
32
 
31
- if names.respond_to?(:keys)
32
- names = names.keys
33
- end
33
+ names = names.keys if names.respond_to?(:keys)
34
34
 
35
35
  @columns = names.map do |name|
36
36
  new_column = Tabular::Column.new(table, self, name)
@@ -38,14 +38,23 @@ module Tabular
38
38
  @column_indexes[new_column.key] = index
39
39
  @columns_by_key[new_column.key] = new_column
40
40
  end
41
- index = index + 1
41
+ index += 1
42
42
  new_column
43
43
  end
44
44
  end
45
45
 
46
+ def empty?
47
+ size.zero?
48
+ end
49
+
50
+ # Deprecated
51
+ def has_key?(key) # rubocop:disable Naming/PredicateName
52
+ key? key
53
+ end
54
+
46
55
  # Is the a Column with this key? Keys are lower-case, underscore symbols.
47
56
  # Example: :postal_code
48
- def has_key?(key)
57
+ def key?(key)
49
58
  @columns.any? { |column| column.key == key }
50
59
  end
51
60
 
@@ -67,12 +76,12 @@ module Tabular
67
76
  # Add a new Column with +key+
68
77
  def <<(key)
69
78
  column = Column.new(@table, self, key)
70
- unless is_blank?(column.key) || has_key?(key)
71
- @column_indexes[column.key] = @columns.size
72
- @column_indexes[@columns.size] = column
73
- @columns_by_key[column.key] = column
74
- @columns << column
75
- end
79
+ return if is_blank?(column.key) || key?(key)
80
+
81
+ @column_indexes[column.key] = @columns.size
82
+ @column_indexes[@columns.size] = column
83
+ @columns_by_key[column.key] = column
84
+ @columns << column
76
85
  end
77
86
 
78
87
  def delete(key)
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tabular
2
4
  module Keys
3
5
  # Return Symbol for +key+. Translate Column and String. Return +key+ unmodified for anything else.
4
6
  def key_to_sym(key)
5
- _key = case key
7
+ case key
6
8
  when Column
7
9
  key.key
8
10
  when String
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tabular
2
4
  # Custom display of cells. By default, return to_s.
3
5
  #
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "date"
2
4
 
3
5
  module Tabular
@@ -38,7 +40,7 @@ module Tabular
38
40
 
39
41
  # Set cell value. Adds cell to end of Row and adds new Column if there is no Column for +key_
40
42
  def []=(key, value)
41
- if columns.has_key?(key)
43
+ if columns.key?(key)
42
44
  @array[columns.index(key)] = value
43
45
  else
44
46
  @array << value
@@ -52,6 +54,11 @@ module Tabular
52
54
  @array.each(&block)
53
55
  end
54
56
 
57
+ # Call +block+ for each key
58
+ def each_key(&block)
59
+ keys.each(&block)
60
+ end
61
+
55
62
  # Call +block+ for each cell
56
63
  def each_with_key(&block)
57
64
  hash.each(&block)
@@ -74,9 +81,7 @@ module Tabular
74
81
 
75
82
  # Previous Row
76
83
  def previous
77
- if index > 0
78
- @table.rows[index - 1]
79
- end
84
+ @table.rows[index - 1] if index.positive?
80
85
  end
81
86
 
82
87
  # Next Row
@@ -113,13 +118,13 @@ module Tabular
113
118
  end
114
119
 
115
120
  def to_space_delimited
116
- _cells = []
121
+ cells = []
117
122
 
118
- hash.each do |key, _|
119
- _cells << (render(key) || "").ljust(columns[key].width)
123
+ hash.each_key do |key|
124
+ cells << (render(key) || "").ljust(columns[key].width)
120
125
  end
121
126
 
122
- _cells.join " "
127
+ cells.join " "
123
128
  end
124
129
 
125
130
  def inspect
@@ -130,7 +135,6 @@ module Tabular
130
135
  @array.join(", ").to_s
131
136
  end
132
137
 
133
-
134
138
  protected
135
139
 
136
140
  def hash #:nodoc:
@@ -138,13 +142,11 @@ module Tabular
138
142
  end
139
143
 
140
144
  def build_hash #:nodoc:
141
- _hash = Hash.new
145
+ hash = {}
142
146
  columns.each do |column|
143
- if column.key
144
- _hash[column.key] = value_for_hash(column)
145
- end
147
+ hash[column.key] = value_for_hash(column) if column.key
146
148
  end
147
- _hash
149
+ hash
148
150
  end
149
151
 
150
152
  def value_for_hash(column) #:nodoc:
@@ -155,7 +157,7 @@ module Tabular
155
157
 
156
158
  case column.column_type
157
159
  when :boolean
158
- [ 1, "1", true, "true" ].include?(value)
160
+ [1, "1", true, "true"].include?(value)
159
161
  when :date
160
162
  if date?(value)
161
163
  value
@@ -167,7 +169,6 @@ module Tabular
167
169
  end
168
170
  end
169
171
 
170
-
171
172
  private
172
173
 
173
174
  def date?(value)
@@ -181,11 +182,7 @@ module Tabular
181
182
  Date.parse(value.to_s, true)
182
183
  rescue ArgumentError
183
184
  date = parse_invalid_date(value)
184
- if date
185
- date
186
- else
187
- raise ArgumentError, "'#{key}' index #{index} #{value}' is not a valid date"
188
- end
185
+ date || raise(ArgumentError, "'#{key}' index #{index} #{value}' is not a valid date")
189
186
  end
190
187
  end
191
188
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tabular
2
4
  # Simple Enumerable list of Hashes. Use Table.read(file_path) to read file. Can also create a Table with Table.new. Either
3
5
  # pass in data or set options and then call row=.
@@ -7,9 +9,8 @@ module Tabular
7
9
  include Tabular::Tables::FileReading
8
10
  include Tabular::Zero
9
11
 
10
- attr_accessor :column_mapper
11
12
  attr_accessor :row_mapper
12
- attr_reader :rows
13
+ attr_reader :column_mapper
13
14
 
14
15
  def self.read(file, options = {})
15
16
  table = Table.new
@@ -29,13 +30,11 @@ module Tabular
29
30
 
30
31
  # Set table rows. Calls row <<, which creates columns and links the source rows to Row#source.
31
32
  def rows=(source_rows = [])
32
- return [] unless source_rows
33
+ return unless source_rows
33
34
 
34
35
  source_rows.each do |row|
35
36
  self.<< row
36
37
  end
37
-
38
- rows
39
38
  end
40
39
 
41
40
  # Return Row at zero-based index, or nil if Row is out of bounds
@@ -47,25 +46,23 @@ module Tabular
47
46
  # To control how source data is added to the Table, use Table#mapper= to set a class that
48
47
  # implements map(row) and returns a Hash.
49
48
  def <<(row)
50
- if row_mapper
51
- cells = row_mapper.map(row)
52
- else
53
- cells = row
54
- end
49
+ cells = if row_mapper
50
+ row_mapper.map(row)
51
+ else
52
+ row
53
+ end
55
54
 
56
- if @columns.nil? || @columns.size == 0
55
+ if @columns.nil? || @columns.empty?
57
56
  @columns = Tabular::Columns.new(self, cells, column_mapper)
58
- if !cells.respond_to?(:keys)
59
- return columns
60
- end
57
+ return columns unless cells.respond_to?(:keys)
61
58
  end
62
59
 
63
- _row = Tabular::Row.new(self, cells, row)
64
- _row.keys.each do |key|
60
+ new_row = Tabular::Row.new(self, cells, row)
61
+ new_row.each_key do |key|
65
62
  columns << key
66
63
  end
67
- rows << _row
68
- _row
64
+ rows << new_row
65
+ new_row
69
66
  end
70
67
 
71
68
  def inspect
@@ -78,27 +75,25 @@ module Tabular
78
75
  end
79
76
 
80
77
  # Remove all columns that only contain a blank string, zero, or nil
81
- def delete_blank_columns!(*_options)
82
- exceptions = extract_exceptions(_options)
78
+ def delete_blank_columns!(*options)
79
+ exceptions = extract_exceptions(options)
83
80
 
84
81
  (columns.map(&:key) - exceptions).each do |key|
85
- if rows.all? { |row| is_blank?(row[key]) || is_zero?(row[key]) }
82
+ if rows.all? { |row| is_blank?(row[key]) || is_zero?(row[key]) } # rubocop:disable Style/IfUnlessModifier
86
83
  delete_column key
87
84
  end
88
85
  end
89
86
  end
90
87
 
91
88
  # Remove all columns that contain the same value in all rows
92
- def delete_homogenous_columns!(*_options)
89
+ def delete_homogenous_columns!(*options)
93
90
  return if rows.size < 2
94
91
 
95
- exceptions = extract_exceptions(_options)
92
+ exceptions = extract_exceptions(options)
96
93
 
97
94
  (columns.map(&:key) - exceptions).each do |key|
98
95
  value = rows.first[key]
99
- if rows.all? { |row| row[key] == value }
100
- delete_column key
101
- end
96
+ delete_column key if rows.all? { |row| row[key] == value }
102
97
  end
103
98
  end
104
99
 
@@ -142,9 +137,7 @@ module Tabular
142
137
  end
143
138
 
144
139
  def column_mapper=(mapper)
145
- if rows.nil? || rows.size == 0
146
- @columns = nil
147
- end
140
+ @columns = nil if rows.nil? || rows.empty?
148
141
  @column_mapper = mapper
149
142
  end
150
143
 
@@ -154,14 +147,13 @@ module Tabular
154
147
  end
155
148
 
156
149
  def to_space_delimited
157
- ([ columns ] + rows).map(&:to_space_delimited).join("\n") << "\n"
150
+ ([columns] + rows).map(&:to_space_delimited).join("\n") << "\n"
158
151
  end
159
152
 
160
153
  def to_s
161
154
  "#<#{self.class} #{rows.size}>"
162
155
  end
163
156
 
164
-
165
157
  private
166
158
 
167
159
  def extract_exceptions(options)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tabular
2
4
  module Tables
3
5
  module FileReading
@@ -12,43 +14,39 @@ module Tabular
12
14
  format ||= format_from(format, file_path)
13
15
 
14
16
  self.rows = case format
15
- when :xls, :xlsx
16
- # Set to first sheet if undefined.
17
- sheet ||= 0
18
- read_spreadsheet file_path, format, sheet
19
- when :txt
20
- read_txt file_path
21
- when :csv
22
- read_csv file_path
23
- else
24
- raise "Cannot read '#{format}' format. Expected :xls, :xlsx, :txt, or :csv"
25
- end
17
+ when :xls, :xlsx
18
+ # Set to first sheet if undefined.
19
+ sheet ||= 0
20
+ read_spreadsheet file_path, format, sheet
21
+ when :txt
22
+ read_txt file_path
23
+ when :csv
24
+ read_csv file_path
25
+ else
26
+ raise "Cannot read '#{format}' format. Expected :xls, :xlsx, :txt, or :csv"
27
+ end
26
28
  end
27
29
 
28
30
  def format_from(as_option, file_path)
29
- if as_option
30
- as_option
31
- else
32
- case File.extname(file_path)
33
- when ".xls"
34
- :xls
35
- when ".xlsx"
36
- :xlsx
37
- when ".txt"
38
- :txt
39
- when ".csv"
40
- :csv
41
- end
42
- end
31
+ as_option || case File.extname(file_path)
32
+ when ".xls"
33
+ :xls
34
+ when ".xlsx"
35
+ :xlsx
36
+ when ".txt"
37
+ :txt
38
+ when ".csv"
39
+ :csv
40
+ end
43
41
  end
44
42
 
45
43
  def to_file_path(file)
46
44
  file_path = case file
47
- when File
48
- file.path
49
- else
50
- file
51
- end
45
+ when File
46
+ file.path
47
+ else
48
+ file
49
+ end
52
50
 
53
51
  raise "Could not find '#{file_path}'" unless File.exist?(file_path)
54
52
 
@@ -68,7 +66,7 @@ module Tabular
68
66
  # Row#to_a coerces Excel data to Strings, but we want Dates and Numbers
69
67
  data = []
70
68
  excel.sheet(sheet).each do |excel_row|
71
- data << excel_row.inject([]) { |row, cell| row << cell; row }
69
+ data << excel_row.each_with_object([]) { |cell, row| row << cell }
72
70
  end
73
71
  data
74
72
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tabular
2
- VERSION = "0.4.4"
4
+ VERSION = "0.4.6"
3
5
  end
@@ -1,10 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tabular
2
4
  module Zero
3
- def is_zero?(object)
4
- if object.respond_to?(:zero?)
5
- return object.zero?
6
- end
7
-
5
+ def is_zero?(object) # rubocop:disable Naming/PredicateName
6
+ return object.zero? if object.respond_to?(:zero?)
7
+
8
8
  case object
9
9
  when NilClass, FalseClass, TrueClass
10
10
  false
@@ -1,4 +1,6 @@
1
- $:.push File.expand_path("../lib", __FILE__)
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.push File.expand_path("lib", __dir__)
2
4
 
3
5
  require "tabular/version"
4
6
 
@@ -9,9 +11,9 @@ Gem::Specification.new do |s|
9
11
  s.authors = ["Scott Willson"]
10
12
  s.description = "Tabular is a Ruby library for reading, writing, and manipulating CSV, tab-delimited and Excel data."
11
13
  s.email = "scott.willson@gmail.com"
12
- s.extra_rdoc_files = [
13
- "LICENSE",
14
- "README"
14
+ s.extra_rdoc_files = %w[
15
+ LICENSE
16
+ README
15
17
  ]
16
18
  s.files = [
17
19
  "Gemfile",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tabular
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Willson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-05 00:00:00.000000000 Z
11
+ date: 2019-05-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Tabular is a Ruby library for reading, writing, and manipulating CSV,
14
14
  tab-delimited and Excel data.
@@ -56,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
56
  - !ruby/object:Gem::Version
57
57
  version: '0'
58
58
  requirements: []
59
- rubygems_version: 3.0.1
59
+ rubygems_version: 3.0.3
60
60
  signing_key:
61
61
  specification_version: 4
62
62
  summary: Read, write, and manipulate CSV, tab-delimited and Excel data