mysql2json 0.0.2 → 0.0.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mysql2json.rb +6 -4
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eb91914bcb605753002d3f77c3cc699bd116e63e
4
- data.tar.gz: 640aeaede14f386a5b1e952a33f19f9fcd95b3b5
3
+ metadata.gz: 8348dc9dbbea9baae8f7ba223f466eec3bae9b81
4
+ data.tar.gz: aff076093abf74b5788ad5acd7bc091c772c6080
5
5
  SHA512:
6
- metadata.gz: c7984e7fd883b5605ea11aa94c9686543f90133910c1e9230838781ec5cbe28e60cc155baf6e0ef716d4ae885235642475fca150f0e8f8f18ebd81234cc9bbf8
7
- data.tar.gz: c888397ea91ce3584ddce85f40e1d22059dbb67eef104425b410e019573b5e617bf77865fbbec59eabefb2cac9682158b4c7ecff7378e1be3f9b213f541b379a
6
+ metadata.gz: 8005ca1b0539c86373b35c04f391c3e58ffeff2e14a0d520d582688c34be25329321d9d8b0baac5c960519b4c3edd466b48a490b0008be054de268a41a9fcb09
7
+ data.tar.gz: dc9ec258788d1ac193a95d93a4b3b090a64cc3902ea01903396188e202acee6e682b8432ff7056aede5d2e53126c4d53808cf9826cc4b0ce7863fcfde012fecd
data/lib/mysql2json.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  require 'mysql2'
2
2
  require 'json'
3
- require 'net/http'
4
3
 
5
4
  def is_json_valid(object)
6
5
  JSON.parse(object)
@@ -17,8 +16,11 @@ def convert(results)
17
16
  results.each_index do |index|
18
17
  non_json_data.push(results[index]);
19
18
  index += 1
20
- puts 'row: '+index.to_s
21
- #break if index == 10
19
+ puts 'row: '+index.to_s+' parsed'
20
+ end
21
+
22
+ non_json_data.each do |k,v|
23
+ v.to_s
22
24
  end
23
25
 
24
26
  json_data = non_json_data.map { |o| Hash[o.each_pair.to_a] }.to_json
@@ -30,7 +32,7 @@ def convert(results)
30
32
  end
31
33
 
32
34
  return json_data
33
- end
35
+ end
34
36
 
35
37
  class Mysql2json
36
38
  def self.query(q, client)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mysql2json
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jared Wright