dburl 0.1.2 → 0.1.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 (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -1
  3. data/bin/dburl +15 -0
  4. data/version.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e5353f9de67d4ecb2bd943085912b2260b98a0c3
4
- data.tar.gz: d01cb6b3208da51a5eb8e0b171eea4d86c2d989e
3
+ metadata.gz: 3562c5b792d8f44bd0c4c6e9ce2c2a13a332656e
4
+ data.tar.gz: 845440aaedb65f65f8f5c0e072a3cf7f21da1f96
5
5
  SHA512:
6
- metadata.gz: f01a73ba0587ac5ec09b8adbb739a1b951005b4cca5be874139e427f38f43af5f8988c42ba36cc19e8120511815e685c5e72e74cb54f6baed1a12d13c02b7a1d
7
- data.tar.gz: dbc1778642d5ccaf7660a0f8085d45457c65728e13dc15542e9d83914d9dfab058721ceef07a2cf3eb2f28d3a9006f8be16e24e8e6930373000f147a33d358a3
6
+ metadata.gz: d2e8e8fca596bd265d8ee2f44acafaaa8f6edf2d85d28f23836c8676403fef3382c292cf48a5e49711e0ef6d539725efbf35370d7fa1155c5eaa9da8213a80e4
7
+ data.tar.gz: a2badabe444fca196e7907d6277a6e2a0bef27edbb69310aa7ca2eb9d66c968a3ec73a5c711ffa02b40a745b00df3c47b9cbb0ead47c6c9fb6b1286959a763c5
data/README.md CHANGED
@@ -7,8 +7,9 @@ be dropped into a `psql` shell.
7
7
 
8
8
  **Currently Supported**
9
9
  * Postgres
10
+ * Redis
10
11
 
11
- ...but adding a new one is [easy](https://github.com/dashkb/dburl/blob/master/bin/dburl#L25)!
12
+ ...and adding a new one is [easy](https://github.com/dashkb/dburl/blob/master/bin/dburl#L25)!
12
13
 
13
14
  ### Installation
14
15
 
data/bin/dburl CHANGED
@@ -1,6 +1,13 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'uri'
4
+ require 'optparse'
5
+
6
+ OptionParser.new do |opts|
7
+ opts.on '-d', '--debug', 'Print connection command and exit' do
8
+ $debug = true
9
+ end
10
+ end.parse!
4
11
 
5
12
  input = ARGV.first
6
13
 
@@ -14,8 +21,10 @@ def invalid!
14
21
  exit
15
22
  end
16
23
 
24
+
17
25
  begin
18
26
  db = URI.parse ARGV.first
27
+ db.path = nil if db.path.empty?
19
28
  rescue URI::InvalidURIError
20
29
  invalid!
21
30
  else
@@ -39,6 +48,12 @@ when 'postgres'
39
48
  cmd += " -d #{db.path[1..-1]}" if db.path
40
49
 
41
50
  cmd = "PGPASSWORD=#{db.password} #{cmd}" if db.password
51
+ when 'redis'
52
+ cmd = 'redis-cli'
53
+ cmd += " -h #{db.host}" if db.host
54
+ cmd += " -p #{db.port}" if db.port
55
+ cmd += " -a #{db.password}" if db.password
56
+ cmd += " -n #{db.path[1..-1]}" if db.path
42
57
  else
43
58
  puts "This script doesn't support #{db.scheme} yet."
44
59
  puts 'Please add it and open a pull request.'
data/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dburl
2
- VERSION = '0.1.2'.freeze
2
+ VERSION = '0.1.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dburl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Brett
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-09 00:00:00.000000000 Z
11
+ date: 2016-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler