flat_kit 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1f30ca1aa08d445cdae1e2da95f32bcf3185e0ab5f003675d777cce2741ed3b8
4
- data.tar.gz: 42606f14ad0e846e83734388f8250c0045a80208b9a91034360dc86c088121a4
3
+ metadata.gz: 55c7d4c969c2aa0c557c2ed4a8f5481c9e81ad0bb94f8208f03535a61039c7a8
4
+ data.tar.gz: 228b39193561ddc74816eecd31e3b11f66194d2a41dabc297babf5b364a573a6
5
5
  SHA512:
6
- metadata.gz: c6b318485580e129ff979004c17ef21a4223aaf870224348b26353af7220ba8e57dfe11d21ad0870c9c0ccedd9ebcb1a1b40fc80417fef40dc8d27cdd569c205
7
- data.tar.gz: b91c41e7778e598d2b3ab388b063e527dabceab2323c6ceb64ae8a1b68da4f13aceb79e3b400f4bbc56eb41456d717c4a498247777c6839e403f7998901f254e
6
+ metadata.gz: d326f4b070ba6fef26f713cc22bbc9631e83e466defd189e4a19091c36683aaf7040edb4eda4f22e7b3e6f8b13d91e458a99385faef2462f0254ade6352bc3b8
7
+ data.tar.gz: e02010f519613725147082ece5b664b135a53fadd15258a244d1fc93cc957f3ccc54e4a88b7273879fca04d1562f5ea207c79007fdf6eda9cc5c3e76d2fb718d
data/HISTORY.md CHANGED
@@ -1,4 +1,8 @@
1
1
  # FlatKit Changelog
2
+ ## Version 1.1.0
3
+ * Update semaphore config
4
+ * rubocop fixes
5
+ * Update tested ruby versions
2
6
 
3
7
  ## Version 1.0.0
4
8
 
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  ## FlatKit
2
2
 
