schema_dev 0.1.6 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +17 -9
  3. data/bin/schema_dev +18 -11
  4. data/lib/schema_dev/config.rb +4 -8
  5. data/lib/schema_dev/executor.rb +1 -1
  6. data/lib/schema_dev/gemfile_selector.rb +4 -9
  7. data/lib/schema_dev/gemfiles.rb +46 -0
  8. data/lib/schema_dev/matrix_executor.rb +1 -2
  9. data/lib/schema_dev/rspec/db.rb +3 -3
  10. data/lib/schema_dev/rspec.rb +2 -2
  11. data/lib/schema_dev/runner.rb +5 -1
  12. data/lib/schema_dev/travis.rb +10 -5
  13. data/lib/schema_dev/version.rb +1 -1
  14. data/schema_dev.gemspec +1 -0
  15. data/spec/config_spec.rb +1 -11
  16. data/spec/gemfiles_spec.rb +28 -0
  17. data/spec/spec_helper.rb +5 -1
  18. data/spec/travis_spec.rb +46 -0
  19. data/templates/gemfiles/Gemfile.base +4 -0
  20. data/templates/gemfiles/rails-3.2/Gemfile.base +3 -0
  21. data/templates/gemfiles/rails-3.2/Gemfile.mysql +10 -0
  22. data/templates/gemfiles/rails-3.2/Gemfile.mysql2 +10 -0
  23. data/templates/gemfiles/rails-3.2/Gemfile.postgresql +10 -0
  24. data/templates/gemfiles/rails-3.2/Gemfile.sqlite3 +10 -0
  25. data/templates/gemfiles/rails-4.0/Gemfile.base +3 -0
  26. data/templates/gemfiles/rails-4.0/Gemfile.mysql2 +10 -0
  27. data/templates/gemfiles/rails-4.0/Gemfile.postgresql +10 -0
  28. data/templates/gemfiles/rails-4.0/Gemfile.sqlite3 +10 -0
  29. data/templates/gemfiles/rails-4.1/Gemfile.base +3 -0
  30. data/templates/gemfiles/rails-4.1/Gemfile.mysql2 +10 -0
  31. data/templates/gemfiles/rails-4.1/Gemfile.postgresql +10 -0
  32. data/templates/gemfiles/rails-4.1/Gemfile.sqlite3 +10 -0
  33. data/templates/gemfiles/rails-edge/Gemfile.base +3 -0
  34. data/templates/gemfiles/rails-edge/Gemfile.mysql2 +10 -0
  35. data/templates/gemfiles/rails-edge/Gemfile.postgresql +10 -0
  36. data/templates/gemfiles/rails-edge/Gemfile.sqlite3 +10 -0
  37. metadata +39 -3
  38. data/schema_dev.yml +0 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 32da67245032f4e8dda3169be236b050bcbfa230
4
- data.tar.gz: 5c4863f4241688f83166c82d7e3357e06b80f8b6
3
+ metadata.gz: f73255f1d328d7ee245068d7dec68bfa26033a5d
4
+ data.tar.gz: 4af8f98640f02ef2e6f43285012f5f0075510620
5
5
  SHA512:
6
- metadata.gz: ee070648972f48f9ecea215559dd141d81d1d88a5b6b0ff14c29cf27a3bad69e660af2493296c518f5cd50547e207ca072ef3a794fbb3db345f6ecaced996a77
7
- data.tar.gz: 5b6566b814e841dc3e1321c74a05ce77c9df92634cdc5e26c92936d70a97a9232666af72f0fadc72d5d0101681ba53edba95aaad1af852ea75ee8609b67c37b9
6
+ metadata.gz: 573331d9d8303346b607a5e68a7d6d765c446bb2beaa73e617d395250debeae0d4caaafcd4a67db69e2a1dc815af51f5657d0fc21bb70c85f389de4e25785f10
7
+ data.tar.gz: e0612131f0f42fcaf79de5f2e0f4ee1efecb1909987e208c7e947dd281647e2c6e5694bc98a56c73136df330a150c0742f3d0359253955c4a984e61e5ecfcbbb
data/README.md CHANGED
@@ -16,28 +16,36 @@ Include this as a development dependency in the client gem's `<ame>.gemfile`:
16
16
 
