dba 2.1.0 → 2.2.0

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: 6d8a51736a883e5fa3608fd0429dbf3a819f2903a2da62d1df26d234952c899d
4
- data.tar.gz: bcdb786558aab8e9235324eeb06e073bff126c73abd680213f030d8560cc5306
3
+ metadata.gz: ff91c96a26c84120b2294eaceafbc9cd97d50ae7b8138ed08657efe355fe905b
4
+ data.tar.gz: 1e25615aea3aab8f5820f790d038363ea2854488e950d3925e48953d1055006c
5
5
  SHA512:
6
- metadata.gz: 5fefa4be5caa1d897e9a3e330b6535351f5f503cc4b351e37cf8a7ef8b30f93555491bf5c09836c8b43f13c503d3783bb7e9173a2a4c2ca696bc8b5b1c903379
7
- data.tar.gz: c6aea9949fe0b38718bee070cc3772b57b1ecb060b89c6fd497baa27dc30a0b2ed0edbc9b51157d8373ca057fbd85cb0a858f7f7665b3ba94bb99bcee095cc83
6
+ metadata.gz: b77b8fe626319fe20ac77cb31bb5bd2ed349438ea76ef6472b7367e22a804d1027a99744bde3ad2e32e7104f88a52b125a49f32c40223095281f648f150c8f64
7
+ data.tar.gz: 21d2f2a661aacc27375c7e9031c1057471ca627f0fb1bcb2c47dc051096e9d15d507d186854bb2fbac2b9851ba63ef2c807d7f91814ecd9490c564c6e073bdf1
data/CHANGES.md CHANGED
@@ -1,3 +1,10 @@
1
+ # 2.2.0
2
+
3
+ * Fixed compatibility with psych 4+
4
+
5
+ * The sample command now excludes nil/null values
6
+
7
+
1
8
  # 2.1.0
2
9
 
3
10
  * Fixed arity check for commands with optional arguments
data/dba.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'dba'
3
- s.version = '2.1.0'
3
+ s.version = '2.2.0'
4
4
  s.license = 'GPL-3.0'
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.authors = ['Tim Craft']
data/lib/dba/database.rb CHANGED
@@ -73,7 +73,13 @@ module DBA::Database
73
73
  end
74
74
 
75
75
  def database_config
76
- YAML.load(ERB.new(File.read(database_config_path)).result)
76
+ source = ERB.new(File.read(database_config_path)).result
77
+
78
+ if YAML.respond_to?(:unsafe_load)
79
+ YAML.unsafe_load(source)
80
+ else
81
+ YAML.load(source)
82
+ end
77
83
  end
78
84
 
79
85
  def development_database_args
data/lib/dba/sample.rb CHANGED
@@ -5,7 +5,7 @@ class DBA::Sample < DBA::Command
5
5
  column_name = column.to_sym if column
6
6
 
7
7
  if column_name
8
- dataset = database[table_name].distinct.select(column_name)
8
+ dataset = database[table_name].exclude(column_name => nil).distinct.select(column_name)
9
9
  dataset.from_self.order(random_function).limit(20).each do |row|
10
10
  puts row[column_name]
11
11
  end
data/lib/dba.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2019-2022 TIMCRAFT
1
+ # Copyright (c) 2019-2024 TIMCRAFT
2
2
  #
3
3
  # This program is free software: you can redistribute it and/or modify
4
4
  # it under the terms of the GNU General Public License as published by
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dba
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Craft
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-06 00:00:00.000000000 Z
11
+ date: 2024-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk
@@ -114,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  - !ruby/object:Gem::Version
115
115
  version: '0'
116
116
  requirements: []
117
- rubygems_version: 3.3.7
117
+ rubygems_version: 3.4.10
118
118
  signing_key:
119
119
  specification_version: 4
120
120
  summary: See description