mysql2json 0.0.3 → 0.0.4

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 +5 -8
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8348dc9dbbea9baae8f7ba223f466eec3bae9b81
4
- data.tar.gz: aff076093abf74b5788ad5acd7bc091c772c6080
3
+ metadata.gz: 86428b238d47d3782a9f09cc9e490eedfd245eac
4
+ data.tar.gz: 97f3c46ac7dc36c0e571c8f4a1d3513a311a16b2
5
5
  SHA512:
6
- metadata.gz: 8005ca1b0539c86373b35c04f391c3e58ffeff2e14a0d520d582688c34be25329321d9d8b0baac5c960519b4c3edd466b48a490b0008be054de268a41a9fcb09
7
- data.tar.gz: dc9ec258788d1ac193a95d93a4b3b090a64cc3902ea01903396188e202acee6e682b8432ff7056aede5d2e53126c4d53808cf9826cc4b0ce7863fcfde012fecd
6
+ metadata.gz: cd564516b803e856165bf78e4d18edfbb25235354d91587a24541789e5f9fb6c7cba69ce963bd9dd9b23b314fc64cd58d6b110508da7735d0c39030d8d968a46
7
+ data.tar.gz: 6e0c05f8b1d09de8929a1979cc11129495184e95d504bbbb76ee96f80e2b7faf1e2f70855a8254ffebf2dcfb609870277c18f61ef79662f30a9ea3ec4e7516b9
@@ -2,10 +2,10 @@ require 'mysql2'
2
2
  require 'json'
3
3
 
4
4
  def is_json_valid(object)
5
- JSON.parse(object)
6
- return true
7
- rescue JSON::ParserError
8
- return false
5
+ JSON.parse(object)
6
+ return true
7
+ rescue JSON::ParserError
8
+ return false
9
9
  end
10
10
 
11
11
  def convert(results)
@@ -42,7 +42,7 @@ class Mysql2json
42
42
 
43
43
  def self.query_export(q, client, filename)
44
44
  results = client.query(q)
45
- convert(results)
45
+ json_data = convert(results)
46
46
  file = File.open(filename, 'w')
47
47
  file.write(json_data)
48
48
  file.close()
@@ -50,6 +50,3 @@ class Mysql2json
50
50
  end
51
51
 
52
52
  end
53
-
54
-
55
-
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.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jared Wright