dburl 0.1.0 → 0.1.1

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 +7 -8
  3. data/bin/dburl +19 -1
  4. data/lib/dburl/version.rb +1 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bb343c499e71e6550578aebfcb2821164e1606ea
4
- data.tar.gz: 607fdba0f32691d3d42d2c898ad1e90c092a467c
3
+ metadata.gz: 6efc5f1d70587e9c7e23fd54d8bdedbf8056bde2
4
+ data.tar.gz: 384661007a0ea397beb96476468af254baeeaf58
5
5
  SHA512:
6
- metadata.gz: 4322c994dcd70ddaf2a6e8f7bc189bf7a0a79a1a0a08d8741e2f28b6c4d82d49c3f4a483b186d8b60dc0c70032326ab7dea365edd8b2a775000e384ce91ba329
7
- data.tar.gz: 57112dc71fe558b8d9ea53e7b54c16dac535a400ef594307d8a78badbbc449310bdd8428bc17226e4852b5fb677bdb884e3656800ffebb85995c24d96677229e
6
+ metadata.gz: 754c77d6c3c4ac3d0a0e3accd492efabafce21a0e635f2f556335c86bf8d1b377f3cd36efc366c8d17b6bf6e7de5ad9f1b29c47dcb0d4dcd7b73518ea5883a12
7
+ data.tar.gz: a33713bc1322beeec1779ddb4231dc735a9038f66b6705abfeddfe1ad9fc67c643552eac592c6d452d9014e75f954ff6b946c754c9ccd84c13e2f78b51ef3035
data/README.md CHANGED
@@ -1,23 +1,22 @@
1
1
  # `dburl`
2
2
 
3
- Easily connect to a database url like `postgres://username:password@hostname:1234/dbname`
3
+ Easily connect to your database.
4
+
5
+ Just `$ dburl postgres://username:password@hostname:1234/dbname` and you'll
6
+ be dropped into a `psql` shell.
4
7
 
5
8
  #### Currently Supported
6
9
  * Postgres
7
10
 
8
- ...but adding a new one is easy!
11
+ ...but adding a new one is [easy](://github.com/dashkb/dburl/blob/master/bin/dburl#L8)!
9
12
 
10
13
  ## Installation
11
14
 
12
- Install the gem with `gem install dburl`.
13
-
14
- ## Usage
15
-
16
- `$ dburl <your database url>` simple!
15
+ `$ gem install dburl`
17
16
 
18
17
  ## Contributing
19
18
 
20
- Bug reports and pull requests are welcome on GitHub at https://github.com/[dashkb]/dburl.
19
+ Bug reports, pull requests, and support for more DBs are welcome on GitHub at https://github.com/dashkb/dburl.
21
20
 
22
21
  ## License
23
22
 
data/bin/dburl CHANGED
@@ -2,7 +2,25 @@
2
2
 
3
3
  require 'uri'
4
4
 
5
- db = URI.parse ARGV.first
5
+ input = ARGV.first
6
+
7
+ if !input
8
+ puts "Usage: dburl [DATABASE_URL]"
9
+ exit
10
+ end
11
+
12
+ def invalid!
13
+ puts "Couldn't parse your input. Was it a valid database URL?"
14
+ exit
15
+ end
16
+
17
+ begin
18
+ db = URI.parse ARGV.first
19
+ rescue URI::InvalidURIError
20
+ invalid!
21
+ else
22
+ invalid! unless db.scheme
23
+ end
6
24
 
7
25
  case db.scheme
8
26
  when 'postgres'
data/lib/dburl/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dburl
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dburl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Brett