schema_dev 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/.rspec +3 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +22 -0
- data/README.md +15 -0
- data/Rakefile +2 -0
- data/bin/schema_dev +47 -0
- data/lib/schema_dev/config.rb +72 -0
- data/lib/schema_dev/executor.rb +31 -0
- data/lib/schema_dev/gemfile_selector.rb +20 -0
- data/lib/schema_dev/matrix_executor.rb +30 -0
- data/lib/schema_dev/rspec.rb +59 -0
- data/lib/schema_dev/ruby_selector.rb +48 -0
- data/lib/schema_dev/runner.rb +20 -0
- data/lib/schema_dev/version.rb +3 -0
- data/lib/schema_dev.rb +5 -0
- data/schema_dev.gemspec +30 -0
- data/schema_dev.yml +6 -0
- data/spec/config_spec.rb +63 -0
- data/spec/spec_helper.rb +11 -0
- metadata +179 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 60f8ddd141dfc2a080c30d785cd4a3f20c66a024
|
4
|
+
data.tar.gz: c9d1b2654eafbf15942f26ee03447285d0f5e419
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 274c4a4cde762e87d6582be216a02726307224b2b8b6bd9b24b99c15cb760386790a693e051ab658bb0ad5b72c0b994c26dc271ecfbd19b1ee37a37a0aa2ff2b
|
7
|
+
data.tar.gz: e502cd474e4fede9041ec3d0273f78903f20ec8f1a2fe1c931bb49ceb9a2d1996974d6b055a50bee6a379904da88669c113ca4868165252b4bbd7cab61ae1740
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 ronen barzel
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
data/Rakefile
ADDED
data/bin/schema_dev
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'active_support/core_ext/hash'
|
4
|
+
require 'thor'
|
5
|
+
require 'schema_dev/config'
|
6
|
+
require 'schema_dev/runner'
|
7
|
+
|
8
|
+
$config = SchemaDev::Config.load
|
9
|
+
$runner = SchemaDev::Runner.new($config)
|
10
|
+
|
11
|
+
class CLI < Thor
|
12
|
+
|
13
|
+
def self.matrix_options
|
14
|
+
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}"
|
16
|
+
method_option :ruby, type: :string, desc: "Only execute for the specified version of ruby"
|
17
|
+
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?
|
19
|
+
end
|
20
|
+
|
21
|
+
desc "run command", "run a command over the matrix"
|
22
|
+
matrix_options
|
23
|
+
def do(*args)
|
24
|
+
$runner.run(args, **options.symbolize_keys)
|
25
|
+
end
|
26
|
+
|
27
|
+
desc "bundle", "shorthand for '#{$0} do bundle ...'"
|
28
|
+
matrix_options
|
29
|
+
def bundle(*args)
|
30
|
+
$runner.run('bundle', args, **options.symbolize_keys)
|
31
|
+
end
|
32
|
+
|
33
|
+
desc "rake", "shorthand for '#{$0} do rake ...'"
|
34
|
+
matrix_options
|
35
|
+
def rake(*args)
|
36
|
+
$runner.run('rake', args, **options.symbolize_keys)
|
37
|
+
end
|
38
|
+
|
39
|
+
desc "rspec", "shorthand for '#{$0} do rspec ...'"
|
40
|
+
matrix_options
|
41
|
+
def rspec(*args)
|
42
|
+
$runner.run('rspec', args, **options.symbolize_keys)
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
|
47
|
+
CLI.start(ARGV)
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require 'active_support/core_ext/hash'
|
2
|
+
require 'enumerator'
|
3
|
+
require 'fastandand'
|
4
|
+
require 'its-it'
|
5
|
+
require 'key_struct'
|
6
|
+
require 'pathname'
|
7
|
+
require 'yaml'
|
8
|
+
|
9
|
+
module SchemaDev
|
10
|
+
CONFIG_FILE = "schema_dev.yml"
|
11
|
+
|
12
|
+
class Config
|
13
|
+
|
14
|
+
attr_accessor :quick
|
15
|
+
|
16
|
+
def self.load
|
17
|
+
new (YAML.load Pathname.new(CONFIG_FILE).read).deep_symbolize_keys
|
18
|
+
end
|
19
|
+
|
20
|
+
class Tuple < KeyStruct[:ruby, :rails, :db]
|
21
|
+
def match?(other)
|
22
|
+
return false if self.ruby and other.ruby and self.ruby != other.ruby
|
23
|
+
return false if self.rails and other.rails and self.rails != other.rails
|
24
|
+
return false if self.db and other.db and self.db != other.db
|
25
|
+
true
|
26
|
+
end
|
27
|
+
|
28
|
+
def match_any?(others)
|
29
|
+
others.any?{|other| self.match? other}
|
30
|
+
end
|
31
|
+
|
32
|
+
def to_hash
|
33
|
+
super.reject{ |k, val| val.nil? }
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def initialize(ruby:, rails:, db: nil, exclude: nil, notify: nil, quick: nil)
|
38
|
+
@ruby = Array.wrap(ruby)
|
39
|
+
@rails = Array.wrap(rails)
|
40
|
+
@db = Array.wrap(db)
|
41
|
+
@exclude = Array.wrap(exclude).map(&:symbolize_keys).map {|tuple| Tuple.new(tuple)}
|
42
|
+
@notify = Array.wrap(notify)
|
43
|
+
@quick = Array.wrap(quick || {ruby: @ruby.last, rails: @rails.last, db: @db.andand.last})
|
44
|
+
end
|
45
|
+
|
46
|
+
def db?
|
47
|
+
@db.any?
|
48
|
+
end
|
49
|
+
|
50
|
+
def matrix(quick: false, ruby: nil, rails: nil, db: nil)
|
51
|
+
use_ruby = @ruby
|
52
|
+
use_rails = @rails
|
53
|
+
use_db = @db
|
54
|
+
if quick
|
55
|
+
use_ruby = @quick.map{|q| q[:ruby]}
|
56
|
+
use_rails = @quick.map{|q| q[:rails]}
|
57
|
+
use_db = @quick.map{|q| q[:db]}
|
58
|
+
end
|
59
|
+
use_ruby = Array.wrap(ruby) if ruby
|
60
|
+
use_rails = Array.wrap(rails) if rails
|
61
|
+
use_db = Array.wrap(db) if db
|
62
|
+
|
63
|
+
@matrix ||= begin
|
64
|
+
m = use_ruby.product(use_rails)
|
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) }
|
67
|
+
m.reject(&it.match_any?(@exclude)).map(&:to_hash)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'json'
|
2
|
+
require_relative "ruby_selector"
|
3
|
+
require_relative "gemfile_selector"
|
4
|
+
|
5
|
+
module SchemaDev
|
6
|
+
class Executor
|
7
|
+
|
8
|
+
attr_reader :ruby, :rails, :db, :error
|
9
|
+
|
10
|
+
def initialize(ruby:, rails:, db: nil)
|
11
|
+
@ruby_selector = RubySelector.command(ruby)
|
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}'"
|
15
|
+
end
|
16
|
+
|
17
|
+
def run(cmd, dry_run: false)
|
18
|
+
fullcommand = ["/usr/bin/env", @dev_env, @gemfile_selector, @ruby_selector, cmd].compact.join(' ')
|
19
|
+
puts "* #{fullcommand}"
|
20
|
+
return true if dry_run
|
21
|
+
|
22
|
+
Tempfile.open('SchemaDev') do |file|
|
23
|
+
@error = !system(%Q[ (#{fullcommand}) 2>& 1 | tee #{file.path} ])
|
24
|
+
file.rewind
|
25
|
+
@error ||= file.readlines.grep(/(^Failed examples)|(rake aborted)|(LoadError)/).any?
|
26
|
+
end
|
27
|
+
|
28
|
+
return !@error
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
|
3
|
+
module SchemaDev
|
4
|
+
GEMFILES_DIR = "gemfiles"
|
5
|
+
|
6
|
+
module GemfileSelector
|
7
|
+
def self.gemfile(rails:, db: nil)
|
8
|
+
root = Pathname.new(GEMFILES_DIR)
|
9
|
+
if db
|
10
|
+
root.join("rails-#{rails}", "Gemfile.#{db}")
|
11
|
+
else
|
12
|
+
root.join("Gemfile.#{rails}")
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.command(rails:, db: nil)
|
17
|
+
"BUNDLE_GEMFILE=#{gemfile(rails: rails, db: db)}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require_relative 'executor'
|
2
|
+
|
3
|
+
module SchemaDev
|
4
|
+
class MatrixExecutor
|
5
|
+
attr_reader :errors
|
6
|
+
|
7
|
+
def initialize(matrix)
|
8
|
+
@matrix = matrix
|
9
|
+
end
|
10
|
+
|
11
|
+
def run(cmd, dry_run: false)
|
12
|
+
@errors = []
|
13
|
+
@matrix.each_with_index do |tuple, i|
|
14
|
+
ruby = tuple[:ruby]
|
15
|
+
rails = tuple[:rails]
|
16
|
+
db = tuple[:db]
|
17
|
+
|
18
|
+
label = "ruby #{ruby} - rails #{rails}"
|
19
|
+
label += " - db #{db}" if db
|
20
|
+
msg = "#{label} [#{i+1} of #{@matrix.size}]"
|
21
|
+
puts "\n\n*** #{msg}\n\n"
|
22
|
+
|
23
|
+
if not Executor.new(ruby: ruby, rails: rails, db: db).run(cmd, dry_run: dry_run)
|
24
|
+
@errors << label
|
25
|
+
end
|
26
|
+
end
|
27
|
+
return @errors.empty?
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'logger'
|
2
|
+
require 'pathname'
|
3
|
+
|
4
|
+
module SchemaDev
|
5
|
+
module Rspec
|
6
|
+
|
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']
|
12
|
+
root = Pathname.new('tmp')
|
13
|
+
root.mkpath
|
14
|
+
configuration = case db
|
15
|
+
when 'mysql'
|
16
|
+
{
|
17
|
+
:adapter => 'mysql',
|
18
|
+
:database => 'schema_plus_test',
|
19
|
+
:username => ENV.fetch('MYSQL_DB_USER', 'schema_plus'),
|
20
|
+
:encoding => 'utf8',
|
21
|
+
:min_messages => 'warning'
|
22
|
+
}
|
23
|
+
when 'mysql2'
|
24
|
+
{
|
25
|
+
:adapter => 'mysql2',
|
26
|
+
:database => 'schema_plus_test',
|
27
|
+
:username => ENV.fetch('MYSQL_DB_USER', 'schema_plus'),
|
28
|
+
:encoding => 'utf8',
|
29
|
+
:min_messages => 'warning'
|
30
|
+
}
|
31
|
+
when 'postgresql'
|
32
|
+
{
|
33
|
+
:adapter => 'postgresql',
|
34
|
+
:username => ENV['POSTGRESQL_DB_USER'],
|
35
|
+
:database => 'schema_plus_test',
|
36
|
+
:min_messages => 'warning'
|
37
|
+
}
|
38
|
+
when 'sqlite3'
|
39
|
+
{
|
40
|
+
:adapter => 'sqlite3',
|
41
|
+
:database => root.join('schema_plus.sqlite3')
|
42
|
+
}
|
43
|
+
else
|
44
|
+
raise "Unknown db adapter #{db.inspect}"
|
45
|
+
end
|
46
|
+
|
47
|
+
ActiveRecord::Base.logger = Logger.new(root.join("ruby-#{ruby}.rails-#{rails}.#{db}.log").open("w"))
|
48
|
+
ActiveRecord::Base.configurations = { 'schema_dev' => configuration }
|
49
|
+
ActiveRecord::Base.establish_connection :schema_dev
|
50
|
+
|
51
|
+
case db
|
52
|
+
when 'sqlite3'
|
53
|
+
ActiveRecord::Base.connection.execute "PRAGMA synchronous = OFF"
|
54
|
+
end
|
55
|
+
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module SchemaDev
|
2
|
+
module RubySelector
|
3
|
+
def self.command(ruby)
|
4
|
+
@@selector ||= case
|
5
|
+
when system('which -s chruby-exec') then Chruby
|
6
|
+
when system('which -s rvm') then Rvm
|
7
|
+
else Rbenv
|
8
|
+
end.new
|
9
|
+
@@selector.command ruby
|
10
|
+
end
|
11
|
+
|
12
|
+
class Chruby
|
13
|
+
def initialize
|
14
|
+
@rubies = Pathname.new(ENV['HOME']).join(".rubies").entries().map(&its.basename.to_s)
|
15
|
+
end
|
16
|
+
def command(ruby)
|
17
|
+
ruby = @rubies.select(&it =~ /^(ruby-)?#{ruby}(-p.*)?$/).last || ruby
|
18
|
+
"SHELL=`which bash` chruby-exec #{ruby} --"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
class Rvm
|
23
|
+
def command(ruby)
|
24
|
+
"rvm #{ruby} do"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
class Rbenv
|
29
|
+
def initialize
|
30
|
+
# because we're running within a ruby program that was launched by
|
31
|
+
# rbenv, we already have various environment variables set up. need
|
32
|
+
# strip those out so that the forked shell can run a diifferent ruby
|
33
|
+
# version than the one we're in now.
|
34
|
+
ENV['PATH'] = ENV['PATH'].split(':').reject{|dir| dir =~ %r{/\.?rbenv/(?!shims)}}.join(':')
|
35
|
+
ENV['GEM_PATH'] = ENV['GEM_PATH'].split(':').reject{|dir| dir =~ %r{/\.?rbenv}}.join(':') unless ENV['GEM_PATH'].nil?
|
36
|
+
ENV['RBENV_DIR'] = nil
|
37
|
+
ENV['RBENV_HOOK_PATH'] = nil
|
38
|
+
@versions ||= `rbenv versions --bare`.split
|
39
|
+
end
|
40
|
+
|
41
|
+
def command(ruby)
|
42
|
+
version = @versions.select{|v| v.start_with? ruby}.last || abort("no ruby version '#{ruby}' installed in rbenv")
|
43
|
+
"RBENV_VERSION=#{version}"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'shellwords'
|
2
|
+
|
3
|
+
require_relative 'matrix_executor'
|
4
|
+
|
5
|
+
module SchemaDev
|
6
|
+
class Runner
|
7
|
+
def initialize(config)
|
8
|
+
@config = config
|
9
|
+
end
|
10
|
+
|
11
|
+
def run(*args, dry_run: false, quick: false, ruby: nil, rails: nil, db: nil)
|
12
|
+
matrix = MatrixExecutor.new @config.matrix(quick: quick, ruby: ruby, rails: rails, db: db)
|
13
|
+
|
14
|
+
return true if matrix.run(Shellwords.join(args.flatten), dry_run: dry_run)
|
15
|
+
|
16
|
+
puts "\n*** #{matrix.errors.size} failures:\n\t#{matrix.errors.join("\n\t")}"
|
17
|
+
return false
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/schema_dev.rb
ADDED
data/schema_dev.gemspec
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'schema_dev/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "schema_dev"
|
8
|
+
spec.version = SchemaDev::VERSION
|
9
|
+
spec.authors = ["ronen barzel"]
|
10
|
+
spec.email = ["ronen@barzel.org"]
|
11
|
+
spec.summary = %q{SchemaPlus development tools}
|
12
|
+
spec.description = %q{SchemaPlus development tools}
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency "activesupport"
|
22
|
+
spec.add_dependency "its-it"
|
23
|
+
spec.add_dependency "key_struct"
|
24
|
+
spec.add_dependency "thor"
|
25
|
+
spec.add_dependency "fastandand"
|
26
|
+
|
27
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
28
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
29
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
30
|
+
end
|
data/schema_dev.yml
ADDED
data/spec/config_spec.rb
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
describe SchemaDev::Config do
|
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 without db" do
|
14
|
+
config = get_config(ruby: %W[1.9.3 2.1.5], rails: %W[4.0 4.1], db: %W[sqlite3 postgresql])
|
15
|
+
expect(config.matrix).to match_array [
|
16
|
+
{ ruby: "1.9.3", rails: "4.0", db: "sqlite3" },
|
17
|
+
{ ruby: "1.9.3", rails: "4.0", db: "postgresql" },
|
18
|
+
{ ruby: "1.9.3", rails: "4.1", db: "sqlite3" },
|
19
|
+
{ ruby: "1.9.3", rails: "4.1", db: "postgresql" },
|
20
|
+
{ ruby: "2.1.5", rails: "4.0", db: "sqlite3" },
|
21
|
+
{ ruby: "2.1.5", rails: "4.0", db: "postgresql" },
|
22
|
+
{ ruby: "2.1.5", rails: "4.1", db: "sqlite3" },
|
23
|
+
{ ruby: "2.1.5", rails: "4.1", db: "postgresql" },
|
24
|
+
]
|
25
|
+
end
|
26
|
+
|
27
|
+
it "excludes explicit elements from matrix" do
|
28
|
+
config = get_config(ruby: %W[1.9.3 2.1.5], rails: %W[4.0 4.1], db: %W[sqlite3 postgresql],
|
29
|
+
exclude: [
|
30
|
+
{ ruby: "1.9.3", rails: "4.1", db: "postgresql" },
|
31
|
+
{ ruby: "2.1.5", rails: "4.0", db: "sqlite3" } ]
|
32
|
+
)
|
33
|
+
expect(config.matrix).to match_array [
|
34
|
+
{ ruby: "1.9.3", rails: "4.0", db: "sqlite3" },
|
35
|
+
{ ruby: "1.9.3", rails: "4.0", db: "postgresql" },
|
36
|
+
{ ruby: "1.9.3", rails: "4.1", db: "sqlite3" },
|
37
|
+
# { ruby: "1.9.3", rails: "4.1", db: "postgresql" },
|
38
|
+
# { ruby: "2.1.5", rails: "4.0", db: "sqlite3" },
|
39
|
+
{ ruby: "2.1.5", rails: "4.0", db: "postgresql" },
|
40
|
+
{ ruby: "2.1.5", rails: "4.1", db: "sqlite3" },
|
41
|
+
{ ruby: "2.1.5", rails: "4.1", db: "postgresql" },
|
42
|
+
]
|
43
|
+
end
|
44
|
+
|
45
|
+
it "excludes slices from matrix" do
|
46
|
+
config = get_config(ruby: %W[1.9.3 2.1.5], rails: %W[4.0 4.1], db: %W[sqlite3 postgresql],
|
47
|
+
exclude: [
|
48
|
+
{ ruby: "1.9.3", rails: "4.1"},
|
49
|
+
{ ruby: "2.1.5", db: "sqlite3" } ]
|
50
|
+
)
|
51
|
+
expect(config.matrix).to match_array [
|
52
|
+
{ ruby: "1.9.3", rails: "4.0", db: "sqlite3" },
|
53
|
+
{ ruby: "1.9.3", rails: "4.0", db: "postgresql" },
|
54
|
+
#{ ruby: "1.9.3", rails: "4.1", db: "sqlite3" },
|
55
|
+
#{ ruby: "1.9.3", rails: "4.1", db: "postgresql" },
|
56
|
+
#{ ruby: "2.1.5", rails: "4.0", db: "sqlite3" },
|
57
|
+
{ ruby: "2.1.5", rails: "4.0", db: "postgresql" },
|
58
|
+
#{ ruby: "2.1.5", rails: "4.1", db: "sqlite3" },
|
59
|
+
{ ruby: "2.1.5", rails: "4.1", db: "postgresql" },
|
60
|
+
]
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,179 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: schema_dev
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- ronen barzel
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-12-04 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: its-it
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: key_struct
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: thor
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: fastandand
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: bundler
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.7'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.7'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rake
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '10.0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '10.0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rspec
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '3.0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '3.0'
|
125
|
+
description: SchemaPlus development tools
|
126
|
+
email:
|
127
|
+
- ronen@barzel.org
|
128
|
+
executables:
|
129
|
+
- schema_dev
|
130
|
+
extensions: []
|
131
|
+
extra_rdoc_files: []
|
132
|
+
files:
|
133
|
+
- ".gitignore"
|
134
|
+
- ".rspec"
|
135
|
+
- Gemfile
|
136
|
+
- LICENSE.txt
|
137
|
+
- README.md
|
138
|
+
- Rakefile
|
139
|
+
- bin/schema_dev
|
140
|
+
- lib/schema_dev.rb
|
141
|
+
- lib/schema_dev/config.rb
|
142
|
+
- lib/schema_dev/executor.rb
|
143
|
+
- lib/schema_dev/gemfile_selector.rb
|
144
|
+
- lib/schema_dev/matrix_executor.rb
|
145
|
+
- lib/schema_dev/rspec.rb
|
146
|
+
- lib/schema_dev/ruby_selector.rb
|
147
|
+
- lib/schema_dev/runner.rb
|
148
|
+
- lib/schema_dev/version.rb
|
149
|
+
- schema_dev.gemspec
|
150
|
+
- schema_dev.yml
|
151
|
+
- spec/config_spec.rb
|
152
|
+
- spec/spec_helper.rb
|
153
|
+
homepage: ''
|
154
|
+
licenses:
|
155
|
+
- MIT
|
156
|
+
metadata: {}
|
157
|
+
post_install_message:
|
158
|
+
rdoc_options: []
|
159
|
+
require_paths:
|
160
|
+
- lib
|
161
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
162
|
+
requirements:
|
163
|
+
- - ">="
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: '0'
|
166
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
167
|
+
requirements:
|
168
|
+
- - ">="
|
169
|
+
- !ruby/object:Gem::Version
|
170
|
+
version: '0'
|
171
|
+
requirements: []
|
172
|
+
rubyforge_project:
|
173
|
+
rubygems_version: 2.2.2
|
174
|
+
signing_key:
|
175
|
+
specification_version: 4
|
176
|
+
summary: SchemaPlus development tools
|
177
|
+
test_files:
|
178
|
+
- spec/config_spec.rb
|
179
|
+
- spec/spec_helper.rb
|