arql 0.4.10 → 0.4.11

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: 62decd486ece81f40eb244ee8860f189f505e72d2773e19f7aeedbbf3e012766
4
- data.tar.gz: 01540fb5f54aa84d088732f67c2581bc589a49fb491013c2b6eb3d2111b260b0
3
+ metadata.gz: '0939ceb0070d909cdcad849a8f0d58c205ed95a3143595e3debfa9313fac2466'
4
+ data.tar.gz: d53563cd4c57b46b35ecc7eb3749dfddeb62d53ce671571ea49ad5572ab01d1d
5
5
  SHA512:
6
- metadata.gz: 502b4444ebef320d6a32c79d17b73b2cb4064a31c8087993bc71a65510c2d4b9d4fee02ad6accbd01bc2ce69993516bd3837f99e89c275d5c4a410d847d35a27
7
- data.tar.gz: 2a24a0e8f5503e973758a72757c4e90ac1ef0660f24c1442d86d75a70e3a45a669217a9c6d91c026389379b3cf3812552cf3786fe658d14f9bf46cdd41b47ffc
6
+ metadata.gz: edf5bfe566b9908251e3204fdd8fa08e30a7aa40cd0df722f7f9aa4f0092536964b2b244ed20ca1b289e10ea97df7d1c44a765b24ef1943f6850f17d670c5010
7
+ data.tar.gz: 444ed7209ec62243a8ca3791ede58096853ab3af37fac1016c29944b2b609788d35d2edb5b3feb9c8955d08e45cc5cbc520f1f2325735361526d53dd4d98c718
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- arql (0.4.10)
4
+ arql (0.4.11)
5
5
  activerecord (>= 6.1.5, < 7.1.0)
6
6
  activesupport (>= 6.1.5, < 7.1.0)
7
7
  caxlsx (~> 3.3.0)
@@ -38,6 +38,26 @@ class Array
38
38
  t.body << e.attributes.values_at(*attrs.map(&:to_s))
39
39
  end
40
40
  }
41
+ elsif (attrs.present? || options.present? && options[:except]) && present? && first.is_a?(Hash)
42
+ column_names = first.keys
43
+ attrs = attrs.flat_map { |e| e.is_a?(Regexp) ? column_names.grep(e) : e }.uniq
44
+ if options.present? && options[:except]
45
+ attrs = column_names if attrs.empty?
46
+ if options[:except].is_a?(Regexp)
47
+ attrs.reject! { |e| e =~ options[:except] }
48
+ else
49
+ attrs -= [options[:except]].flatten
50
+ end
51
+ end
52
+ # if options[:compact]
53
+ # attrs = attrs.select { |e| any { |r| r.attributes[e.to_s]&.present? } }
54
+ # end
55
+ tbl = Arql::Table.new { |t|
56
+ t.headers = attrs
57
+ each do |e|
58
+ t.body << e.values_at(*attrs.map(&:to_s))
59
+ end
60
+ }
41
61
  else
42
62
  values = v(**options)
43
63
  tbl = Arql::Table.new { |t|
data/lib/arql/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Arql
2
- VERSION = "0.4.10"
2
+ VERSION = "0.4.11"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.10
4
+ version: 0.4.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liu Xiang
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-14 00:00:00.000000000 Z
11
+ date: 2024-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mysql2