17
17
  #### `schema_dev.yml`
18
18
 
19
- The client gem needs a file `schema_dev.yml` in it's root, which specifies the testing matrix, among other things.
19
+ The client gem needs a file `schema_dev.yml` in it's root, which specifies the testing matrix among other things.
20
20
 
21
21
  * `ruby`: A single version of ruby, or a list of ruby versions.
22
22
  * `rails`: A single version of rails, or a list of rails versions
23
- * `db`: (Optional) The list of db adapters to test. Leave this out if the gem will hardwire its tests for a single adapter.
23
+ * `db`: A single db adapter, or a list of db adapters.
24
24
  * `quick`: (Optional) Hash listing the version of ruby, rails, and db to use with `--quick` option. If not specified, the default is to use the last entry in each list.
25
25
 
26
26
  #### Gemfiles
27
27
 
28
- The client gem must organize its Gemfiles along the lines of:
28
+ The client gem must contain a "gemfiles" directory containing the matrix of
29
+ possible gemfiles; Generate it by running
30
+
31
+ $ schema_dev gemfiles
32
+
33
+ This directory should be checked in to the git repo.
34
+
35
+ `schema_dev gemfiles` only generates gemfiles for the versions of rails &
36
+ db listed in `schema_dev.yml`. If you change the listed versions you'll
37
+ need to re-generate.
38
+
39
+ Note that generating the gemfiles blows away any previous files. If you had made
40
+ local changes for some reason, you'll need to rely on git to recover them.
29
41
 
30
- gemfiles/rails-4.0/Gemfile.postgresql # if testing against multiple db adapter
31
-
32
- gemfiles/Gemfile-rails.4.0 # if hardwired to a single db adapter
33
42
 
34
43
  #### Rspec
35
44
 
36
45
  The client gem should include this in its `spec/spec_helper`
37
46
 
38
47
  require 'schema_dev/rspec'
39
- SchemaDev::Rspec.setup_db # if testing against multiple dbs, the db will be filled in automatically
40
- SchemaDev::Rspec.setup_db 'sqlite3' # to hardwire a single database
48
+ SchemaDev::Rspec.setup_db
41
49
 
42
50
  This will take care of connecting to the test database appropriately, and will set up logging to a file specific to the test matrix cell.
43
51
 
@@ -71,7 +79,7 @@ In the root directory, you can run, e.g.,
71
79
  $ schema_dev bundle install
72
80
  $ schema_dev rspec
73
81
 
74
- Which will run those commands over the whole matrix. You can also specify slices, via any combination of `--ruby`, `--rails` and (if the gem tests multiple dbs) `--db`
82
+ Which will run those commands over the whole matrix. You can also specify slices, via any combination of `--ruby`, `--rails` and `--db`
75
83
 
76
84
  $ schema_dev rspec --ruby 2.1.3 --rails 4.0
77
85
 
data/bin/schema_dev CHANGED
@@ -5,46 +5,53 @@ require 'thor'
5
5
  require_relative '../lib/schema_dev/config'
6
6
  require_relative '../lib/schema_dev/runner'
7
7
 
8
- $config = SchemaDev::Config.load
9
- $runner = SchemaDev::Runner.new($config)
8
+ def runner
9
+ $config ||= SchemaDev::Config.load
10
+ $runner ||= SchemaDev::Runner.new($config)
11
+ end
10
12
 
11
13
  class CLI < Thor
12
14
 
13
15
  def self.matrix_options
14
16
  method_option :dry_run, aliases: "-n", type: :boolean, desc: "Show what the commands would be without running them"