3
+ [![Build Status](https://copiousfreetime.semaphoreci.com/badges/flat_kit/branches/main.svg)](https://copiousfreetime.semaphoreci.com/projects/flat_kit)
4
+
3
5
  * [Homepage](https://github.com/copiousfreetime/flat_kit/)
4
6
  * [Github Project](https://github.com/copiousfreetime/flat_kit)
5
7
 
data/flat_kit.gemspec CHANGED
@@ -1,18 +1,18 @@
1
1
  # DO NOT EDIT - This file is automatically generated
2
2
  # Make changes to Manifest.txt and/or Rakefile and regenerate
3
3
  # -*- encoding: utf-8 -*-
4
- # stub: flat_kit 1.0.0 ruby lib
4
+ # stub: flat_kit 1.1.0 ruby lib
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "flat_kit".freeze
8
- s.version = "1.0.0".freeze
8
+ s.version = "1.1.0".freeze
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
11
11
  s.metadata = { "bug_tracker_uri" => "https://github.com/copiousfreetime/flat_kit/issues", "changelog_uri" => "https://github.com/copiousfreetime/flat_kit/blob/master/HISTORY.md", "homepage_uri" => "https://github.com/copiousfreetime/flat_kit", "label" => "flat_kit", "rubygems_mfa_required" => "true", "source_code_uri" => "https://github.com/copiousfreetime/flat_kit" } if s.respond_to? :metadata=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Jeremy Hinegardner".freeze]
14
14
  s.bindir = "exe".freeze
15
- s.date = "2024-04-28"
15
+ s.date = "2026-05-23"
16
16
  s.description = "A library and commandline program for reading, writing, indexing, sorting, and merging CSV, TSV, JSON and other flat-file formats.".freeze
17
17
  s.email = "jeremy@copiousfreetime.org".freeze
18
18
  s.executables = ["fk".freeze]
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
22
22
  s.licenses = ["MIT".freeze]
23
23
  s.rdoc_options = ["--main".freeze, "README.md".freeze, "--markup".freeze, "tomdoc".freeze]
24
24
  s.required_ruby_version = Gem::Requirement.new(">= 3.0.0".freeze)
25
- s.rubygems_version = "3.5.9".freeze
25
+ s.rubygems_version = "4.0.10".freeze
26
26
  s.summary = "A library and commandline program for reading, writing, indexing, sorting, and merging CSV, TSV, JSON and other flat-file formats.".freeze
27
27
 
28
28
  s.specification_version = 4
@@ -8,7 +8,7 @@ module FlatKit
8
8
  raise ::NoMethodError, "#{listener} does not resond to #on_event" unless listener.respond_to?(:on_event)
9
9
 
10
10
  self._listeners ||= []
11
- self._listeners << listener unless _listeners.include?(listener)
11
+ _listeners << listener unless _listeners.include?(listener)
12
12
  end
13
13
 
14
14
  def count_listeners
@@ -60,7 +60,7 @@ module FlatKit
60
60
  @stats_to_collect.each do |collection_set|
61
61
  next if ALL_STATS.include?(collection_set)
62
62
 
63
- valid_sets = ALL_STATS.map(&:to_s).join(", ")
63
+ valid_sets = ALL_STATS.join(", ")
64
64
 
65
65
  raise ArgumentError, "#{collection_set} is not a valid stats collection set, must be one of #{valid_sets}"
66
66
  end
@@ -73,7 +73,7 @@ module FlatKit
73
73
  end
74
74
 
75
75
  def play
76
- @winner = (left <= right) ? left : right
76
+ @winner = [left, right].min
77
77
  @leaf = winner.leaf unless @winner.sentinel?
78
78
  next_level.play if next_level
79
79
  end
@@ -81,7 +81,7 @@ module FlatKit
81
81
  def <=>(other)
82
82
  return -1 if other.sentinel?
83
83
 
84
- value <=> (other.value)
84
+ value <=> other.value
85
85
  end
86
86
  end
87
87
  end
@@ -66,7 +66,7 @@ module FlatKit
66
66
  def <=>(other)
67
67
  return -1 if other.sentinel?
68
68
 
69
- value <=> (other.value)
69
+ value <=> other.value
70
70
  end
71
71
  end
72
72
  end
@@ -13,8 +13,7 @@ module FlatKit
13
13
  end
14
14
 
15
15
  def self.for_path(path)
16
- io = File.open(path.to_s, "a")
17
- for_io(io)
16
+ for_io(File.open(path.to_s, "a"))
18
17
  end
19
18
  end
20
19
 
@@ -64,7 +64,7 @@ module FlatKit
64
64
  elsif other_val.nil?
65
65
  1
66
66
  else
67
- my_val <=> (other_val)
67
+ my_val <=> other_val
68
68
  end
69
69
 
70
70
  return compare_result unless compare_result.zero?
data/lib/flat_kit/sort.rb CHANGED
@@ -16,11 +16,7 @@ module FlatKit
16
16
 
17
17
  def call
18
18
  ::FlatKit.logger.info "Sorting #{reader.source} into #{writer.destination} using key #{compare_fields.join(', ')}"
19
- records = [].tap do |a|
20
- reader.each do |r|
21
- a << r
22
- end
23
- end
19
+ records = reader.map { |r| r }
24
20
  ::FlatKit.logger.info "Read #{reader.count} records into #{records.size} element array"
25
21
  records.sort!
26
22
  ::FlatKit.logger.info "Sorted #{records.size} records"
@@ -12,7 +12,6 @@ module FlatKit
12
12
 
13
13
  def initialize(input:, output:, input_fallback: "auto", output_fallback: "auto",
14
14
  fields_to_stat: AllFields, stats_to_collect: FieldStats::CORE_STATS)
15
-
16
15
  @fields_to_stat = fields_to_stat
17
16
  @stats_to_collect = stats_to_collect
18
17
  @stats_by_field = {}
@@ -58,10 +58,8 @@ module FlatKit
58
58
  def to_a
59
59
  return data.fields unless data.nil?
60
60
 
61
- [].tap do |a|
62
- @ordered_fields.each do |field|
63
- a << @complete_structured_data[field]
64
- end
61
+ @ordered_fields.map do |field|
62
+ @complete_structured_data[field]
65
63
  end
66
64
  end
67
65
 
data/lib/flat_kit.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  # Public: Top level namespace for this gem
4
4
  #
5
5
  module FlatKit
6
- VERSION = "1.0.0"
6
+ VERSION = "1.1.0"
7
7
  end
8
8
  require "flat_kit/error"
9
9
  require "flat_kit/descendant_tracker"
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flat_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Hinegardner
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-04-29 00:00:00.000000000 Z
10
+ date: 2026-05-23 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: oj
@@ -138,7 +137,6 @@ metadata:
138
137
  source_code_uri: https://github.com/copiousfreetime/flat_kit
139
138
  label: flat_kit
140
139
  rubygems_mfa_required: 'true'
141
- post_install_message:
142
140
  rdoc_options:
143
141
  - "--main"
144
142
  - README.md
@@ -157,8 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
155
  - !ruby/object:Gem::Version
158
156
  version: '0'
159
157
  requirements: []
160
- rubygems_version: 3.5.9
161
- signing_key:
158
+ rubygems_version: 4.0.10
162
159
  specification_version: 4
163
160
  summary: A library and commandline program for reading, writing, indexing, sorting,
164
161
  and merging CSV, TSV, JSON and other flat-file formats.