schema_dev 2.0.4 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -8
  3. data/bin/schema_dev +1 -4
  4. data/lib/schema_dev/config.rb +13 -13
  5. data/lib/schema_dev/executor.rb +3 -3
  6. data/lib/schema_dev/gemfile_selector.rb +6 -6
  7. data/lib/schema_dev/gemfiles.rb +4 -4
  8. data/lib/schema_dev/matrix_executor.rb +3 -3
  9. data/lib/schema_dev/readme.rb +2 -2
  10. data/lib/schema_dev/rspec/db.rb +6 -2
  11. data/lib/schema_dev/runner.rb +2 -2
  12. data/lib/schema_dev/travis.rb +2 -2
  13. data/lib/schema_dev/version.rb +1 -1
  14. data/spec/config_spec.rb +32 -32
  15. data/spec/gemfile_sepector_spec.rb +1 -1
  16. data/spec/gemfiles_spec.rb +4 -4
  17. data/spec/runner_spec.rb +11 -11
  18. data/spec/travis_spec.rb +7 -7
  19. data/templates/gem/README.md +1 -1
  20. data/templates/gem/schema_dev.yml +1 -1
  21. data/templates/gemfiles/{rails-3.2 → activerecord-3.2}/Gemfile.base +1 -1
  22. data/templates/gemfiles/{rails-3.2 → activerecord-3.2}/Gemfile.mysql +0 -0
  23. data/templates/gemfiles/{rails-3.2 → activerecord-3.2}/Gemfile.mysql2 +0 -0
  24. data/templates/gemfiles/{rails-3.2 → activerecord-3.2}/Gemfile.postgresql +0 -0
  25. data/templates/gemfiles/{rails-3.2 → activerecord-3.2}/Gemfile.sqlite3 +0 -0
  26. data/templates/gemfiles/{rails-4.0 → activerecord-4.0}/Gemfile.base +1 -1
  27. data/templates/gemfiles/{rails-4.0 → activerecord-4.0}/Gemfile.mysql2 +0 -0
  28. data/templates/gemfiles/{rails-4.0 → activerecord-4.0}/Gemfile.postgresql +0 -0
  29. data/templates/gemfiles/{rails-4.0 → activerecord-4.0}/Gemfile.sqlite3 +0 -0
  30. data/templates/gemfiles/{rails-4.1 → activerecord-4.1}/Gemfile.base +1 -1
  31. data/templates/gemfiles/{rails-4.1 → activerecord-4.1}/Gemfile.mysql2 +0 -0
  32. data/templates/gemfiles/{rails-4.1 → activerecord-4.1}/Gemfile.postgresql +0 -0
  33. data/templates/gemfiles/{rails-4.1 → activerecord-4.1}/Gemfile.sqlite3 +0 -0
  34. data/templates/gemfiles/{rails-4.2 → activerecord-4.2}/Gemfile.base +1 -1
  35. data/templates/gemfiles/{rails-4.2 → activerecord-4.2}/Gemfile.mysql2 +0 -0
  36. data/templates/gemfiles/{rails-4.2 → activerecord-4.2}/Gemfile.postgresql +0 -0
  37. data/templates/gemfiles/{rails-4.2 → activerecord-4.2}/Gemfile.sqlite3 +0 -0
  38. data/templates/gemfiles/activerecord-edge/Gemfile.base +3 -0
  39. data/templates/gemfiles/{rails-edge → activerecord-edge}/Gemfile.mysql2 +0 -0
  40. data/templates/gemfiles/{rails-edge → activerecord-edge}/Gemfile.postgresql +0 -0
  41. data/templates/gemfiles/{rails-edge → activerecord-edge}/Gemfile.sqlite3 +0 -0
  42. metadata +23 -23
  43. data/templates/gemfiles/rails-edge/Gemfile.base +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8f65f2737e8dd3ad7d448a9b25d11a647c63d165
4
- data.tar.gz: 5dcd3fd57461dbe65856e124f701b7e8a00e3e0c
3
+ metadata.gz: d4cb75b3a5a0fde6048fbf09539056ab9be8bbd5
4
+ data.tar.gz: c710664f19c291598f88ead2ed83eadcc44cd964
5
5
  SHA512:
6
- metadata.gz: 2ebea918d37f256c76ef1f6223dacad9f1deb80bbfa1d5e18695980bd2fce69f7d8a995518988b335b49ddafe683e998c1a888eede4bb5b014dc63d85cd5136c
7
- data.tar.gz: ce1fcf40f94ad3338947b73f81885635980172af34121d5b1d4ad68d9b266af7bba84a198d7c9df492f131ceede47130e54831ba084dc649426b569be9318866
6
+ metadata.gz: 3d3337897220b5917a33fe4106c990630a620801838efe3cc3644fc3ad7d3254de11bca3db6ed2b117de2d25bb590ee06a1edaf7e2111cd00703e795d9103fa2
7
+ data.tar.gz: e5dfbf9698aa68e9e7cba1e7c29364f81267fac4aed58315a9d4670c953797b17ab09684a60955b48bc11b0c3d75cad6d158a9d32f04d2a6d737a0ee510c41ab
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  Development tools for the SchemaPlus family of gems.
8
8
 
9
- Provides support for working with multiple ruby versions, rails adapaters, and db versions. In particular provides a command `schema_dev` for running rspec (or whatever) on the matrix or a slice or element of it. It also auto-generates the `.travis.yml` file for [travis-ci](https://travis-ci.org) testing.
9
+ Provides support for working with multiple ruby versions, ActiveRecord, and db versions. In particular provides a command `schema_dev` for running rspec (or whatever) on the matrix or a slice or element of it. It also auto-generates the `.travis.yml` file for [travis-ci](https://travis-ci.org) testing.
10
10
 
11
11
  ## Creating a new gem for the SchemaPlus family
12
12
 
@@ -25,9 +25,9 @@ Similar to `bundle gem`, this creates a skeleton structure for a new gem. The s
25
25
  The client gem needs a file `schema_dev.yml` in it's root, which specifies the testing matrix among other things.
26
26
 
27
27
  * `ruby`: A single version of ruby, or a list of ruby versions.
28
- * `rails`: A single version of rails, or a list of rails versions
28
+ * `activerecord`: A single version of ActiveRecord, or a list of ActiveRecord versions
29
29
  * `db`: A single db adapter, or a list of db adapters.
30
- * `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.
30
+ * `quick`: (Optional) Hash listing the version of ruby, activerecord, and db to use with `--quick` option. If not specified, the default is to use the last entry in each list.
31
31
 
32
32
  If you change this file, it's a good idea to run `schema_dev freshen`
33
33
 
@@ -55,9 +55,9 @@ In the root directory, you can run, e.g.,
55
55
  $ schema_dev bundle install # or schema_dev bundle update
56
56
  $ schema_dev rspec
57
57
 
58
- Which will run those commands over the whole matrix. You can also specify slices, via any combination of `--ruby`, `--rails` and `--db`
58
+ Which will run those commands over the whole matrix. You can also specify slices, via any combination of `--ruby`, `--activerecord` and `--db`
59
59
 
60
- $ schema_dev rspec --ruby 2.1.3 --rails 4.0
60
+ $ schema_dev rspec --ruby 2.1.3 --activerecord 4.0
61
61
 
62
62
  For convenience you can also use `--quick` to run just one as specified in `schema_dev.yml`
63
63
 
@@ -69,14 +69,14 @@ For interactive debugging you may want to run rspec directly from the shell rath
69
69
 
70
70
  $ schema_dev rspec --quick -- -e 'select which spec' -n
71
71
 
72
- *** ruby 2.1.5 - rails 4.2 - db postgresql [1 of 1]
72
+ *** ruby 2.1.5 - activerecord 4.2 - db postgresql [1 of 1]
73
73
 
74
- * /usr/bin/env BUNDLE_GEMFILE=gemfiles/rails-4.2/Gemfile.postgresql SHELL=`which bash` chruby-exec ruby-2.1.5 -- bundle exec rspec -e select\ which\ spec
74
+ * /usr/bin/env BUNDLE_GEMFILE=gemfiles/activerecord-4.2/Gemfile.postgresql SHELL=`which bash` chruby-exec ruby-2.1.5 -- bundle exec rspec -e select\ which\ spec
75
75
 
76
76
 
77
77
  There's no hidden environment setup; so you can copy and paste the command line into a shell:
78
78
 
79
- $ /usr/bin/env BUNDLE_GEMFILE=gemfiles/rails-4.2/Gemfile.postgresql SHELL=`which bash` chruby-exec ruby-2.1.5 -- bundle exec rspec -e select\ which\ spec
79
+ $ /usr/bin/env BUNDLE_GEMFILE=gemfiles/activerecord-4.2/Gemfile.postgresql SHELL=`which bash` chruby-exec ruby-2.1.5 -- bundle exec rspec -e select\ which\ spec
80
80
 
81
81
 
82
82
  For more info, see
data/bin/schema_dev CHANGED
@@ -20,12 +20,10 @@ class CLI < Thor
20
20
  method_option :dry_run, aliases: "-n", type: :boolean, desc: "Show what the commands would be without running them"
21
21
  method_option :quick, type: :boolean, desc: "Only execute on the 'quick' choice: #{$config ? $config.quick.inspect : "[from schema_dev.yml]"}"
22
22
  method_option :ruby, type: :string, desc: "Only execute for the specified version of ruby"
23
- method_option :rails, type: :string, desc: "Only execute for the specified version of rails"
23
+ method_option :activerecord, aliases: "--ar", type: :string, desc: "Only execute for the specified version of activerecord"
24
24
  method_option :db, type: :string, desc: "Only execute for the specified database"
25
25
  end
26
26
 
27
- default_task :rspec
28
-
29
27
  desc "freshen", "update files that depend on schema_dev.yml: .travis, gemfiles/, README.md"
30
28
  def freshen
31
29
  runner.freshen
@@ -63,7 +61,6 @@ class CLI < Thor
63
61
  end
64
62
 
65
63
  case
66
- when ARGV.empty? then CLI.start(["--help"])
67
64
  when ARGV[0] == "--version" then puts "SchemaDev #{SchemaDev::VERSION}"
68
65
  else CLI.start(ARGV)
69
66
  end
@@ -12,7 +12,7 @@ module SchemaDev
12
12
 
13
13
  class Config
14
14
 
15
- attr_accessor :quick, :db, :ruby, :rails, :notify, :exclude
15
+ attr_accessor :quick, :db, :ruby, :activerecord, :notify, :exclude
16
16
 
17
17
  def self._reset ; @@config = nil end # for use by rspec
18
18
 
@@ -25,13 +25,13 @@ module SchemaDev
25
25
  end
26
26
 
27
27
  def initialize(opts={}) # once we no longer support ruby 1.9.3, can switch to native keyword args
28
- opts = opts.keyword_args(ruby: :required, rails: :required, db: :required, exclude: nil, notify: nil, quick: nil)
28
+ opts = opts.keyword_args(ruby: :required, activerecord: :required, db: :required, exclude: nil, notify: nil, quick: nil)
29
29
  @ruby = Array.wrap(opts.ruby)
30
- @rails = Array.wrap(opts.rails)
30
+ @activerecord = Array.wrap(opts.activerecord)
31
31
  @db = Array.wrap(opts.db)
32
32
  @exclude = Array.wrap(opts.exclude).map(&:symbolize_keys).map {|tuple| Tuple.new(tuple)}
33
33
  @notify = Array.wrap(opts.notify)
34
- @quick = Array.wrap(opts.quick || {ruby: @ruby.last, rails: @rails.last, db: @db.last})
34
+ @quick = Array.wrap(opts.quick || {ruby: @ruby.last, activerecord: @activerecord.last, db: @db.last})
35
35
  end
36
36
 
37
37
  def dbms
@@ -39,25 +39,25 @@ module SchemaDev
39
39
  end
40
40
 
41
41
  def matrix(opts={}) # once we no longer support ruby 1.9.3, can switch to native keyword args
42
- opts = opts.keyword_args(quick: false, ruby: nil, rails: nil, db: nil, excluded: nil)
42
+ opts = opts.keyword_args(quick: false, ruby: nil, activerecord: nil, db: nil, excluded: nil)
43
43
  use_ruby = @ruby
44
- use_rails = @rails
44
+ use_activerecord = @activerecord
45
45
  use_db = @db
46
46
  if opts.quick
47
47
  use_ruby = @quick.map{|q| q[:ruby]}
48
- use_rails = @quick.map{|q| q[:rails]}
48
+ use_activerecord = @quick.map{|q| q[:activerecord]}
49
49
  use_db = @quick.map{|q| q[:db]}
50
50
  end
51
51
  use_ruby = Array.wrap(opts.ruby) if opts.ruby
52
- use_rails = Array.wrap(opts.rails) if opts.rails
52
+ use_activerecord = Array.wrap(opts.activerecord) if opts.activerecord
53
53
  use_db = Array.wrap(opts.db) if opts.db
54
54
 
55
55
  use_ruby = [nil] unless use_ruby.any?
56
- use_rails = [nil] unless use_rails.any?
56
+ use_activerecord = [nil] unless use_activerecord.any?
57
57
  use_db = [nil] unless use_db.any?
58
58
 
59
- m = use_ruby.product(use_rails, use_db)
60
- m = m.map { |_ruby, _rails, _db| Tuple.new(ruby: _ruby, rails: _rails, db: _db) }.compact
59
+ m = use_ruby.product(use_activerecord, use_db)
60
+ m = m.map { |_ruby, _activerecord, _db| Tuple.new(ruby: _ruby, activerecord: _activerecord, db: _db) }.compact
61
61
  m = m.reject(&it.match_any?(@exclude)) unless opts.excluded == :none
62
62
  m = m.map(&:to_hash)
63
63
 
@@ -68,10 +68,10 @@ module SchemaDev
68
68
  end
69
69
  end
70
70
 
71
- class Tuple < KeyStruct[:ruby, :rails, :db]
71
+ class Tuple < KeyStruct[:ruby, :activerecord, :db]
72
72
  def match?(other)
73
73
  return false if self.ruby and other.ruby and self.ruby != other.ruby
74
- return false if self.rails and other.rails and self.rails != other.rails
74
+ return false if self.activerecord and other.activerecord and self.activerecord != other.activerecord
75
75
  return false if self.db and other.db and self.db != other.db
76
76
  true
77
77
  end
@@ -7,11 +7,11 @@ require_relative "gemfile_selector"
7
7
  module SchemaDev
8
8
  class Executor
9
9
 
10
- attr_reader :ruby, :rails, :db, :error
10
+ attr_reader :ruby, :activerecord, :db, :error
11
11
 
12
- def initialize(ruby:, rails:, db:)
12
+ def initialize(ruby:, activerecord:, db:)
13
13
  @ruby_selector = RubySelector.command(ruby)
14
- @gemfile_selector = GemfileSelector.command(rails: rails, db: db)
14
+ @gemfile_selector = GemfileSelector.command(activerecord: activerecord, db: db)
15
15
  end
16
16
 
17
17
  def run(cmd, dry_run: false)
@@ -7,18 +7,18 @@ module SchemaDev
7
7
  extend self
8
8
 
9
9
  def gemfile(opts = {})
10
- opts = opts.keyword_args(rails: :required, db: :required)
11
- Pathname.new(GEMFILES_DIR).join("rails-#{opts.rails}", "Gemfile.#{opts.db}")
10
+ opts = opts.keyword_args(activerecord: :required, db: :required)
11
+ Pathname.new(GEMFILES_DIR).join("activerecord-#{opts.activerecord}", "Gemfile.#{opts.db}")
12
12
  end
13
13
 
14
14
  def command(opts={})
15
- opts = opts.keyword_args(rails: :required, db: :required)
16
- "BUNDLE_GEMFILE=#{gemfile(rails: opts.rails, db: opts.db)}"
15
+ opts = opts.keyword_args(activerecord: :required, db: :required)
16
+ "BUNDLE_GEMFILE=#{gemfile(activerecord: opts.activerecord, db: opts.db)}"
17
17
  end
18
18
 
19
19
  def infer_db
20
- (env = ENV['BUNDLE_GEMFILE']) =~ %r{rails.*/Gemfile[.](.*)}
21
- $1 or raise "Can't infer db: Env BUNDLE_GEMFILE=#{env.inspect}) isn't a schema_dev standard Gemfile path"
20
+ (env = ENV['BUNDLE_GEMFILE']) =~ %r{activerecord.*/Gemfile[.](.*)}
21
+ $1 or raise "Can't infer db: Env BUNDLE_GEMFILE=#{env.inspect}) isn't a schema_dev standard Gemfile path. (Run 'schema_dev rspec' instead of 'rspec'?)"
22
22
  end
23
23
  end
24
24
  end
@@ -18,13 +18,13 @@ module SchemaDev
18
18
 
19
19
  _copy(relpath, 'Gemfile.base')
20
20
 
21
- config.rails.each do |rails|
21
+ config.activerecord.each do |activerecord|
22
22
 
23
- rails_path = relpath + "rails-#{rails}"
24
- _copy(rails_path, 'Gemfile.base')
23
+ activerecord_path = relpath + "activerecord-#{activerecord}"
24
+ _copy(activerecord_path, 'Gemfile.base')
25
25
 
26
26
  config.db.each do |db|
27
- _copy(rails_path, "Gemfile.#{db}")
27
+ _copy(activerecord_path, "Gemfile.#{db}")
28
28
  end
29
29
  end
30
30
 
@@ -12,14 +12,14 @@ module SchemaDev
12
12
  @errors = []
13
13
  @matrix.each_with_index do |tuple, i|
14
14
  ruby = tuple[:ruby]
15
- rails = tuple[:rails]
15
+ activerecord = tuple[:activerecord]
16
16
  db = tuple[:db]
17
17
 
18
- label = "ruby #{ruby} - rails #{rails} - db #{db}"
18
+ label = "ruby #{ruby} - activerecord #{activerecord} - db #{db}"
19
19
  msg = "#{label} [#{i+1} of #{@matrix.size}]"
20
20
  puts "\n\n*** #{msg}\n\n"
21
21
 
22
- if not Executor.new(ruby: ruby, rails: rails, db: db).run(cmd, dry_run: dry_run)
22
+ if not Executor.new(ruby: ruby, activerecord: activerecord, db: db).run(cmd, dry_run: dry_run)
23
23
  @errors << label
24
24
  end
25
25
  end
@@ -34,8 +34,8 @@ module SchemaDev
34
34
  contents = []
35
35
  contents << "<!-- SCHEMA_DEV: MATRIX - begin -->\n"
36
36
  contents << "<!-- These lines are auto-generated by schema_dev based on schema_dev.yml -->\n"
37
- self.matrix.group_by(&it.slice(:ruby, :rails)).each do |pair, items|
38
- contents << "* ruby **#{pair[:ruby]}** with rails **#{pair[:rails]}**, using #{items.map{|item| "**#{item[:db]}**"}.to_sentence(last_word_connector: ' or ')}\n"
37
+ self.matrix.group_by(&it.slice(:ruby, :activerecord)).each do |pair, items|
38
+ contents << "* ruby **#{pair[:ruby]}** with activerecord **#{pair[:activerecord]}**, using #{items.map{|item| "**#{item[:db]}**"}.to_sentence(last_word_connector: ' or ')}\n"
39
39
  end
40
40
  contents << "\n"
41
41
  contents << "<!-- SCHEMA_DEV: MATRIX - end -->\n"
@@ -26,6 +26,10 @@ module SchemaDev
26
26
  @tmproot ||= Pathname.new('tmp').tap { |path| path.mkpath }
27
27
  end
28
28
 
29
+ def logroot
30
+ @logroot ||= Pathname.new('log').tap { |path| path.mkpath }
31
+ end
32
+
29
33
  def configuration
30
34
  case @db
31
35
  when 'mysql'
@@ -72,8 +76,8 @@ module SchemaDev
72
76
 
73
77
  def set_logger
74
78
  ruby = "#{RUBY_ENGINE}-#{RUBY_VERSION}"
75
- rails = "rails-#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}"
76
- ActiveRecord::Base.logger = Logger.new(tmproot.join("#{ruby}.#{rails}.#{@db}.log").open("w"))
79
+ activerecord = "activerecord-#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}"
80
+ ActiveRecord::Base.logger = Logger.new(logroot.join("#{ruby}.#{activerecord}.#{@db}.log").open("w"))
77
81
  end
78
82
 
79
83
  module Helpers
@@ -35,10 +35,10 @@ module SchemaDev
35
35
  self.readme(quiet: quiet)
36
36
  end
37
37
 
38
- def run(*args, dry_run: false, quick: false, ruby: nil, rails: nil, db: nil, freshen: true)
38
+ def run(*args, dry_run: false, quick: false, ruby: nil, activerecord: nil, db: nil, freshen: true)
39
39
  self.freshen if freshen
40
40
 
41
- matrix = MatrixExecutor.new @config.matrix(quick: quick, ruby: ruby, rails: rails, db: db)
41
+ matrix = MatrixExecutor.new @config.matrix(quick: quick, ruby: ruby, activerecord: activerecord, db: db)
42
42
 
43
43
  return true if matrix.run(Shellwords.join(args.flatten), dry_run: dry_run)
44
44
 
@@ -21,11 +21,11 @@ module SchemaDev
21
21
  end
22
22
  env = env.join(' ')
23
23
 
24
- gemfiles = config.matrix.map{|entry| GemfileSelector.gemfile(entry.slice(:rails, :db)).to_s}.uniq
24
+ gemfiles = config.matrix.map{|entry| GemfileSelector.gemfile(entry.slice(:activerecord, :db)).to_s}.uniq
25
25
 
26
26
  exclude = config.matrix(excluded: :only).map { |entry| {}.tap {|ex|
27
27
  ex["rvm"] = entry[:ruby]
28
- ex["gemfile"] = GemfileSelector.gemfile(entry.slice(:rails, :db)).to_s
28
+ ex["gemfile"] = GemfileSelector.gemfile(entry.slice(:activerecord, :db)).to_s
29
29
  ex["env"] = env unless env.empty?
30
30
  }}.reject{|ex| not gemfiles.include? ex["gemfile"]}
31
31
 
@@ -1,3 +1,3 @@
1
1
  module SchemaDev
2
- VERSION = "2.0.4"
2
+ VERSION = "3.0.0"
3
3
  end
data/spec/config_spec.rb CHANGED
@@ -1,59 +1,59 @@
1
1
  describe SchemaDev::Config do
2
2
 
3
3
  it "computes matrix" do
4
- config = get_config(ruby: %W[1.9.3 2.1.5], rails: %W[4.0 4.1], db: %W[sqlite3 postgresql])
4
+ config = get_config(ruby: %W[1.9.3 2.1.5], activerecord: %W[4.0 4.1], db: %W[sqlite3 postgresql])
5
5
  expect(config.matrix).to match_array [
6
- { ruby: "1.9.3", rails: "4.0", db: "sqlite3" },
7
- { ruby: "1.9.3", rails: "4.0", db: "postgresql" },
8
- { ruby: "1.9.3", rails: "4.1", db: "sqlite3" },
9
- { ruby: "1.9.3", rails: "4.1", db: "postgresql" },
10
- { ruby: "2.1.5", rails: "4.0", db: "sqlite3" },
11
- { ruby: "2.1.5", rails: "4.0", db: "postgresql" },
12
- { ruby: "2.1.5", rails: "4.1", db: "sqlite3" },
13
- { ruby: "2.1.5", rails: "4.1", db: "postgresql" },
6
+ { ruby: "1.9.3", activerecord: "4.0", db: "sqlite3" },
7
+ { ruby: "1.9.3", activerecord: "4.0", db: "postgresql" },
8
+ { ruby: "1.9.3", activerecord: "4.1", db: "sqlite3" },
9
+ { ruby: "1.9.3", activerecord: "4.1", db: "postgresql" },
10
+ { ruby: "2.1.5", activerecord: "4.0", db: "sqlite3" },
11
+ { ruby: "2.1.5", activerecord: "4.0", db: "postgresql" },
12
+ { ruby: "2.1.5", activerecord: "4.1", db: "sqlite3" },
13
+ { ruby: "2.1.5", activerecord: "4.1", db: "postgresql" },
14
14
  ]
15
15
  end
16
16
 
17
17
  it "excludes explicit elements from matrix" do
18
- config = get_config(ruby: %W[1.9.3 2.1.5], rails: %W[4.0 4.1], db: %W[sqlite3 postgresql],
18
+ config = get_config(ruby: %W[1.9.3 2.1.5], activerecord: %W[4.0 4.1], db: %W[sqlite3 postgresql],
19
19
  exclude: [
20
- { ruby: "1.9.3", rails: "4.1", db: "postgresql" },
21
- { ruby: "2.1.5", rails: "4.0", db: "sqlite3" } ]
20
+ { ruby: "1.9.3", activerecord: "4.1", db: "postgresql" },
21
+ { ruby: "2.1.5", activerecord: "4.0", db: "sqlite3" } ]
22
22
  )
23
23
  expect(config.matrix).to match_array [
24
- { ruby: "1.9.3", rails: "4.0", db: "sqlite3" },
25
- { ruby: "1.9.3", rails: "4.0", db: "postgresql" },
26
- { ruby: "1.9.3", rails: "4.1", db: "sqlite3" },
27
- # { ruby: "1.9.3", rails: "4.1", db: "postgresql" },
28
- # { ruby: "2.1.5", rails: "4.0", db: "sqlite3" },
29
- { ruby: "2.1.5", rails: "4.0", db: "postgresql" },
30
- { ruby: "2.1.5", rails: "4.1", db: "sqlite3" },
31
- { ruby: "2.1.5", rails: "4.1", db: "postgresql" },
24
+ { ruby: "1.9.3", activerecord: "4.0", db: "sqlite3" },
25
+ { ruby: "1.9.3", activerecord: "4.0", db: "postgresql" },
26
+ { ruby: "1.9.3", activerecord: "4.1", db: "sqlite3" },
27
+ # { ruby: "1.9.3", activerecord: "4.1", db: "postgresql" },
28
+ # { ruby: "2.1.5", activerecord: "4.0", db: "sqlite3" },
29
+ { ruby: "2.1.5", activerecord: "4.0", db: "postgresql" },
30
+ { ruby: "2.1.5", activerecord: "4.1", db: "sqlite3" },
31
+ { ruby: "2.1.5", activerecord: "4.1", db: "postgresql" },
32
32
  ]
33
33
  end
34
34
 
35
35
  it "excludes slices from matrix" do
36
- config = get_config(ruby: %W[1.9.3 2.1.5], rails: %W[4.0 4.1], db: %W[sqlite3 postgresql],
36
+ config = get_config(ruby: %W[1.9.3 2.1.5], activerecord: %W[4.0 4.1], db: %W[sqlite3 postgresql],
37
37
  exclude: [
38
- { ruby: "1.9.3", rails: "4.1"},
38
+ { ruby: "1.9.3", activerecord: "4.1"},
39
39
  { ruby: "2.1.5", db: "sqlite3" } ]
40
40
  )
41
41
  expect(config.matrix).to match_array [
42
- { ruby: "1.9.3", rails: "4.0", db: "sqlite3" },
43
- { ruby: "1.9.3", rails: "4.0", db: "postgresql" },
44
- #{ ruby: "1.9.3", rails: "4.1", db: "sqlite3" },
45
- #{ ruby: "1.9.3", rails: "4.1", db: "postgresql" },
46
- #{ ruby: "2.1.5", rails: "4.0", db: "sqlite3" },
47
- { ruby: "2.1.5", rails: "4.0", db: "postgresql" },
48
- #{ ruby: "2.1.5", rails: "4.1", db: "sqlite3" },
49
- { ruby: "2.1.5", rails: "4.1", db: "postgresql" },
42
+ { ruby: "1.9.3", activerecord: "4.0", db: "sqlite3" },
43
+ { ruby: "1.9.3", activerecord: "4.0", db: "postgresql" },
44
+ #{ ruby: "1.9.3", activerecord: "4.1", db: "sqlite3" },
45
+ #{ ruby: "1.9.3", activerecord: "4.1", db: "postgresql" },
46
+ #{ ruby: "2.1.5", activerecord: "4.0", db: "sqlite3" },
47
+ { ruby: "2.1.5", activerecord: "4.0", db: "postgresql" },
48
+ #{ ruby: "2.1.5", activerecord: "4.1", db: "sqlite3" },
49
+ { ruby: "2.1.5", activerecord: "4.1", db: "postgresql" },
50
50
  ]
51
51
  end
52
52
 
53
53
  it "uses last cell for --quick" do
54
- config = get_config(ruby: %W[1.9.3 2.1.5], rails: %W[4.0 4.1], db: %W[sqlite3 postgresql])
54
+ config = get_config(ruby: %W[1.9.3 2.1.5], activerecord: %W[4.0 4.1], db: %W[sqlite3 postgresql])
55
55
  expect(config.matrix quick: true).to match_array [
56
- { ruby: "2.1.5", rails: "4.1", db: "postgresql" },
56
+ { ruby: "2.1.5", activerecord: "4.1", db: "postgresql" },
57
57
  ]
58
58
  end
59
59
 
@@ -4,7 +4,7 @@ describe SchemaDev::GemfileSelector do
4
4
 
5
5
  it "infers db from env" do
6
6
  test_dbname = 'this_is_a_test'
7
- ENV['BUNDLE_GEMFILE'] = SchemaDev::GemfileSelector.gemfile(rails: '4.1', db: test_dbname).to_s
7
+ ENV['BUNDLE_GEMFILE'] = SchemaDev::GemfileSelector.gemfile(activerecord: '4.1', db: test_dbname).to_s
8
8
  expect(SchemaDev::GemfileSelector.infer_db).to eq test_dbname
9
9
  end
10
10
  end
@@ -3,7 +3,7 @@ require 'schema_dev/gemfiles'
3
3
  describe SchemaDev::Gemfiles do
4
4
 
5
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])
6
+ config = get_config(ruby: %W[1.9.3 2.1.5], activerecord: %W[4.0 4.1], db: %W[sqlite3 postgresql])
7
7
  in_tmpdir do
8
8
  expect(SchemaDev::Gemfiles.build(config)).to be_truthy
9
9
  expect(relevant_diff(config, "gemfiles")).to be_empty
@@ -11,7 +11,7 @@ describe SchemaDev::Gemfiles do
11
11
  end
12
12
 
13
13
  it "only copies files once" do
14
- config = get_config(ruby: %W[1.9.3 2.1.5], rails: %W[4.0 4.1], db: %W[sqlite3 postgresql])
14
+ config = get_config(ruby: %W[1.9.3 2.1.5], activerecord: %W[4.0 4.1], db: %W[sqlite3 postgresql])
15
15
  in_tmpdir do
16
16
  expect(SchemaDev::Gemfiles.build(config)).to be_truthy
17
17
  expect(SchemaDev::Gemfiles.build(config)).to be_falsey
@@ -22,8 +22,8 @@ describe SchemaDev::Gemfiles do
22
22
  src = SchemaDev::Templates.root + dir
23
23
  diff = `diff -rq #{src} #{dir} 2>&1`.split("\n")
24
24
 
25
- # expect copy not to have entry for rails not in config
26
- diff.reject!{ |d| d =~ %r[Only in #{src}: rails-(.*)] and not config.rails.include? $1 }
25
+ # expect copy not to have entry for activerecord not in config
26
+ diff.reject!{ |d| d =~ %r[Only in #{src}: activerecord-(.*)] and not config.activerecord.include? $1 }
27
27
 
28
28
  # expect copy not to have entry for db not in config
29
29
  diff.reject!{ |d| d =~ %r[Only in #{src}.*: Gemfile.(.*)] and not config.db.include? $1 }
data/spec/runner_spec.rb CHANGED
@@ -3,7 +3,7 @@ require 'schema_dev/runner'
3
3
  describe SchemaDev::Runner do
4
4
 
5
5
  it "creates gemfiles" do
6
- config = get_config(ruby: "2.1.3", rails: "4.0", db: "sqlite3")
6
+ config = get_config(ruby: "2.1.3", activerecord: "4.0", db: "sqlite3")
7
7
  runner = SchemaDev::Runner.new(config)
8
8
  in_tmpdir do
9
9
  expect{ runner.gemfiles }.to output("* Updated gemfiles\n").to_stdout
@@ -12,7 +12,7 @@ describe SchemaDev::Runner do
12
12
  end
13
13
 
14
14
  it "creates travis" do
15
- config = get_config(ruby: "2.1.3", rails: "4.0", db: "sqlite3")
15
+ config = get_config(ruby: "2.1.3", activerecord: "4.0", db: "sqlite3")
16
16
  runner = SchemaDev::Runner.new(config)
17
17
  in_tmpdir do
18
18
  expect{ runner.travis }.to output("* Updated .travis.yml\n").to_stdout
@@ -54,7 +54,7 @@ describe SchemaDev::Runner do
54
54
  }
55
55
  end
56
56
 
57
- let(:config) { get_config(ruby: RUBY_VERSION, rails: "4.0", db: %W[sqlite3 postgresql]) }
57
+ let(:config) { get_config(ruby: RUBY_VERSION, activerecord: "4.0", db: %W[sqlite3 postgresql]) }
58
58
  let(:runner) { SchemaDev::Runner.new(config) }
59
59
 
60
60
 
@@ -63,14 +63,14 @@ describe SchemaDev::Runner do
63
63
  * Updated gemfiles
64
64
 
65
65
 
66
- *** ruby #{RUBY_VERSION} - rails 4.0 - db sqlite3 [1 of 2]
66
+ *** ruby #{RUBY_VERSION} - activerecord 4.0 - db sqlite3 [1 of 2]
67
67
 
68
- * /usr/bin/env BUNDLE_GEMFILE=gemfiles/rails-4.0/Gemfile.sqlite3 #{selection_command} %{cmd}
68
+ * /usr/bin/env BUNDLE_GEMFILE=gemfiles/activerecord-4.0/Gemfile.sqlite3 #{selection_command} %{cmd}
69
69
  %{output}
70
70
 
71
- *** ruby #{RUBY_VERSION} - rails 4.0 - db postgresql [2 of 2]
71
+ *** ruby #{RUBY_VERSION} - activerecord 4.0 - db postgresql [2 of 2]
72
72
 
73
- * /usr/bin/env BUNDLE_GEMFILE=gemfiles/rails-4.0/Gemfile.postgresql #{selection_command} %{cmd}
73
+ * /usr/bin/env BUNDLE_GEMFILE=gemfiles/activerecord-4.0/Gemfile.postgresql #{selection_command} %{cmd}
74
74
  %{output}
75
75
  ENDOUTPUT
76
76
 
@@ -85,8 +85,8 @@ ENDOUTPUT
85
85
  expect{ runner.run("false") }.to output(expected_output % {cmd: 'false', output: nil} + <<-ENDERR).to_stdout
86
86
 
87
87
  *** 2 failures:
88
- \truby #{RUBY_VERSION} - rails 4.0 - db sqlite3
89
- \truby #{RUBY_VERSION} - rails 4.0 - db postgresql
88
+ \truby #{RUBY_VERSION} - activerecord 4.0 - db sqlite3
89
+ \truby #{RUBY_VERSION} - activerecord 4.0 - db postgresql
90
90
  ENDERR
91
91
  end
92
92
  end
@@ -96,8 +96,8 @@ ENDOUTPUT
96
96
  expect{ runner.run("echo", "LoadError") }.to output(expected_output % {cmd: 'echo LoadError', output: "LoadError\n"} + <<-ENDERR).to_stdout
97
97
 
98
98
  *** 2 failures:
99
- \truby #{RUBY_VERSION} - rails 4.0 - db sqlite3
100
- \truby #{RUBY_VERSION} - rails 4.0 - db postgresql
99
+ \truby #{RUBY_VERSION} - activerecord 4.0 - db sqlite3
100
+ \truby #{RUBY_VERSION} - activerecord 4.0 - db postgresql
101
101
  ENDERR
102
102
  end
103
103
  end
data/spec/travis_spec.rb CHANGED
@@ -4,7 +4,7 @@ describe SchemaDev::Travis do
4
4
 
5
5
  it "creates travis file" do
6
6
  config = get_config(ruby: %W[1.9.3 2.1.5],
7
- rails: %W[4.0 4.1],
7
+ activerecord: %W[4.0 4.1],
8
8
  db: %W[mysql2 postgresql],
9
9
  exclude: { ruby: "1.9.3", db: "postgresql" },
10
10
  notify: 'me@example.com')
@@ -21,10 +21,10 @@ rvm:
21
21
  - 1.9.3
22
22
  - 2.1.5
23
23
  gemfile:
24
- - gemfiles/rails-4.0/Gemfile.mysql2
25
- - gemfiles/rails-4.0/Gemfile.postgresql
26
- - gemfiles/rails-4.1/Gemfile.mysql2
27
- - gemfiles/rails-4.1/Gemfile.postgresql
24
+ - gemfiles/activerecord-4.0/Gemfile.mysql2
25
+ - gemfiles/activerecord-4.0/Gemfile.postgresql
26
+ - gemfiles/activerecord-4.1/Gemfile.mysql2
27
+ - gemfiles/activerecord-4.1/Gemfile.postgresql
28
28
  env: POSTGRESQL_DB_USER=postgres MYSQL_DB_USER=travis
29
29
  addons:
30
30
  postgresql: '9.3'
@@ -37,10 +37,10 @@ notifications:
37
37
  matrix:
38
38
  exclude:
39
39
  - rvm: 1.9.3
40
- gemfile: gemfiles/rails-4.0/Gemfile.postgresql
40
+ gemfile: gemfiles/activerecord-4.0/Gemfile.postgresql
41
41
  env: POSTGRESQL_DB_USER=postgres MYSQL_DB_USER=travis
42
42
  - rvm: 1.9.3
43
- gemfile: gemfiles/rails-4.1/Gemfile.postgresql
43
+ gemfile: gemfiles/activerecord-4.1/Gemfile.postgresql
44
44
  env: POSTGRESQL_DB_USER=postgres MYSQL_DB_USER=travis
45
45
  ENDTRAVIS
46
46
  end
@@ -37,7 +37,7 @@ Are you interested in contributing to %GEM_MODULE%? Thanks! Please follow the
37
37
  Some things to know about to help you develop and test:
38
38
 
39
39
  * **schema_dev**: %GEM_MODULE% uses [schema_dev](https://github.com/SchemaPlus/schema_dev) to
40
- facilitate running rspec tests on the matrix of ruby, rails, and database
40
+ facilitate running rspec tests on the matrix of ruby, activerecord, and database
41
41
  versions that the gem supports, both locally and on
42
42
  [travis-ci](http://travis-ci.org/SchemaPlus/%GEM_NAME%)
43
43
 
@@ -1,7 +1,7 @@
1
1
  ruby:
2
2
  - 1.9.3
3
3
  - 2.1.5
4
- rails:
4
+ activerecord:
5
5
  - 4.2
6
6
  db:
7
7
  - mysql2
@@ -1,3 +1,3 @@
1
1
  eval File.read File.expand_path('../../Gemfile.base', __FILE__)
2
2
 
3
- gem "rails", "~> 3.2.0"
3
+ gem "activerecord", "~> 3.2.0"
@@ -1,3 +1,3 @@
1
1
  eval File.read File.expand_path('../../Gemfile.base', __FILE__)
2
2
 
3
- gem "rails", "~> 4.0.0"
3
+ gem "activerecord", "~> 4.0.0"
@@ -1,3 +1,3 @@
1
1
  eval File.read File.expand_path('../../Gemfile.base', __FILE__)
2
2
 
3
- gem "rails", "~> 4.1.0"
3
+ gem "activerecord", "~> 4.1.0"
@@ -1,3 +1,3 @@
1
1
  eval File.read File.expand_path('../../Gemfile.base', __FILE__)
2
2
 
3
- gem "rails", "~> 4.2.0"
3
+ gem "activerecord", "~> 4.2.0"
@@ -0,0 +1,3 @@
1
+ eval File.read File.expand_path('../../Gemfile.base', __FILE__)
2
+
3
+ gem "activerecord", "~> 4.0.0"
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: 2.0.4
4
+ version: 3.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: 2015-01-31 00:00:00.000000000 Z
11
+ date: 2015-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -246,27 +246,27 @@ files:
246
246
  - templates/gem/spec/sanity_spec.rb
247
247
  - templates/gem/spec/spec_helper.rb
248
248
  - templates/gemfiles/Gemfile.base
249
- - templates/gemfiles/rails-3.2/Gemfile.base
250
- - templates/gemfiles/rails-3.2/Gemfile.mysql
251
- - templates/gemfiles/rails-3.2/Gemfile.mysql2
252
- - templates/gemfiles/rails-3.2/Gemfile.postgresql
253
- - templates/gemfiles/rails-3.2/Gemfile.sqlite3
254
- - templates/gemfiles/rails-4.0/Gemfile.base
255
- - templates/gemfiles/rails-4.0/Gemfile.mysql2
256
- - templates/gemfiles/rails-4.0/Gemfile.postgresql
257
- - templates/gemfiles/rails-4.0/Gemfile.sqlite3
258
- - templates/gemfiles/rails-4.1/Gemfile.base
259
- - templates/gemfiles/rails-4.1/Gemfile.mysql2
260
- - templates/gemfiles/rails-4.1/Gemfile.postgresql
261
- - templates/gemfiles/rails-4.1/Gemfile.sqlite3
262
- - templates/gemfiles/rails-4.2/Gemfile.base
263
- - templates/gemfiles/rails-4.2/Gemfile.mysql2
264
- - templates/gemfiles/rails-4.2/Gemfile.postgresql
265
- - templates/gemfiles/rails-4.2/Gemfile.sqlite3
266
- - templates/gemfiles/rails-edge/Gemfile.base
267
- - templates/gemfiles/rails-edge/Gemfile.mysql2
268
- - templates/gemfiles/rails-edge/Gemfile.postgresql
269
- - templates/gemfiles/rails-edge/Gemfile.sqlite3
249
+ - templates/gemfiles/activerecord-3.2/Gemfile.base
250
+ - templates/gemfiles/activerecord-3.2/Gemfile.mysql
251
+ - templates/gemfiles/activerecord-3.2/Gemfile.mysql2
252
+ - templates/gemfiles/activerecord-3.2/Gemfile.postgresql
253
+ - templates/gemfiles/activerecord-3.2/Gemfile.sqlite3
254
+ - templates/gemfiles/activerecord-4.0/Gemfile.base
255
+ - templates/gemfiles/activerecord-4.0/Gemfile.mysql2
256
+ - templates/gemfiles/activerecord-4.0/Gemfile.postgresql
257
+ - templates/gemfiles/activerecord-4.0/Gemfile.sqlite3
258
+ - templates/gemfiles/activerecord-4.1/Gemfile.base
259
+ - templates/gemfiles/activerecord-4.1/Gemfile.mysql2
260
+ - templates/gemfiles/activerecord-4.1/Gemfile.postgresql
261
+ - templates/gemfiles/activerecord-4.1/Gemfile.sqlite3
262
+ - templates/gemfiles/activerecord-4.2/Gemfile.base
263
+ - templates/gemfiles/activerecord-4.2/Gemfile.mysql2
264
+ - templates/gemfiles/activerecord-4.2/Gemfile.postgresql
265
+ - templates/gemfiles/activerecord-4.2/Gemfile.sqlite3
266
+ - templates/gemfiles/activerecord-edge/Gemfile.base
267
+ - templates/gemfiles/activerecord-edge/Gemfile.mysql2
268
+ - templates/gemfiles/activerecord-edge/Gemfile.postgresql
269
+ - templates/gemfiles/activerecord-edge/Gemfile.sqlite3
270
270
  homepage: https://github.com/SchemaPlus/schema_dev
271
271
  licenses:
272
272
  - MIT
@@ -1,3 +0,0 @@
1
- eval File.read File.expand_path('../../Gemfile.base', __FILE__)
2
-
3
- gem "rails", "~> 4.0.0"