schema_dev 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/schema_dev/config.rb +1 -1
- data/lib/schema_dev/executor.rb +1 -2
- data/lib/schema_dev/rspec.rb +4 -5
- data/lib/schema_dev/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c32b4433dff41c2e186f67afeea7832d9b8e59cc
|
4
|
+
data.tar.gz: 1bb87a41478f63595085f23b367d781c9b744148
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7a4ac77566a81a6be11150131d690fb969a01d46de3734b405f6122875237050cf7a846ece054ec1e1cd6dfc5a3aaf80916195a18a26f6ede1592372b0eec44
|
7
|
+
data.tar.gz: 571e92e81b3e2ae53d5d691e865e6fb5d296acc742a3d6664efee7e6f052d2bbf88f0ab776719f61863782168d91b71a77efb587ec5d61ff44cec99880c8fab7
|
data/lib/schema_dev/config.rb
CHANGED
@@ -63,7 +63,7 @@ module SchemaDev
|
|
63
63
|
@matrix ||= begin
|
64
64
|
m = use_ruby.product(use_rails)
|
65
65
|
m = m.product(use_db).map(&:flatten) if db?
|
66
|
-
m = m.map { |
|
66
|
+
m = m.map { |_ruby, _rails, _db| Tuple.new(ruby: _ruby, rails: _rails, db: _db) }
|
67
67
|
m.reject(&it.match_any?(@exclude)).map(&:to_hash)
|
68
68
|
end
|
69
69
|
end
|
data/lib/schema_dev/executor.rb
CHANGED
@@ -10,8 +10,7 @@ module SchemaDev
|
|
10
10
|
def initialize(ruby:, rails:, db: nil)
|
11
11
|
@ruby_selector = RubySelector.command(ruby)
|
12
12
|
@gemfile_selector = GemfileSelector.command(rails: rails, db: db)
|
13
|
-
|
14
|
-
@dev_env = "SCHEMA_DEV_ENV='#{env.to_json}'"
|
13
|
+
@dev_env = "SCHEMA_DEV_DB=#{db.inspect}"
|
15
14
|
end
|
16
15
|
|
17
16
|
def run(cmd, dry_run: false)
|
data/lib/schema_dev/rspec.rb
CHANGED
@@ -5,10 +5,9 @@ module SchemaDev
|
|
5
5
|
module Rspec
|
6
6
|
|
7
7
|
def self.db_connect
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
rails = env['rails']
|
8
|
+
db = ENV['SCHEMA_DEV_DB']
|
9
|
+
ruby = "#{RUBY_ENGINE}-#{RUBY_VERSION}"
|
10
|
+
rails = "rails-#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}"
|
12
11
|
root = Pathname.new('tmp')
|
13
12
|
root.mkpath
|
14
13
|
configuration = case db
|
@@ -44,7 +43,7 @@ module SchemaDev
|
|
44
43
|
raise "Unknown db adapter #{db.inspect}"
|
45
44
|
end
|
46
45
|
|
47
|
-
ActiveRecord::Base.logger = Logger.new(root.join("
|
46
|
+
ActiveRecord::Base.logger = Logger.new(root.join("#{ruby}.#{rails}.#{db}.log").open("w"))
|
48
47
|
ActiveRecord::Base.configurations = { 'schema_dev' => configuration }
|
49
48
|
ActiveRecord::Base.establish_connection :schema_dev
|
50
49
|
|
data/lib/schema_dev/version.rb
CHANGED