dbgeni 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -0
- data/lib/dbgeni/blank_slate.rb +10 -2
- data/lib/dbgeni/logger.rb +8 -1
- data/lib/dbgeni/migration_list.rb +0 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52517ff8e403e5b474e7ed5bfc7f819c4979be9f
|
4
|
+
data.tar.gz: 0173368248fb9bbd838d2e4e6f6bd4cc0e99d0ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d566688daf23568eed58fd65e07b7c1c60d2a60f639e1da1bf98569d0582f515f9c527194fbd532665397b447651e1e27ff0a05d5cbc18854de509ff61a591b
|
7
|
+
data.tar.gz: 53f5340c21363ddc99e721a63568d8297b453546c55407d568d0a09719f6ca4800ff4e0c3518aa371264b14b67a24541cbe19db891083160736d5a061e07c658
|
data/README.md
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
# DBGeni
|
2
|
+
|
3
|
+
DBGeni helps you organise and apply changes to your database. If you follow a few opinionated rules, dbgeni knows where to find your migrations scripts, the order to run them and what still needs to be applied.
|
4
|
+
|
5
|
+
Currently supports Sqlite, MySQL, Oracle and Sybase.
|
6
|
+
|
7
|
+
Checkout http://dbgeni.appsintheopen.com for the manual and more information.
|
data/lib/dbgeni/blank_slate.rb
CHANGED
@@ -13,9 +13,17 @@ module DBGeni
|
|
13
13
|
:instance_variable_set,
|
14
14
|
:send,
|
15
15
|
:alias_method
|
16
|
-
|
16
|
+
]
|
17
|
+
# In Ruby 1.8.7 the instance_methods call returns an array of
|
18
|
+
# strings, but in later versions it returns an array of symbol.
|
19
|
+
# This hack is here to convert the KEEP_METHODS array to strings
|
20
|
+
# but only if required
|
21
|
+
keepers = KEEP_METHODS
|
22
|
+
if instance_methods.first.is_a?(String)
|
23
|
+
keepers = KEEP_METHODS.map{|v| v.to_s}
|
24
|
+
end
|
17
25
|
suppress_warnings {
|
18
|
-
(instance_methods -
|
26
|
+
(instance_methods - keepers).each do |m|
|
19
27
|
undef_method(m)
|
20
28
|
end
|
21
29
|
}
|
data/lib/dbgeni/logger.rb
CHANGED
@@ -3,9 +3,14 @@ module DBGeni
|
|
3
3
|
class Logger
|
4
4
|
|
5
5
|
def self.instance(location=nil)
|
6
|
+
@@suppress_stdout ||= false
|
6
7
|
@@singleton_instance ||= self.new(location)
|
7
8
|
end
|
8
9
|
|
10
|
+
def self.suppress_stdout
|
11
|
+
@@suppress_stdout = true
|
12
|
+
end
|
13
|
+
|
9
14
|
def info(msg)
|
10
15
|
write_msg(msg)
|
11
16
|
end
|
@@ -39,7 +44,9 @@ module DBGeni
|
|
39
44
|
if @fh && !@fh.closed?
|
40
45
|
@fh.puts "#{Time.now.strftime('%Y%m%d %H:%M:%S')} - #{msg}"
|
41
46
|
end
|
42
|
-
|
47
|
+
unless @@suppress_stdout
|
48
|
+
puts msg
|
49
|
+
end
|
43
50
|
end
|
44
51
|
|
45
52
|
def initialize(location=nil)
|
@@ -75,7 +75,6 @@ module DBGeni
|
|
75
75
|
# The migration filename format is YYYYMMDDHHMM_<up / down >_title.sql
|
76
76
|
files = Dir.entries(@migration_directory).grep(/^\d{12}_up_.+\.sql$/).sort
|
77
77
|
rescue Exception => e
|
78
|
-
puts "Migrations directory: #{@migrations_directory}"
|
79
78
|
raise DBGeni::MigrationDirectoryNotExist, "Migrations directory: #{@migrations_directory}"
|
80
79
|
end
|
81
80
|
@migrations = Array.new
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dbgeni
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen O'Donnell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Generic installer to manage database migrations for various databases
|
14
14
|
email: stephen@betteratoracle.com
|
@@ -17,6 +17,7 @@ executables:
|
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
+
- README.md
|
20
21
|
- Rakefile
|
21
22
|
- bin/dbgeni
|
22
23
|
- lib/dbgeni.rb
|
@@ -80,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
81
|
version: '0'
|
81
82
|
requirements: []
|
82
83
|
rubyforge_project:
|
83
|
-
rubygems_version: 2.
|
84
|
+
rubygems_version: 2.4.3
|
84
85
|
signing_key:
|
85
86
|
specification_version: 4
|
86
87
|
summary: A generic database installer
|