matrixeval-ruby 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +19 -4
- data/lib/matrixeval/ruby/target.rb +87 -0
- data/lib/matrixeval/ruby/templates/matrixeval.yml +17 -2
- data/lib/matrixeval/ruby/version.rb +1 -3
- data/lib/matrixeval/ruby.rb +5 -21
- metadata +8 -57
- data/exe/matrixeval +0 -5
- data/exe/meval +0 -5
- data/lib/matrixeval/ruby/command_line/parse_context_arguments.rb +0 -85
- data/lib/matrixeval/ruby/command_line.rb +0 -57
- data/lib/matrixeval/ruby/config/yaml.rb +0 -40
- data/lib/matrixeval/ruby/config.rb +0 -98
- data/lib/matrixeval/ruby/container.rb +0 -15
- data/lib/matrixeval/ruby/context/build_docker_compose_extend.rb +0 -43
- data/lib/matrixeval/ruby/context/find_by_command_options.rb +0 -67
- data/lib/matrixeval/ruby/context.rb +0 -86
- data/lib/matrixeval/ruby/docker_compose/extend.rb +0 -21
- data/lib/matrixeval/ruby/docker_compose/extend_raw.rb +0 -19
- data/lib/matrixeval/ruby/docker_compose/file.rb +0 -135
- data/lib/matrixeval/ruby/docker_compose.rb +0 -68
- data/lib/matrixeval/ruby/extra_mount_files.rb +0 -23
- data/lib/matrixeval/ruby/gemfile_locks.rb +0 -23
- data/lib/matrixeval/ruby/gitignore.rb +0 -54
- data/lib/matrixeval/ruby/runner.rb +0 -205
- data/lib/matrixeval/ruby/variant.rb +0 -59
- data/lib/matrixeval/ruby/vector.rb +0 -39
@@ -1,59 +0,0 @@
|
|
1
|
-
require_relative "./container"
|
2
|
-
|
3
|
-
module Matrixeval
|
4
|
-
module Ruby
|
5
|
-
class Variant
|
6
|
-
class << self
|
7
|
-
def default(key, vector)
|
8
|
-
self.new({"key" => key}, vector)
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
attr_reader :key, :env, :vector, :default, :container, :mounts
|
13
|
-
|
14
|
-
def initialize(config = {}, vector)
|
15
|
-
raise Error.new("Variant#key is missing") if config["key"].nil?
|
16
|
-
|
17
|
-
@vector = vector
|
18
|
-
@key = config["key"].to_s
|
19
|
-
@container = Container.new(config["container"])
|
20
|
-
@env = config["env"] || {}
|
21
|
-
@default = config["default"] || false
|
22
|
-
@mounts = config["mounts"] || []
|
23
|
-
end
|
24
|
-
|
25
|
-
def name
|
26
|
-
"#{vector.key}: #{key}"
|
27
|
-
end
|
28
|
-
|
29
|
-
def bundle_volume_name
|
30
|
-
"bundle_#{container.image.gsub(/[^A-Za-z0-9]/,'_')}"
|
31
|
-
end
|
32
|
-
|
33
|
-
def id
|
34
|
-
"#{vector.id}_#{key.to_s.gsub(/[^A-Za-z0-9]/,'_')}"
|
35
|
-
end
|
36
|
-
|
37
|
-
def docker_compose_service_name
|
38
|
-
id
|
39
|
-
end
|
40
|
-
|
41
|
-
def pathname
|
42
|
-
id
|
43
|
-
end
|
44
|
-
|
45
|
-
def default?
|
46
|
-
default
|
47
|
-
end
|
48
|
-
|
49
|
-
def match_command_options?(options)
|
50
|
-
options[vector.key] == key.to_s
|
51
|
-
end
|
52
|
-
|
53
|
-
def ==(variant)
|
54
|
-
vector.key == variant.vector.key &&
|
55
|
-
key == variant.key
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
require_relative "./variant"
|
2
|
-
|
3
|
-
module Matrixeval
|
4
|
-
module Ruby
|
5
|
-
class Vector
|
6
|
-
attr_reader :key, :variants
|
7
|
-
|
8
|
-
def initialize(key, config)
|
9
|
-
@key = key.to_s
|
10
|
-
@variants = (config["variants"] || []).map do |variant_config|
|
11
|
-
config = if variant_config.is_a?(Hash)
|
12
|
-
variant_config
|
13
|
-
else
|
14
|
-
{ "key" => variant_config.to_s }
|
15
|
-
end
|
16
|
-
|
17
|
-
Variant.new(config, self)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def main?
|
22
|
-
key == "ruby"
|
23
|
-
end
|
24
|
-
|
25
|
-
def id
|
26
|
-
"#{key.to_s.gsub(/[^A-Za-z0-9]/,'_')}"
|
27
|
-
end
|
28
|
-
|
29
|
-
def default_variant
|
30
|
-
variant = variants.find(&:default?)
|
31
|
-
if variant.nil?
|
32
|
-
raise Error.new("Please set a default variant for matrix #{key}")
|
33
|
-
end
|
34
|
-
|
35
|
-
variant
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|