pasqual 0.1.1 → 0.1.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 16d0bb1110e38f1ff70ae8c108949c29052b8faa
4
- data.tar.gz: 87c42ab7e84370f7d448117b227c717439c82e3f
3
+ metadata.gz: bc09adce972094277d683a6c2e9cb1ad56548f28
4
+ data.tar.gz: 2ea079766156623edb4164d29ca962ffa860e0a3
5
5
  SHA512:
6
- metadata.gz: 74fbc561d80a6258ba47bb5ac43719d607cebedf6179160aac00d02f933d120152d40de391b98b93aa72ccd2d648cb46e7db82541bafaec95ce0af750f94d045
7
- data.tar.gz: b9473965169ecb96b5368b21069f436c59308843e0fbaa0a514cb8b17b011470fb08893889868f4236b0be16088569f55eed272f9fb63a6d20d79d5d16113759
6
+ metadata.gz: 78ca14b7c1cefc569bfbbf76f44a5689feca1fb8d20c83ea865745371f2b676f264401b19043863b071196cbaa823b07c03aec0272341241709c201dd196aada
7
+ data.tar.gz: 34d94bfafe3371e98165ad00926532ee8f05b115ba8373606b8a1f309f0a1491deaa0eeffc681d9a459d5d8cd2c90f33973208f71f38d549e15268c42a89bfcc
data/.travis.yml ADDED
@@ -0,0 +1,11 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.1.1
5
+
6
+ addons:
7
+ postgresql: "9.3"
8
+
9
+ env: DATABASE_URL=postgres://postgres@localhost:5432/pasqual_test
10
+
11
+ script: bundle exec rspec spec
@@ -3,8 +3,11 @@ module Pasqual
3
3
  module Arglist
4
4
 
5
5
  def self.args(username, password, host, port, name)
6
- list = ['-h', host, '-U', username, '-p', port.to_s]
7
- list += ['-w'] if password.nil?
6
+ list = []
7
+ list << '-h' << host if host.to_s.length > 0
8
+ list << '-U' << username if username.to_s.length > 0
9
+ list << '-p' << port.to_s if port.to_s.length > 0
10
+ list << '-w' if password.to_s.length == 0
8
11
 
9
12
  list + [name]
10
13
  end
@@ -33,8 +33,8 @@ module Pasqual
33
33
  Psql.command statement, username, password, host, port, name
34
34
  end
35
35
 
36
- def pipe_sql(file)
37
- Psql.pipe file, username, password, host, port, name
36
+ def pipe_sql(file, dbname = name)
37
+ Psql.pipe file, username, password, host, port, dbname
38
38
  end
39
39
 
40
40
  end
@@ -1,3 +1,3 @@
1
1
  module Pasqual
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -27,6 +27,7 @@ describe Pasqual::Database do
27
27
  end
28
28
 
29
29
  describe '#command' do
30
+ before { database.createdb rescue Pasqual::Dropdb::Failed }
30
31
 
31
32
  it 'runs an sql command' do
32
33
  expect do
@@ -37,6 +38,7 @@ describe Pasqual::Database do
37
38
  end
38
39
 
39
40
  describe '#pipe_sql' do
41
+ before { database.createdb rescue Pasqual::Dropdb::Failed }
40
42
 
41
43
  it 'runs an sql script file' do
42
44
  file = Tempfile.new 'sql-script'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pasqual
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derek Kastner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-07 00:00:00.000000000 Z
11
+ date: 2014-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: childprocess
@@ -75,6 +75,7 @@ extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
77
77
  - ".gitignore"
78
+ - ".travis.yml"
78
79
  - Gemfile
79
80
  - LICENSE.txt
80
81
  - README.md