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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 60f8ddd141dfc2a080c30d785cd4a3f20c66a024
4
- data.tar.gz: c9d1b2654eafbf15942f26ee03447285d0f5e419
3
+ metadata.gz: c32b4433dff41c2e186f67afeea7832d9b8e59cc
4
+ data.tar.gz: 1bb87a41478f63595085f23b367d781c9b744148
5
5
  SHA512:
6
- metadata.gz: 274c4a4cde762e87d6582be216a02726307224b2b8b6bd9b24b99c15cb760386790a693e051ab658bb0ad5b72c0b994c26dc271ecfbd19b1ee37a37a0aa2ff2b
7
- data.tar.gz: e502cd474e4fede9041ec3d0273f78903f20ec8f1a2fe1c931bb49ceb9a2d1996974d6b055a50bee6a379904da88669c113ca4868165252b4bbd7cab61ae1740
6
+ metadata.gz: c7a4ac77566a81a6be11150131d690fb969a01d46de3734b405f6122875237050cf7a846ece054ec1e1cd6dfc5a3aaf80916195a18a26f6ede1592372b0eec44
7
+ data.tar.gz: 571e92e81b3e2ae53d5d691e865e6fb5d296acc742a3d6664efee7e6f052d2bbf88f0ab776719f61863782168d91b71a77efb587ec5d61ff44cec99880c8fab7
@@ -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 { |ruby, rails, db| Tuple.new(ruby: ruby, rails: rails, db: db) }
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
@@ -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
- env = {ruby: ruby, rails: rails, db: db}.reject{|k,val| val.nil?}
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)
@@ -5,10 +5,9 @@ module SchemaDev
5
5
  module Rspec
6
6
 
7
7
  def self.db_connect
8
- env = JSON.parse(ENV['SCHEMA_DEV_ENV'])
9
- db = env['db']
10
- ruby = env['ruby']
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("ruby-#{ruby}.rails-#{rails}.#{db}.log").open("w"))
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
 
@@ -1,3 +1,3 @@
1
1
  module SchemaDev
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schema_dev
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ronen barzel