15
- method_option :quick, type: :boolean, desc: "Only execute on the 'quick' choice: #{$config.quick.inspect}"
17
+ method_option :quick, type: :boolean, desc: "Only execute on the 'quick' choice: #{$config ? $config.quick.inspect : "[from schema_dev.yml]"}"
16
18
  method_option :ruby, type: :string, desc: "Only execute for the specified version of ruby"
17
19
  method_option :rails, type: :string, desc: "Only execute for the specified version of rails"
18
- method_option :db, type: :string, desc: "Only execute for the specified database" if $config.db?
20
+ method_option :db, type: :string, desc: "Only execute for the specified database"
19
21
  end
20
22
 
21
- desc "update .travis.yml", "create .travis.yml based on schema_dev.yml values"
23
+ desc "travis", "create .travis.yml based on schema_dev.yml values"
22
24
  def travis
23
- $runner.travis
25
+ runner.travis
26
+ end
27
+
28
+ desc "gemfiles", "create gemfiles/* hierarchy based on schema_dev.yml values"
29
+ def gemfiles
30
+ runner.gemfiles
24
31
  end
25
32
 
26
- desc "run command", "run a command over the matrix"
33
+ desc "matrix", "run a command over the matrix"
27
34
  matrix_options
28
35
  def matrix(*args)
29
- $runner.run(args, **options.symbolize_keys)
36
+ runner.run(args, **options.symbolize_keys)
30
37
  end
31
38
 
32
39
  desc "bundle", "shorthand for '#{$0} matrix bundle ...'"
33
40
  matrix_options
34
41
  def bundle(*args)
35
- $runner.run('bundle', args, **options.symbolize_keys)
42
+ runner.run('bundle', args, **options.symbolize_keys)
36
43
  end
37
44
 
38
45
  desc "rake", "shorthand for '#{$0} matrix bundle exec rake ...'"
39
46
  matrix_options
40
47
  def rake(*args)
41
- $runner.run('bundle', 'exec', 'rake', args, **options.symbolize_keys)
48
+ runner.run('bundle', 'exec', 'rake', args, **options.symbolize_keys)
42
49
  end
43
50
 
44
51
  desc "rspec", "shorthand for '#{$0} bundle exec rspec ...'"
45
52
  matrix_options
46
53
  def rspec(*args)
47
- $runner.run('bundle', 'exec', 'rspec', args, **options.symbolize_keys)
54
+ runner.run('bundle', 'exec', 'rspec', args, **options.symbolize_keys)
48
55
  end
49
56
 
50
57
  end
@@ -21,17 +21,13 @@ module SchemaDev
21
21
  end
22
22
 
23
23
  def initialize(opts={}) # once we no longer support ruby 1.9.3, can switch to native keyword args
24
- opts = opts.keyword_args(ruby: :required, rails: :required, db: nil, exclude: nil, notify: nil, quick: nil)
24
+ opts = opts.keyword_args(ruby: :required, rails: :required, db: :required, exclude: nil, notify: nil, quick: nil)
25
25
  @ruby = Array.wrap(opts.ruby)
26
26
  @rails = Array.wrap(opts.rails)
27
27
  @db = Array.wrap(opts.db)
28
28
  @exclude = Array.wrap(opts.exclude).map(&:symbolize_keys).map {|tuple| Tuple.new(tuple)}
29
29
  @notify = Array.wrap(opts.notify)
30
- @quick = Array.wrap(opts.quick || {ruby: @ruby.last, rails: @rails.last, db: @db.andand.last})
31
- end
32
-
33
- def db?
34
- @db.any?
30
+ @quick = Array.wrap(opts.quick || {ruby: @ruby.last, rails: @rails.last, db: @db.last})
35
31
  end
36
32
 
37
33
  def dbms
@@ -54,9 +50,9 @@ module SchemaDev
54
50
 
55
51
  use_ruby = [nil] unless use_ruby.any?
56
52
  use_rails = [nil] unless use_rails.any?
