multi_ar 1.0.0.pre.rc2 → 1.0.0
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/multi_ar/interface.rb +5 -6
- data/lib/multi_ar/version.rb +1 -1
- data/lib/multi_ar.rb +3 -4
- data.tar.gz.sig +0 -0
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3754772cf591a147943b8cfb7b83c85254872110
|
4
|
+
data.tar.gz: 620350cf731cc914a5620248dbe1d632406bd34b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5af7a1f88b87c54891429d9f47cff6a4c198c5c50f85c7a47cae606417080fd1f5dc78adafd37ef3fe4515aa035657f5895c5e92fa6f59178f1986d18b327898
|
7
|
+
data.tar.gz: f89187f075e2ad595d6d6ea60e12c98888ef0119ef6481427d100998e5a7635ad706a29b54616f9415bee763715498ed448f6ab7053640d944c94709e2bf3d31
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/multi_ar/interface.rb
CHANGED
@@ -77,10 +77,9 @@ module MultiAR
|
|
77
77
|
|
78
78
|
if @migration_framework == true
|
79
79
|
p.opt "all_rake_tasks", "List all Rake tasks, not only commented ones", short: "A", type: :flag
|
80
|
-
# TODO: what for this is...?
|
81
|
-
#p.opt "common_migrations", "Run the migrations bundled with the gem, for common databases.", type: :flag, default: true
|
82
80
|
# TODO: not implemented currently, do we really need this?
|
83
81
|
#p.opt "list_databases", "Lists databases that contains migrations in the gem", type: :flag
|
82
|
+
# TODO: should we do migration_dirs here too instead?
|
84
83
|
p.opt "migration_dir", "The directory where migrations for databases are read from", type: :string, default: "db/migrate"
|
85
84
|
p.opt "task", "Rake task to execute", short: "t", type: :string
|
86
85
|
p.opt "tasks", "List available Rake tasks", short: "T", type: :flag
|
@@ -130,12 +129,12 @@ module MultiAR
|
|
130
129
|
private
|
131
130
|
|
132
131
|
def init_multi_ar
|
133
|
-
@multi_ar = MultiAR
|
134
|
-
config: @opts["config"],
|
132
|
+
@multi_ar = MultiAR.new config: @opts["config"],
|
135
133
|
databases: @opts["databases"],
|
136
134
|
db_config: @opts["db_config"],
|
137
|
-
environment: @opts["environment"]
|
138
|
-
|
135
|
+
environment: @opts["environment"]
|
136
|
+
|
137
|
+
MultiAR.add_migration_dir @opts["migration_dir"]
|
139
138
|
end
|
140
139
|
|
141
140
|
# @note This method will always quit the application or raise another exception for errors. Catch SystemExit if that’s not good for you.
|
data/lib/multi_ar/version.rb
CHANGED
data/lib/multi_ar.rb
CHANGED
@@ -26,10 +26,10 @@ module MultiAR
|
|
26
26
|
|
27
27
|
# @param databases array of available databases
|
28
28
|
# @todo config file is overriding parameters passed here... I think it should be other way around, but need more custom logic for that :/
|
29
|
-
def initialize databases:, environment: "development", config: "config/multi_ar.yaml", db_config: "config/database.yaml"
|
29
|
+
def initialize databases:, environment: "development", config: "config/multi_ar.yaml", db_config: "config/database.yaml"
|
30
30
|
|
31
31
|
# first load config
|
32
|
-
if File.exist? config
|
32
|
+
if not config.nil? and File.exist? config
|
33
33
|
require "psych"
|
34
34
|
config = Psych.load_file config
|
35
35
|
b = binding
|
@@ -39,7 +39,7 @@ module MultiAR
|
|
39
39
|
end
|
40
40
|
|
41
41
|
# then check that we have data in format we want it to be
|
42
|
-
raise "#{db_config} is not valid path to a file. Try specifying --db-config <path> or configuring it in the configuration file."
|
42
|
+
raise "#{db_config} is not valid path to a file. Try specifying --db-config <path> or configuring it in the configuration file." if db_config.nil? or !File.exist?(db_config)
|
43
43
|
raise "databases is not responding to :each. Try passing passing --databases <database> or configuring it in the configuration file." unless databases.respond_to? :each
|
44
44
|
|
45
45
|
@databases = databases
|
@@ -58,7 +58,6 @@ module MultiAR
|
|
58
58
|
|
59
59
|
Rake::Tasks.databases = databases
|
60
60
|
Rake::Tasks.environment = environment
|
61
|
-
Rake::Tasks.common_migrations = common_migrations
|
62
61
|
Rake::Tasks.define
|
63
62
|
|
64
63
|
MultiAR.app = self
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: multi_ar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samu Voutilainen
|
@@ -168,9 +168,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
168
168
|
version: '0'
|
169
169
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
|
-
- - "
|
171
|
+
- - ">="
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version:
|
173
|
+
version: '0'
|
174
174
|
requirements: []
|
175
175
|
rubyforge_project:
|
176
176
|
rubygems_version: 2.4.8
|
metadata.gz.sig
CHANGED
Binary file
|