arql 0.2.2 → 0.2.3

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: 8e8fc504dce79a217260e4141983ed9688ea6b26bbb559293a91989f954a14ce
4
- data.tar.gz: '0826d7a38e803b7298afa8dce9f48e17246af86f6994f534e2168575f8081c86'
3
+ metadata.gz: bf94862baf6c8e5ff36589e84a022e892b4b88664ecc300c51d313a541e982fd
4
+ data.tar.gz: baa0a4b30e5efeb4083347c18f2863faa764052505e46442e45dd9af519612b0
5
5
  SHA512:
6
- metadata.gz: ff3be0324cd12c584969fc66d6a6859c9e41c2cae6f3c721fb2cce663cd53eee986f584ad3f00bf6c0ce38c29ad9a0c5623ff244262b3165119a11fdc1e8842d
7
- data.tar.gz: ff54d6fa435f403ecdbe53ff0acf8db12c4fc1fa79ef2809badeab7dcef79fbdd28d008458af871025ff90e00a0629a205cc6ef6bd95a2d853e2eceadbd27837
6
+ metadata.gz: aa3a4aba5288c64c7969efe368713e9f2a64ff9dfde3f41d47b9d8f3ec2f64fbfbe5479d6dc1c95281d82f68497616f44f78e84b635e312b6c6e40528871e6cf
7
+ data.tar.gz: cae343a1411c59e683dcc99ee309d1ca91100c2c8cf22cbff37ffe04cc02e338d38562e0623a752c5f0803926fba1b0f5a2332074ec3f98083dadd0b8439ab0e
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- arql (0.2.1)
4
+ arql (0.2.3)
5
5
  activerecord (~> 6.0.3)
6
6
  activesupport (~> 6.0.3)
7
7
  caxlsx (~> 3.0.2)
@@ -19,12 +19,12 @@ PATH
19
19
  GEM
20
20
  remote: https://rubygems.org/
21
21
  specs:
22
- activemodel (6.0.3.2)
23
- activesupport (= 6.0.3.2)
24
- activerecord (6.0.3.2)
25
- activemodel (= 6.0.3.2)
26
- activesupport (= 6.0.3.2)
27
- activesupport (6.0.3.2)
22
+ activemodel (6.0.3.3)
23
+ activesupport (= 6.0.3.3)
24
+ activerecord (6.0.3.3)
25
+ activemodel (= 6.0.3.3)
26
+ activesupport (= 6.0.3.3)
27
+ activesupport (6.0.3.3)
28
28
  concurrent-ruby (~> 1.0, >= 1.0.2)
29
29
  i18n (>= 0.7, < 2)
30
30
  minitest (~> 5.1)
@@ -44,7 +44,7 @@ GEM
44
44
  method_source (1.0.0)
45
45
  mimemagic (0.3.5)
46
46
  mini_portile2 (2.4.0)
47
- minitest (5.14.1)
47
+ minitest (5.14.2)
48
48
  mysql2 (0.5.3)
49
49
  net-ssh (6.1.0)
50
50
  net-ssh-gateway (2.0.0)
@@ -178,8 +178,8 @@ module Arql
178
178
  end
179
179
 
180
180
  ::ActiveRecord::Relation.class_eval do
181
- def t(*attrs)
182
- records.t(*attrs)
181
+ def t(*attrs, **options)
182
+ records.t(*attrs, **options)
183
183
  end
184
184
 
185
185
  def v
@@ -13,8 +13,16 @@ class Array
13
13
  end.join("\n")
14
14
  end
15
15
 
16
- def t(*attrs)
17
- if attrs.present? && present? && first.is_a?(ActiveRecord::Base)
16
+ def t(*attrs, **options)
17
+ if (attrs.present? || options.present? && options[:except]) && present? && first.is_a?(ActiveRecord::Base)
18
+ if options.present? && options[:except]
19
+ attrs = first.attribute_names.map(&:to_sym) if attrs.empty?
20
+ if options[:except].is_a?(Regexp)
21
+ attrs.reject! { |e| e =~ options[:except] }
22
+ else
23
+ attrs -= [options[:except]].flatten
24
+ end
25
+ end
18
26
  puts Terminal::Table.new { |t|
19
27
  t << attrs
20
28
  t << :separator
@@ -1,3 +1,3 @@
1
1
  module Arql
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
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.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liu Xiang
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-21 00:00:00.000000000 Z
11
+ date: 2020-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mysql2