53
+ use_db = [nil] unless use_db.any?
57
54
 
58
- m = use_ruby.product(use_rails)
59
- m = m.product(use_db).map(&:flatten) if use_db.any?
55
+ m = use_ruby.product(use_rails, use_db)
60
56
  m = m.map { |_ruby, _rails, _db| Tuple.new(ruby: _ruby, rails: _rails, db: _db) }.compact
61
57
  m = m.reject(&it.match_any?(@exclude)) unless opts.excluded == :none
62
58
  m = m.map(&:to_hash)
@@ -7,7 +7,7 @@ module SchemaDev
7
7
 
8
8
  attr_reader :ruby, :rails, :db, :error
9
9
 
10
- def initialize(ruby:, rails:, db: nil)
10
+ def initialize(ruby:, rails:, db:)
11
11
  @ruby_selector = RubySelector.command(ruby)
12
12
  @gemfile_selector = GemfileSelector.command(rails: rails, db: db)
13
13
  end
@@ -7,23 +7,18 @@ module SchemaDev
7
7
  extend self
8
8
 
9
9
  def gemfile(opts = {})
10
- opts = opts.keyword_args(rails: :required, db: nil)
11
- root = Pathname.new(GEMFILES_DIR)
12
- if opts.db
13
- root.join("rails-#{opts.rails}", "Gemfile.#{opts.db}")
14
- else
15
- root.join("Gemfile.rails-#{opts.rails}")
16
- end
10
+ opts = opts.keyword_args(rails: :required, db: :required)
11
+ Pathname.new(GEMFILES_DIR).join("rails-#{opts.rails}", "Gemfile.#{opts.db}")
17
12
  end
18
13
 
19
14
  def command(opts={})
20
- opts = opts.keyword_args(rails: :required, db: nil)
15
+ opts = opts.keyword_args(rails: :required, db: :required)
21
16
  "BUNDLE_GEMFILE=#{gemfile(rails: opts.rails, db: opts.db)}"
22
17
  end
23
18
 
24
19
  def infer_db
25
20
  (env = ENV['BUNDLE_GEMFILE']) =~ %r{rails.*/Gemfile[.](.*)}
26
- $1 or raise "Can't infer db: Env BUNDLE_GEMFILE=#{env.inspect}) isn't a schema_dev Gemfile path with db"
21
+ $1 or raise "Can't infer db: Env BUNDLE_GEMFILE=#{env.inspect}) isn't a schema_dev standard Gemfile path"
27
22
  end
28
23
  end
29
24
  end
@@ -0,0 +1,46 @@
1
+ require 'pathname'
2
+
3
+ module SchemaDev
4
+
5
+ module Gemfiles
6
+ extend self
7
+
8
+ TEMPLATES_ROOT = Pathname.new(__FILE__).dirname.parent.parent + "templates"
9
+
10
+ def build(config)
11
+ @src_root = TEMPLATES_ROOT
12
+ @dst_root = Pathname.new('.')
13
+
14
+ path = Pathname.new("gemfiles")
15
+
16
+ _blow_away(path)
17
+
18
+ _copy(path, 'Gemfile.base')
19
+
20
+ config.rails.each do |rails|
21
+
22
+ rails_path = path + "rails-#{rails}"
23
+ _copy(rails_path, 'Gemfile.base')
24
+
25
+ config.db.each do |db|
26
+ _copy(rails_path, "Gemfile.#{db}")
27
+ end
28
+ end
29
+ return true
30
+ end
31
+
32
+ def _copy(path, filename)
33
+ srcfile = @src_root + path + filename
34
+ dstfile = @dst_root + path + filename
35
+ return unless srcfile.exist?
36
+
37
+ dstfile.dirname.mkpath
38
+ FileUtils.copy_file(srcfile, dstfile)
39
+ end
40
+
41
+ def _blow_away(path)
42
+ (@dst_root + path).rmtree
43
+ rescue Errno::ENOENT
44
+ end
45
+ end
46
+ end
@@ -15,8 +15,7 @@ module SchemaDev
15
15
  rails = tuple[:rails]
