active_record_mysql_repl 0.1.12 → 0.1.14

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: fb8ee6363c8b678044b161c2226a2c8f3260797b1f6373d29ccf444149219504
4
- data.tar.gz: 0cb27fd8dc02ce73834a56985ef10b6b6a8aafdb7bb429c399d4bd9f17c22f69
3
+ metadata.gz: d62a2c0dc29efe6f9656bcd27c670214704c4d8e73348994a54de07102f40faa
4
+ data.tar.gz: e109912c5406682d90b9d29b3be94a80496de8f4d54a2ee24ecfb461fd5ce1eb
5
5
  SHA512:
6
- metadata.gz: b029d35e7f40a62adccecbf47bc2a0262c4ed83386408252e79d4d05910eb45d268564ba4ffbc1ad63f0552232bf456a44fab0d6172ab03d94831a92eaeb44d6
7
- data.tar.gz: f726cefaad6d521c3d44a5f6df61f63fec00d7ed065d8215b54afe29ec0f2196b65b27419ecb2aef8feeb137855a3dfaa902a6c079a88e3bd71f0c0909bec1bc
6
+ metadata.gz: ec482ec4b09e68b0155df7f230756cd6cb5b4f7dbe79b53ff639ea7988a83f5c63a4b62b56a07125c43374a66e1df54e16388262277ebe0ff04e63c90a42283c
7
+ data.tar.gz: 53a9f80d59726ef6a5e27f7bbf6f4c980277161a053d6a4069004162c33cde666817c0e659445012f3f154aeace33be514565d593d014d4dea04cb20f4c94927
@@ -11,8 +11,8 @@ module ActiverecordMysqlRepl
11
11
  def describe
12
12
  [
13
13
  "# #{table_name}",
14
- exec_sql("DESCRIBE #{table_name}").tab(:h),
15
- exec_sql("SHOW INDEX FROM #{table_name}").tab(:h)
14
+ exec_sql("DESCRIBE `#{table_name}`").tab(:h),
15
+ exec_sql("SHOW INDEX FROM `#{table_name}`").tab(:h)
16
16
  ].join("\n")
17
17
  end
18
18
 
@@ -53,10 +53,12 @@ module ActiverecordMysqlRepl
53
53
  t.rows = arr.map(&:values)
54
54
 
55
55
  when :vertical
56
- t.headings = ["Name", "Value"]
57
- arr.each.with_index do |row, i|
58
- row.each { |col, val| t.add_row [col, val] }
59
- t.add_separator if i < arr.size - 1
56
+ headings = ["Column", arr.map.with_index { |_, i| "Record#{i+1}" }].flatten
57
+ t.headings = headings
58
+
59
+ arr.first.keys.each_with_index do |col|
60
+ cols = [col, arr.map { |r| r[col] }].flatten
61
+ t.add_row cols
60
62
  end
61
63
  end
62
64
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveRecordMysqlRepl
4
- VERSION = "0.1.12"
4
+ VERSION = "0.1.14"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record_mysql_repl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroki Kishi
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-04-12 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: byebug
@@ -316,7 +316,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
316
316
  - !ruby/object:Gem::Version
317
317
  version: '0'
318
318
  requirements: []
319
- rubygems_version: 3.6.6
319
+ rubygems_version: 4.0.4
320
320
  specification_version: 4
321
321
  summary: MySQL REPL featured by ActiveRecord and Pry
322
322
  test_files: []