mysqlconn 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mysqlconn.rb +8 -0
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 18cb53723bc90c29c7fa83666e2beae7bb7f1870
4
- data.tar.gz: 6d59dac39738ab1a3046282cd40232e48fd9ab86
3
+ metadata.gz: badf81aff07d481cde7e4c89646495546d597aee
4
+ data.tar.gz: de1e53c12a87cfbedd0d8d939381bcc95ef3e095
5
5
  SHA512:
6
- metadata.gz: 7139919e8301d43aa97f2a307e9ae45824eb562d59cc4bcacb5cdfcbf6b74f063f862c3ceba8db97b034b93ef5cb7bfda66492958af90af3cc9ed6cf33192a7d
7
- data.tar.gz: 7a1de07abe3e0c3a843966e2787fd616f1e70ca4b4875c55a64595dec8ab80723de4a28a311e438293e79880d6efb526993bfbaaebba84db9eba4128b8ca725b
6
+ metadata.gz: 0c12155da708b254a753f0e01dc6b06861a6cec02ba5c7847ee47bdcaf7bb7e859d6d65523c0efe6fcf4fd76965b831006e2481b39ffe00988f13bd76ea1764e
7
+ data.tar.gz: c1448a4bb70881f48879ed33fce8efbc31b9658bc0727393d1c15357af2ff65a5c90ce4bdb3be7042bff0fe743dbd2422dab21e374e85da462ed17bb909b16b8
data/lib/mysqlconn.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'yaml'
2
2
  require 'fileutils'
3
3
  require 'set'
4
+ require 'json'
4
5
 
5
6
  # Copyright Neville Kadwa (2014)
6
7
 
@@ -78,6 +79,13 @@ class MysqlConn
78
79
  end
79
80
  exit(0)
80
81
  end
82
+ if db_key == '-c'
83
+ @db_key = args.shift || raise('no db key provided. Usage for configuration: mysqlconn -c db_key')
84
+ db = config[db_key] || raise("No #{db_key} found")
85
+ puts JSON.pretty_generate(config[db_key])
86
+ exit(0)
87
+ end
88
+
81
89
 
82
90
  db = config[db_key] || raise("No #{db_key} found")
83
91
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mysqlconn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neville Kadwa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-19 00:00:00.000000000 Z
11
+ date: 2015-07-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Save your various database credentials to a configuration file and zip
14
14
  around easily