16
16
  db = tuple[:db]
17
17
 
18
- label = "ruby #{ruby} - rails #{rails}"
19
- label += " - db #{db}" if db
18
+ label = "ruby #{ruby} - rails #{rails} = db #{db}"
20
19
  msg = "#{label} [#{i+1} of #{@matrix.size}]"
21
20
  puts "\n\n*** #{msg}\n\n"
22
21
 
@@ -7,8 +7,8 @@ module SchemaDev
7
7
  module Db
8
8
  extend self
9
9
 
10
- def setup(_db = nil)
11
- @db = _db || GemfileSelector.infer_db
10
+ def setup
11
+ @db = GemfileSelector.infer_db
12
12
  set_logger
13
13
  connect
14
14
  RSpec.configure do |config|
@@ -19,7 +19,7 @@ module SchemaDev
19
19
  config.filter_run_excluding :mysql => :skip if Helpers.mysql?
20
20
  config.filter_run_excluding :sqlite3 => :only unless Helpers.sqlite3?
21
21
  config.filter_run_excluding :sqlite3 => :skip if Helpers.sqlite3?
22
- end unless _db
22
+ end
23
23
  end
24
24
 
25
25
  def tmproot
@@ -3,8 +3,8 @@ require_relative 'rspec/db'
3
3
  module SchemaDev
4
4
  module Rspec
5
5
 
6
- def self.setup_db(db=nil)
7
- Db.setup(db)
6
+ def self.setup_db
7
+ Db.setup
8
8
  end
9
9
 
10
10
  def self.db_configuration
@@ -10,7 +10,11 @@ module SchemaDev
10
10
  end
11
11
 
12
12
  def travis
13
- Travis.update(@config)
13
+ Travis.update(@config) and puts "* Updated #{filepath}"
14
+ end
15
+
16
+ def gemfiles
17
+ Gemfiles.build(@config) and puts "* Created gemfiles"
14
18
  end
15
19
 
16
20
  def run(*args, dry_run: false, quick: false, ruby: nil, rails: nil, db: nil, freshen: true)
@@ -1,14 +1,19 @@
1
1
  require 'pathname'
2
2
  require 'yaml'
3
3
 
4
- module SchemaDev
5
- TRAVIS_FILE = ".travis.yml"
4
+ require_relative 'gemfile_selector'
6
5
 
6
+ module SchemaDev
7
7
  module Travis
8
8
  extend self
9
9
 
10
+ TRAVIS_FILE = ".travis.yml"
11
+
10
12
  def build(config)
11
- env = 'POSTGRESQL_DB_USER=postgres MYSQL_DB_USER="travis"'
13
+ env = []
14
+ env << 'POSTGRESQL_DB_USER=postgres' if config.dbms.include? :postgresql
15
+ env << 'MYSQL_DB_USER=travis' if config.dbms.include? :mysql
16
+ env = env.join(' ')
12
17
  gemfiles = config.matrix.map{|entry| GemfileSelector.gemfile(entry.slice(:rails, :db)).to_s}.uniq
