pgbundle 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b9cc70db81cebbd38a1e0e58ed488170c31b63a
4
- data.tar.gz: d53ffc2ec4eeb0ee68f4b2152bd454930d925171
3
+ metadata.gz: 5bc544b1d7c63c1b03cdcd5f1f2efba45a408513
4
+ data.tar.gz: e2442eed3ae4e85ba5c90eef2e6839424dd77852
5
5
  SHA512:
6
- metadata.gz: fd4ad7ddb2a3e04d5ac26e51fb56892a52682f5b88647799a652bca003089f7a6f3f3d15ef41f3c422d09983e84e7fce562caedec603a98fd7136988194fbb88
7
- data.tar.gz: 1876743b60fae52ecc8a59c928703b4f9d42a7b00da3ae746eec089a7ef47e4cf3deb5774db3045d05338822c9e57187c243a4c1b94d0568968769891c8421d1
6
+ metadata.gz: 09fbc8bea557011fcafc1ca6c1e1c606767f86f270eac2ddfd78bad16c20a1182941790c93b21d3bd3456f1c967083687e5bd174a47e16071744880c2f34e6f5
7
+ data.tar.gz: 9a7c6cec293d210a87c9c65ab11f78a1646216a19fedb67c332bc0336ecb428e882ce73fe6853d8e8461e3221cfecf8f2a8aa66fc0f101d108d06e516102f3c8
@@ -52,8 +52,8 @@ module PgBundle
52
52
  end
53
53
 
54
54
  class GitCommandError < InstallError
55
- def initialize
56
- super 'Failed to load git repository'
55
+ def initialize(dest)
56
+ super "Failed to load git repository cmd: '#{dest}'"
57
57
  end
58
58
  end
59
59
  end
@@ -6,18 +6,19 @@ module PgBundle
6
6
  # on a typical environment ssh access is needed if the database host differs from
7
7
  # the Pgfile host
8
8
  class Database
9
- attr_accessor :name, :user, :host, :system_user, :use_sudo
9
+ attr_accessor :name, :user, :host, :system_user, :use_sudo, :port
10
10
  def initialize(name, opts = {})
11
11
  @name = name
12
12
  @user = opts[:user] || 'postgres'
13
13
  @host = opts[:host] || 'localhost'
14
14
  @use_sudo = opts[:use_sudo] || false
15
15
  @system_user = opts[:system_user] || 'postgres'
16
+ @port = opts[:port] || 5432
16
17
  end
17
18
 
18
19
  def connection
19
20
  @connection ||= begin
20
- PG.connect(dbname: name, user: user, host: host)
21
+ PG.connect(dbname: name, user: user, host: host, port: port)
21
22
  end
22
23
  end
23
24
 
@@ -33,6 +33,8 @@ module PgBundle
33
33
  @definition.extensions[ext.name] = ext
34
34
  end
35
35
 
36
+ private
37
+
36
38
  def extract_options!(arr)
37
39
  if arr.last.is_a? Hash
38
40
  arr.pop
@@ -19,9 +19,10 @@ module PgBundle
19
19
 
20
20
  def clone(dest)
21
21
  # git clone user@git-server:project_name.git -b branch_name /some/folder
22
- %x((git clone git@github.com:#{path}.git -b #{branch_name} --quiet --depth=1 #{clone_dir} && rm -rf #{clone_dir}/.git}) 2>&1)
22
+ cmd = "git clone git@github.com:#{path}.git -b #{branch_name} --quiet --depth=1 #{clone_dir}"
23
+ %x((#{cmd} && rm -rf #{clone_dir}/.git}) 2>&1)
23
24
  unless $?.success?
24
- fail GitCommandError
25
+ fail GitCommandError, cmd
25
26
  end
26
27
  end
27
28
 
@@ -1,3 +1,3 @@
1
1
  module Pgbundle
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
@@ -1,4 +1,4 @@
1
- database 'pgbundle_test', host: 'localhost'
1
+ database 'pgbundle_test', host: 'localhost', port: 54321
2
2
 
3
3
  pgx 'hstore'
4
4
  pgx 'bar', path: './spec/sample_extensions/bar', requires: 'ltree'
@@ -4,5 +4,6 @@ describe PgBundle::Dsl do
4
4
 
5
5
  subject { PgBundle::Dsl.new.eval_pgfile(File.expand_path('../Pgfile', __FILE__)) }
6
6
  its(:database) { should be_a PgBundle::Database }
7
+ its('database.port') { should be 54321 }
7
8
  its(:extensions) { should be_a Hash }
8
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pgbundle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manuel Kniep
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-21 00:00:00.000000000 Z
11
+ date: 2014-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor