explain_parser 0.1.1 → 0.1.2

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
  SHA1:
3
- metadata.gz: f43ba5786448a3054481f52d10dbfbd2f269ae21
4
- data.tar.gz: aee5894a286b7ad90e11b7e9fca0a6e2f0f24454
3
+ metadata.gz: b378add84a166f6ea03bae37fd7a5562653a1ec3
4
+ data.tar.gz: 87bcdd2937dcc0ffdba71176a6fa8d6b053efc09
5
5
  SHA512:
6
- metadata.gz: e60fcf2e6f84e53d760b6a26c60c863282dee35a521ac50a72839671b70be02696ab997615378bff1e26dd538c4680aeb527126778a41b017708ed9445ba8273
7
- data.tar.gz: 9d63706259da8a3feaa1bd262551bc1433f307b6fee9d19fde39f477813a69d1e3222a7258236bab27dab81bc67f671cd41db4a283fd0daf1dd871ec804607cc
6
+ metadata.gz: 1aad33d419ca56780dafe66013700bfd47fa505121c5ddf1fc8f83ad6dfb6ff4f7b8a5f6f8a41f1c979ce3a6c1e69fe48b1d4e4a50cec0e80f4632992fde44e9
7
+ data.tar.gz: ebed37694ba95d7656bcb27f9697de635748a4bcc16b715f800845bff196314e21b545a975fe5596d215afb7f104a684b8b375824eaf266f2997a6f57644371d
@@ -86,14 +86,7 @@ class ExplainParser
86
86
  case val
87
87
  when String
88
88
  stripped_value = val.strip
89
- case stripped_value
90
- when 'NULL'
91
- nil
92
- when /\d+/
93
- stripped_value.to_i
94
- else
95
- stripped_value
96
- end
89
+ stripped_value == 'NULL' ? nil : stripped_value
97
90
  else
98
91
  val
99
92
  end
@@ -107,7 +100,7 @@ class ExplainParser
107
100
 
108
101
  def build
109
102
  values_list.reduce([]) do |explains, values|
110
- params = keys.zip(cleanup_values(values)).inject({}) { |h, (k, v)| h[k] = v; h }
103
+ params = keys.zip(cleanup_values(values)).inject({}) { |h, (k, v)| h[k.downcase] = v; h }
111
104
  explains << ExplainParser::Explain.new(params)
112
105
  explains
113
106
  end
@@ -143,7 +136,7 @@ class ExplainParser
143
136
  end
144
137
 
145
138
  def keys()
146
- @keys ||= rows[0].chomp.split('|').compact.map(&:strip).reject(&:empty?).map(&:downcase)
139
+ @keys ||= rows[0].chomp.split('|').compact.map(&:strip).reject(&:empty?)
147
140
  end
148
141
 
149
142
  def values_list()
@@ -1,3 +1,3 @@
1
1
  class ExplainParser
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: explain_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ainame