13
18
  exclude = config.matrix(excluded: :only).map { |entry| {}.tap {|ex|
14
19
  ex["rvm"] = entry[:ruby]
@@ -36,12 +41,12 @@ module SchemaDev
36
41
  if oldtravis != newtravis
37
42
  header = <<-ENDYAML
38
43
  # This file was auto-generated by the schema_dev tool, based on the data in
39
- # ./schema_dev.yml
44
+ # ./schema_dev.yml
40
45
  # Please do not edit this file; any changes will be overwritten next time
41
46
  # schema_dev gets run.
42
47
  ENDYAML
43
48
  filepath.write header + newtravis.to_yaml
44
- puts "* Updated #{filepath}"
49
+ return true
45
50
  end
46
51
  end
47
52
  end
@@ -1,3 +1,3 @@
1
1
  module SchemaDev
2
- VERSION = "0.1.6"
2
+ VERSION = "1.0.0"
3
3
  end
data/schema_dev.gemspec CHANGED
@@ -28,4 +28,5 @@ Gem::Specification.new do |spec|
28
28
  spec.add_development_dependency "bundler", "~> 1.7"
29
29
  spec.add_development_dependency "rake", "~> 10.0"
30
30
  spec.add_development_dependency "rspec", "~> 3.0"
31
+ spec.add_development_dependency "simplecov"
31
32
  end
data/spec/config_spec.rb CHANGED
@@ -1,16 +1,6 @@
1
1
  describe SchemaDev::Config do
2
2
 
3
- it "computes matrix without db" do
4
- config = get_config(ruby: %W[1.9.3 2.1.5], rails: %W[4.0 4.1])
5
- expect(config.matrix).to match_array [
6
- { ruby: "1.9.3", rails: "4.0" },
7
- { ruby: "1.9.3", rails: "4.1" },
8
- { ruby: "2.1.5", rails: "4.0" },
9
- { ruby: "2.1.5", rails: "4.1" },
10
- ]
11
- end
12
-
13
- it "computes matrix with db" do
3
+ it "computes matrix" do
14
4
  config = get_config(ruby: %W[1.9.3 2.1.5], rails: %W[4.0 4.1], db: %W[sqlite3 postgresql])
15
5
  expect(config.matrix).to match_array [
16
6
  { ruby: "1.9.3", rails: "4.0", db: "sqlite3" },
@@ -0,0 +1,28 @@
1
+ require 'schema_dev/gemfiles'
2
+
3
+ describe SchemaDev::Gemfiles do
4
+
5
+ it "copies listed files" do
6
+ config = get_config(ruby: %W[1.9.3 2.1.5], rails: %W[4.0 4.1], db: %W[sqlite3 postgresql])
7
+ Dir.mktmpdir do |dir|
8
+ Dir.chdir(dir) do
9
+ SchemaDev::Gemfiles.build(config)
10
+ expect(relevant_diff(config, "gemfiles")).to be_empty
11
+ end
12
+ end
13
+ end
14
+
15
+ def relevant_diff(config, dir)
16
+ src = SchemaDev::Gemfiles::TEMPLATES_ROOT + dir
17
+ diff = `diff -rq #{src} #{dir} 2>&1`.split("\n")
18
+
19
+ # expect copy not to have entry for rails not in config
20
+ diff.reject!{ |d| d =~ %r[Only in #{src}: rails-(.*)] and not config.rails.include? $1 }
21
+
22
+ # expect copy not to have entry for db not in config
23
+ diff.reject!{ |d| d =~ %r[Only in #{src}.*: Gemfile.(.*)] and not config.db.include? $1 }
24
+ end
25
+
26
+ end
27
+
28
+
data/spec/spec_helper.rb CHANGED
@@ -1,6 +1,10 @@
1
- require 'schema_dev/config'
1
+ require 'simplecov'
2
+ SimpleCov.start
3
+
2
4
  require 'tmpdir'
3
5
 
6
+ require 'schema_dev/config'
7
+
4
8
  def get_config(data)
5
9
  SchemaDev::Config._reset
6
10
  Dir.mktmpdir do |dir|
@@ -0,0 +1,46 @@
1
+ require 'schema_dev/travis'
2
+
3
+ describe SchemaDev::Travis do
4
+
5
+ it "creates travis file" do
6
+ config = get_config(ruby: %W[1.9.3 2.1.5],
7
+ rails: %W[4.0 4.1],
8
+ db: %W[sqlite3 postgresql],
9
+ exclude: { ruby: "1.9.3", db: "postgresql" },
10
+ notify: 'me@example.com')
11
+ Dir.mktmpdir do |dir|
12
+ Dir.chdir(dir) do
13
+ SchemaDev::Travis.update(config)
14
+ expect(Pathname.new(".travis.yml").read).to eq <<ENDTRAVIS
15
+ # This file was auto-generated by the schema_dev tool, based on the data in
16
+ # ./schema_dev.yml
17
+ # Please do not edit this file; any changes will be overwritten next time
18
+ # schema_dev gets run.
19
+ ---
20
+ rvm:
21
+ - 1.9.3
22
+ - 2.1.5
23
+ gemfile:
24
+ - gemfiles/rails-4.0/Gemfile.postgresql
25
+ - gemfiles/rails-4.0/Gemfile.sqlite3
26
+ - gemfiles/rails-4.1/Gemfile.postgresql
27
+ - gemfiles/rails-4.1/Gemfile.sqlite3
28
+ before_script: bundle exec rake create_databases
29
+ after_script: bundle exec rake drop_databases
30
+ env: POSTGRESQL_DB_USER=postgres
31
+ notifications:
32
+ email:
33
+ - me@example.com
34
+ matrix:
35
+ exclude:
36
+ - rvm: 1.9.3
37
+ gemfile: gemfiles/rails-4.0/Gemfile.postgresql
38
+ env: POSTGRESQL_DB_USER=postgres
39
+ - rvm: 1.9.3
40
+ gemfile: gemfiles/rails-4.1/Gemfile.postgresql
41
+ env: POSTGRESQL_DB_USER=postgres
42
+ ENDTRAVIS
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+ gemspec :path => File.expand_path('..', __FILE__)
3
+
4
+ gem "byebug" if RUBY_VERSION > "2"
@@ -0,0 +1,3 @@
1
+ eval File.read File.expand_path('../../Gemfile.base', __FILE__)
2
+
3
+ gem "rails", "~> 3.2.0"
@@ -0,0 +1,10 @@
1
+ require "pathname"
2
+ eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
+
4
+ platform :ruby do
5
+ gem "mysql", "~> 2.8.1"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcmysql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ require "pathname"
2
+ eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
+
4
+ platform :ruby do
5
+ gem "mysql2"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcmysql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ require "pathname"
2
+ eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
+
4
+ platform :ruby do
5
+ gem "pg"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcpostgresql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ require "pathname"
2
+ eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
+
4
+ platform :ruby do
5
+ gem "sqlite3"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcsqlite3-adapter', '>=1.3.0.beta2'
10
+ end
@@ -0,0 +1,3 @@
1
+ eval File.read File.expand_path('../../Gemfile.base', __FILE__)
2
+
3
+ gem "rails", "~> 4.0.0"
@@ -0,0 +1,10 @@
1
+ require "pathname"
2
+ eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
+
4
+ platform :ruby do
5
+ gem "mysql2"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcmysql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ require "pathname"
2
+ eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
+
4
+ platform :ruby do
5
+ gem "pg"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcpostgresql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ require "pathname"
2
+ eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
+
4
+ platform :ruby do
5
+ gem "sqlite3"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcsqlite3-adapter', '>=1.3.0.beta2'
10
+ end
@@ -0,0 +1,3 @@
1
+ eval File.read File.expand_path('../../Gemfile.base', __FILE__)
2
+
3
+ gem "rails", "~> 4.1.0"
@@ -0,0 +1,10 @@
1
+ require "pathname"
2
+ eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
+
4
+ platform :ruby do
5
+ gem "mysql2"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcmysql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ require "pathname"
2
+ eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
+
4
+ platform :ruby do
5
+ gem "pg"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcpostgresql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ require "pathname"
2
+ eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
+
4
+ platform :ruby do
5
+ gem "sqlite3"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcsqlite3-adapter', '>=1.3.0.beta2'
10
+ end
@@ -0,0 +1,3 @@
1
+ eval File.read File.expand_path('../../Gemfile.base', __FILE__)
2
+
3
+ gem "rails", "~> 4.0.0"
@@ -0,0 +1,10 @@
1
+ require "pathname"
2
+ eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
+
4
+ platform :ruby do
5
+ gem "mysql2"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcmysql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ require "pathname"
2
+ eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
+
4
+ platform :ruby do
5
+ gem "pg"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcpostgresql-adapter'
10
+ end
@@ -0,0 +1,10 @@
1
+ require "pathname"
2
+ eval(Pathname.new(__FILE__).dirname.join("Gemfile.base").read, binding)
3
+
4
+ platform :ruby do
5
+ gem "sqlite3"
6
+ end
7
+
8
+ platform :jruby do
9
+ gem 'activerecord-jdbcsqlite3-adapter', '>=1.3.0.beta2'
10
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schema_dev
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ronen barzel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-04 00:00:00.000000000 Z
11
+ date: 2014-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -136,6 +136,20 @@ dependencies:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: '3.0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: simplecov
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
139
153
  description: SchemaPlus development tools
140
154
  email:
141
155
  - ronen@barzel.org
@@ -155,6 +169,7 @@ files:
155
169
  - lib/schema_dev/config.rb
156
170
  - lib/schema_dev/executor.rb
157
171
  - lib/schema_dev/gemfile_selector.rb
172
+ - lib/schema_dev/gemfiles.rb
158
173
  - lib/schema_dev/matrix_executor.rb
159
174
  - lib/schema_dev/rspec.rb
160
175
  - lib/schema_dev/rspec/db.rb
@@ -164,9 +179,28 @@ files:
164
179
  - lib/schema_dev/travis.rb
165
180
  - lib/schema_dev/version.rb
166
181
  - schema_dev.gemspec
167
- - schema_dev.yml
168
182
  - spec/config_spec.rb
183
+ - spec/gemfiles_spec.rb
169
184
  - spec/spec_helper.rb
185
+ - spec/travis_spec.rb
186
+ - templates/gemfiles/Gemfile.base
187
+ - templates/gemfiles/rails-3.2/Gemfile.base
188
+ - templates/gemfiles/rails-3.2/Gemfile.mysql
189
+ - templates/gemfiles/rails-3.2/Gemfile.mysql2
190
+ - templates/gemfiles/rails-3.2/Gemfile.postgresql
191
+ - templates/gemfiles/rails-3.2/Gemfile.sqlite3
192
+ - templates/gemfiles/rails-4.0/Gemfile.base
193
+ - templates/gemfiles/rails-4.0/Gemfile.mysql2
194
+ - templates/gemfiles/rails-4.0/Gemfile.postgresql
195
+ - templates/gemfiles/rails-4.0/Gemfile.sqlite3
196
+ - templates/gemfiles/rails-4.1/Gemfile.base
197
+ - templates/gemfiles/rails-4.1/Gemfile.mysql2
198
+ - templates/gemfiles/rails-4.1/Gemfile.postgresql
199
+ - templates/gemfiles/rails-4.1/Gemfile.sqlite3
200
+ - templates/gemfiles/rails-edge/Gemfile.base
201
+ - templates/gemfiles/rails-edge/Gemfile.mysql2
202
+ - templates/gemfiles/rails-edge/Gemfile.postgresql
203
+ - templates/gemfiles/rails-edge/Gemfile.sqlite3
170
204
  homepage: https://github.com/SchemaPlus/schema_dev
171
205
  licenses:
172
206
  - MIT
@@ -193,4 +227,6 @@ specification_version: 4
193
227
  summary: SchemaPlus development tools
194
228
  test_files:
195
229
  - spec/config_spec.rb
230
+ - spec/gemfiles_spec.rb
196
231
  - spec/spec_helper.rb
232
+ - spec/travis_spec.rb
data/schema_dev.yml DELETED
@@ -1,6 +0,0 @@
1
- # this is just here for testing
2
- ruby:
3
- - 1.9.3
4
- - 2.1.5
5
- rails: 4.0
6
- db: postgresql