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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d54d942aefe519b7959ea7d8207c03b304c437f2
4
- data.tar.gz: abf83b48064b3e378000ff19b05642c7986919ee
3
+ metadata.gz: 3754772cf591a147943b8cfb7b83c85254872110
4
+ data.tar.gz: 620350cf731cc914a5620248dbe1d632406bd34b
5
5
  SHA512:
6
- metadata.gz: 7d4b9241137a3c3bc78f0b9c0c8b04fa13701ef08250596c5fb1b54a95063049fa950c17298ecc64f92afc81bdef7fcbe9a69108b1dac8b0f7986404b500b756
7
- data.tar.gz: ea38c3fb2c44b79041ff14e94988e1c7494a57091a7f5bf3fbedf74ebd9ae62dffbe975b8e5ccee222d11a301ce05df973fbfbdfe679d937dc6cd7423e0617c5
6
+ metadata.gz: 5af7a1f88b87c54891429d9f47cff6a4c198c5c50f85c7a47cae606417080fd1f5dc78adafd37ef3fe4515aa035657f5895c5e92fa6f59178f1986d18b327898
7
+ data.tar.gz: f89187f075e2ad595d6d6ea60e12c98888ef0119ef6481427d100998e5a7635ad706a29b54616f9415bee763715498ed448f6ab7053640d944c94709e2bf3d31
checksums.yaml.gz.sig CHANGED
Binary file
@@ -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::MultiAR.new common_migrations: @opts["common_migrations"],
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
- migration_dir: @opts["migration_dir"]
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.
@@ -1,4 +1,4 @@
1
1
 
2
2
  module MultiAR
3
- VERSION = "1.0.0-rc2"
3
+ VERSION = "1.0.0"
4
4
  end
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", common_migrations: true
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." unless File.exist?(db_config)
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.pre.rc2
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: 1.3.1
173
+ version: '0'
174
174
  requirements: []
175
175
  rubyforge_project:
176
176
  rubygems_version: 2.4.8
metadata.gz.sig CHANGED
Binary file