dbgeni 0.10.0 → 0.10.1

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: 662e5bb250525f1053d901edbae3d01ac733878f
4
- data.tar.gz: d58cfb81adf70cd4674b47fa0259992fbc15d168
3
+ metadata.gz: 52517ff8e403e5b474e7ed5bfc7f819c4979be9f
4
+ data.tar.gz: 0173368248fb9bbd838d2e4e6f6bd4cc0e99d0ac
5
5
  SHA512:
6
- metadata.gz: 3e1a1d3e269c4e96e38abd113c056b70bab9732de9533d2ccf13499a7de5882de56a36c320e442029bf1f27b438f3f810e8aad53b1113dd3d7193189dff49c64
7
- data.tar.gz: 242e3e2f823249aed271d674b19eebe23af1553939be7af93cee81af64ef1a88e6bc082cd41b980ea3e747bf52d04b3ea7908e9542d6ef0f3ebf597334a5d7e6
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.
@@ -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 - KEEP_METHODS).each do |m|
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
- puts msg
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.0
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: 2014-03-11 00:00:00.000000000 Z
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.2.0
84
+ rubygems_version: 2.4.3
84
85
  signing_key:
85
86
  specification_version: 4
86
87
  summary: A generic database installer