pgbundle 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.travis.yml +11 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +45 -0
- data/Rakefile +7 -0
- data/bin/pgbundle +61 -0
- data/lib/pgbundle.rb +59 -0
- data/lib/pgbundle/base_source.rb +26 -0
- data/lib/pgbundle/database.rb +133 -0
- data/lib/pgbundle/definition.rb +70 -0
- data/lib/pgbundle/dsl.rb +44 -0
- data/lib/pgbundle/extension.rb +270 -0
- data/lib/pgbundle/github_source.rb +32 -0
- data/lib/pgbundle/path_source.rb +15 -0
- data/lib/pgbundle/version.rb +3 -0
- data/pgbundle.gemspec +30 -0
- data/spec/Pgfile +6 -0
- data/spec/definition_spec.rb +19 -0
- data/spec/dsl_spec.rb +8 -0
- data/spec/extension_spec.rb +76 -0
- data/spec/sample_extensions/bar/Makefile +5 -0
- data/spec/sample_extensions/bar/bar--0.0.2.sql +2 -0
- data/spec/sample_extensions/bar/bar.control +5 -0
- data/spec/sample_extensions/baz/Makefile +5 -0
- data/spec/sample_extensions/baz/baz--0.0.2.sql +2 -0
- data/spec/sample_extensions/baz/baz.control +5 -0
- data/spec/sample_extensions/foo/Makefile +5 -0
- data/spec/sample_extensions/foo/foo--0.0.1--0.0.2.sql +2 -0
- data/spec/sample_extensions/foo/foo--0.0.1.sql +2 -0
- data/spec/sample_extensions/foo/foo--0.0.2--0.0.1.sql +2 -0
- data/spec/sample_extensions/foo/foo--0.0.2.sql +2 -0
- data/spec/sample_extensions/foo/foo.control +4 -0
- data/spec/source_spec.rb +10 -0
- data/spec/spec_helper.rb +47 -0
- metadata +210 -0
data/spec/source_spec.rb
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
describe PgBundle::PathSource do
|
3
|
+
subject { PgBundle::PathSource.new('./foo/bar') }
|
4
|
+
its(:path) { should eq './foo/bar' }
|
5
|
+
end
|
6
|
+
|
7
|
+
describe PgBundle::GithubSource do
|
8
|
+
subject { PgBundle::GithubSource.new('foo/bar') }
|
9
|
+
its(:path) { should eq 'foo/bar' }
|
10
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'pgbundle'
|
3
|
+
require 'pg'
|
4
|
+
require 'pry'
|
5
|
+
|
6
|
+
Dir.glob('spec/support/**/*.rb').each { |f| require f }
|
7
|
+
|
8
|
+
RSpec.configure do |config|
|
9
|
+
config.fail_fast = false
|
10
|
+
config.order = 'random'
|
11
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
12
|
+
config.filter_run focus: true
|
13
|
+
config.run_all_when_everything_filtered = true
|
14
|
+
config.before(:suite) do
|
15
|
+
conn = PG.connect(dbname: 'postgres', user: 'postgres')
|
16
|
+
conn.exec('CREATE DATABASE pgbundle_test')
|
17
|
+
conn.close
|
18
|
+
end
|
19
|
+
|
20
|
+
config.after(:suite) do
|
21
|
+
conn = PG.connect(dbname: 'postgres', user: 'postgres')
|
22
|
+
conn.exec("SELECT pg_terminate_backend(pid) from pg_stat_activity WHERE datname ='pgbundle_test'")
|
23
|
+
conn.exec('DROP DATABASE IF EXISTS pgbundle_test')
|
24
|
+
conn.close
|
25
|
+
end
|
26
|
+
|
27
|
+
config.before(:each) do
|
28
|
+
[
|
29
|
+
PgBundle::Extension.new('foo', '0.0.2', path: './spec/sample_extensions/foo'),
|
30
|
+
PgBundle::Extension.new('bar', path: './spec/sample_extensions/bar'),
|
31
|
+
PgBundle::Extension.new('baz', path: './spec/sample_extensions/baz')
|
32
|
+
].each { |d| d.uninstall!(database) }
|
33
|
+
end
|
34
|
+
|
35
|
+
config.after(:each) do
|
36
|
+
[
|
37
|
+
PgBundle::Extension.new('foo', '0.0.2', path: './spec/sample_extensions/foo'),
|
38
|
+
PgBundle::Extension.new('bar', path: './spec/sample_extensions/bar'),
|
39
|
+
PgBundle::Extension.new('baz', path: './spec/sample_extensions/baz')
|
40
|
+
].each { |d| d.uninstall!(database) }
|
41
|
+
database.connection.close
|
42
|
+
end
|
43
|
+
|
44
|
+
def database
|
45
|
+
@db ||= PgBundle::Database.new('pgbundle_test')
|
46
|
+
end
|
47
|
+
end
|
metadata
ADDED
@@ -0,0 +1,210 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pgbundle
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Manuel Kniep
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-05-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thor
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: net-ssh
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: net-scp
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pg
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.17'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.17'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 2.14.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 2.14.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: bundler
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.5'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.5'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rake
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: pry
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description: bundler like postgres extension manager
|
126
|
+
email:
|
127
|
+
- manuel@adjust.com
|
128
|
+
executables:
|
129
|
+
- pgbundle
|
130
|
+
extensions: []
|
131
|
+
extra_rdoc_files: []
|
132
|
+
files:
|
133
|
+
- ".gitignore"
|
134
|
+
- ".travis.yml"
|
135
|
+
- Gemfile
|
136
|
+
- LICENSE.txt
|
137
|
+
- README.md
|
138
|
+
- Rakefile
|
139
|
+
- bin/pgbundle
|
140
|
+
- lib/pgbundle.rb
|
141
|
+
- lib/pgbundle/base_source.rb
|
142
|
+
- lib/pgbundle/database.rb
|
143
|
+
- lib/pgbundle/definition.rb
|
144
|
+
- lib/pgbundle/dsl.rb
|
145
|
+
- lib/pgbundle/extension.rb
|
146
|
+
- lib/pgbundle/github_source.rb
|
147
|
+
- lib/pgbundle/path_source.rb
|
148
|
+
- lib/pgbundle/version.rb
|
149
|
+
- pgbundle.gemspec
|
150
|
+
- spec/Pgfile
|
151
|
+
- spec/definition_spec.rb
|
152
|
+
- spec/dsl_spec.rb
|
153
|
+
- spec/extension_spec.rb
|
154
|
+
- spec/sample_extensions/bar/Makefile
|
155
|
+
- spec/sample_extensions/bar/bar--0.0.2.sql
|
156
|
+
- spec/sample_extensions/bar/bar.control
|
157
|
+
- spec/sample_extensions/baz/Makefile
|
158
|
+
- spec/sample_extensions/baz/baz--0.0.2.sql
|
159
|
+
- spec/sample_extensions/baz/baz.control
|
160
|
+
- spec/sample_extensions/foo/Makefile
|
161
|
+
- spec/sample_extensions/foo/foo--0.0.1--0.0.2.sql
|
162
|
+
- spec/sample_extensions/foo/foo--0.0.1.sql
|
163
|
+
- spec/sample_extensions/foo/foo--0.0.2--0.0.1.sql
|
164
|
+
- spec/sample_extensions/foo/foo--0.0.2.sql
|
165
|
+
- spec/sample_extensions/foo/foo.control
|
166
|
+
- spec/source_spec.rb
|
167
|
+
- spec/spec_helper.rb
|
168
|
+
homepage: http://github.com/adjust/pgbundle
|
169
|
+
licenses:
|
170
|
+
- MIT
|
171
|
+
metadata: {}
|
172
|
+
post_install_message:
|
173
|
+
rdoc_options: []
|
174
|
+
require_paths:
|
175
|
+
- lib
|
176
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
181
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
182
|
+
requirements:
|
183
|
+
- - ">="
|
184
|
+
- !ruby/object:Gem::Version
|
185
|
+
version: '0'
|
186
|
+
requirements: []
|
187
|
+
rubyforge_project:
|
188
|
+
rubygems_version: 2.2.1
|
189
|
+
signing_key:
|
190
|
+
specification_version: 4
|
191
|
+
summary: bundling postgres extension
|
192
|
+
test_files:
|
193
|
+
- spec/Pgfile
|
194
|
+
- spec/definition_spec.rb
|
195
|
+
- spec/dsl_spec.rb
|
196
|
+
- spec/extension_spec.rb
|
197
|
+
- spec/sample_extensions/bar/Makefile
|
198
|
+
- spec/sample_extensions/bar/bar--0.0.2.sql
|
199
|
+
- spec/sample_extensions/bar/bar.control
|
200
|
+
- spec/sample_extensions/baz/Makefile
|
201
|
+
- spec/sample_extensions/baz/baz--0.0.2.sql
|
202
|
+
- spec/sample_extensions/baz/baz.control
|
203
|
+
- spec/sample_extensions/foo/Makefile
|
204
|
+
- spec/sample_extensions/foo/foo--0.0.1--0.0.2.sql
|
205
|
+
- spec/sample_extensions/foo/foo--0.0.1.sql
|
206
|
+
- spec/sample_extensions/foo/foo--0.0.2--0.0.1.sql
|
207
|
+
- spec/sample_extensions/foo/foo--0.0.2.sql
|
208
|
+
- spec/sample_extensions/foo/foo.control
|
209
|
+
- spec/source_spec.rb
|
210
|
+
- spec/spec_helper.rb
|