storey 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +22 -0
- data/lib/storey/migrator.rb +6 -8
- data/lib/storey/version.rb +1 -1
- data/storey.gemspec +1 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9638c28132d29d5407b019283d50b00fc155e4b
|
4
|
+
data.tar.gz: c6981e67c5230e66c2830adb2094e97ec6d31960
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6861dd0d9084ff308f512ac6f981982923572daae78fc77a7e4fd99cd782ee03a6fb660bc59e67e2fdf672191c09b0b4f45fb1045f94f78e4524b7c9eda4cd8
|
7
|
+
data.tar.gz: c76f2060ebdbaed86bfa68bac5f982a3d6257896eb97b45a6cabf6713014dc8dff2911be04420e1899bd3afcb9a71deaec93a09203e2bc15b252a10e4912c341
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Ramon Tayag
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/storey/migrator.rb
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
module Storey
|
2
|
-
|
2
|
+
class Migrator
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
def migrate_all(options={})
|
4
|
+
def self.migrate_all(options={})
|
7
5
|
options[:version] = options[:version].to_i if options[:version]
|
8
6
|
self.migrate 'public', options
|
9
7
|
Dumper.dump
|
@@ -12,7 +10,7 @@ module Storey
|
|
12
10
|
end
|
13
11
|
end
|
14
12
|
|
15
|
-
def migrate(schema, options={})
|
13
|
+
def self.migrate(schema, options={})
|
16
14
|
Storey.switch schema do
|
17
15
|
puts "= Migrating #{schema}"
|
18
16
|
::ActiveRecord::Migrator.migrate(::ActiveRecord::Migrator.migrations_path,
|
@@ -20,7 +18,7 @@ module Storey
|
|
20
18
|
end
|
21
19
|
end
|
22
20
|
|
23
|
-
def run(direction, schema, version)
|
21
|
+
def self.run(direction, schema, version)
|
24
22
|
Storey.switch schema do
|
25
23
|
::ActiveRecord::Migrator.run(
|
26
24
|
direction,
|
@@ -30,14 +28,14 @@ module Storey
|
|
30
28
|
end
|
31
29
|
end
|
32
30
|
|
33
|
-
def rollback_all(step=1)
|
31
|
+
def self.rollback_all(step=1)
|
34
32
|
Storey.schemas.each do |schema_name|
|
35
33
|
self.rollback(schema_name, step)
|
36
34
|
end
|
37
35
|
Dumper.dump
|
38
36
|
end
|
39
37
|
|
40
|
-
def rollback(schema, step=1)
|
38
|
+
def self.rollback(schema, step=1)
|
41
39
|
Storey.switch schema do
|
42
40
|
puts "= Rolling back `#{schema}` #{step} steps"
|
43
41
|
::ActiveRecord::Migrator.rollback(
|
data/lib/storey/version.rb
CHANGED
data/storey.gemspec
CHANGED
@@ -10,6 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.homepage = "https://github.com/ramontayag/storey"
|
11
11
|
s.summary = %q{Manage multiple PostgreSQL schemas in your multi-tenant app.}
|
12
12
|
s.description = %q{Storey aims to simplify the implementation of managing a multi-tenant application.}
|
13
|
+
s.license = 'MIT'
|
13
14
|
|
14
15
|
s.rubyforge_project = "storey"
|
15
16
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: storey
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ramon Tayag
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec-rails
|
@@ -106,6 +106,7 @@ files:
|
|
106
106
|
- .rspec
|
107
107
|
- CHANGELOG.md
|
108
108
|
- Gemfile
|
109
|
+
- LICENSE.txt
|
109
110
|
- README.md
|
110
111
|
- Rakefile
|
111
112
|
- lib/storey.rb
|
@@ -199,7 +200,8 @@ files:
|
|
199
200
|
- spec/tasks/storey_rake_spec.rb
|
200
201
|
- storey.gemspec
|
201
202
|
homepage: https://github.com/ramontayag/storey
|
202
|
-
licenses:
|
203
|
+
licenses:
|
204
|
+
- MIT
|
203
205
|
metadata: {}
|
204
206
|
post_install_message:
|
205
207
|
rdoc_options: []
|