train 3.1.8 → 3.2.0

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
  SHA256:
3
- metadata.gz: e776c228711cbc3b424726dbd8e43655169efe42cd42d3cba18c5d57cb7ff497
4
- data.tar.gz: a34d47e64bee5ab52278ef28c1d4d998e7d60ba12519386b9f618812a6db835c
3
+ metadata.gz: c8dd3de7c1923ee9b164a40fe8b3fb6bfdfe318c3b9cb3b322397551e8a17a5f
4
+ data.tar.gz: 7b3b63a44c454963d8b47b1c3e7772b17db8f73b20a6519da955a475823d6b3f
5
5
  SHA512:
6
- metadata.gz: 4acc5d08f23f888fe6411f0914c14e50d53a9f0cfd3e990cfd929c8f8532d87f857f0fb9f199dec9f02eda83a6c7f2f97b786e724d81112321a768b723c06519
7
- data.tar.gz: dc8052d53a15ed57eab764bbb355faf994d39145f8210a90911b8198676febbbeda97c79a782d77a12414ddfc554286ecc7f93b9b6873e8601341f64672bb61c
6
+ metadata.gz: 13928685d3aa1d35942241ce81be9cda15cbdfdfadf2e9c04fdb63da9d0573eba79bfb5431fb907ca57b0732c2a9a6be94abc60dd43261d950297ae764bd2d1e
7
+ data.tar.gz: 0eb217f2809ff17bc7a0715b9c49566a45d16db343131c208a6dabc9765771095020dc8618af13a3003e5e7c0c72d9804ae649bef56246fd3a77ee690e0e6d15
@@ -29,7 +29,9 @@ module Train
29
29
  }.freeze
30
30
 
31
31
  DATA_FIELDS.each do |m|
32
- define_method m.to_sym do
32
+ next if m == "path"
33
+
34
+ define_method m do
33
35
  raise NotImplementedError, "File must implement the #{m}() method."
34
36
  end
35
37
  end
@@ -23,10 +23,8 @@ module Train::Platforms
23
23
  end
24
24
 
25
25
  def find_family_hierarchy(platform = self)
26
- families = platform.families.each_with_object([]) do |(k, _v), memo|
27
- memo << k.name
28
- memo << find_family_hierarchy(k) unless k.families.empty?
29
- end
26
+ families = platform.families.map { |k, v| [k.name, find_family_hierarchy(k)] }
27
+
30
28
  @family_hierarchy = families.flatten
31
29
  end
32
30
 
@@ -42,11 +40,7 @@ module Train::Platforms
42
40
 
43
41
  def clean_name(force: false)
44
42
  @cleaned_name = nil if force
45
- @cleaned_name ||= begin
46
- name = (@platform[:name] || @name)
47
- name.downcase!.tr!(" ", "_") if name =~ /[A-Z ]/
48
- name
49
- end
43
+ @cleaned_name ||= (@platform[:name] || @name).downcase.tr(" ", "_")
50
44
  end
51
45
 
52
46
  def uuid
@@ -70,11 +70,17 @@ class Train::Transports::Mock
70
70
  "mock://"
71
71
  end
72
72
 
73
+ DEFAULTS = {
74
+ name: "mock",
75
+ family: "mock",
76
+ release: "unknown",
77
+ arch: "unknown",
78
+ }.freeze
79
+
73
80
  def mock_os(value = {})
74
- # if a user passes a nil value, set to an empty hash so the merge still succeeds
75
- value ||= {}
76
- value.each { |k, v| value[k] = "unknown" if v.nil? }
77
- value = { name: "mock", family: "mock", release: "unknown", arch: "unknown" }.merge(value)
81
+ value = DEFAULTS
82
+ .merge(value || {})
83
+ .transform_values { |v| v || "unknown" }
78
84
 
79
85
  platform = Train::Platforms.name(value[:name])
80
86
  platform.find_family_hierarchy
@@ -285,7 +285,7 @@ class Train::Transports::SSH
285
285
  exit_status = nil
286
286
  session.open_channel do |channel|
287
287
  # wrap commands if that is configured
288
- cmd = @cmd_wrapper.run(cmd) unless @cmd_wrapper.nil?
288
+ cmd = @cmd_wrapper.run(cmd) if @cmd_wrapper
289
289
 
290
290
  if @transport_options[:pty]
291
291
  channel.request_pty do |_ch, success|
@@ -3,5 +3,5 @@
3
3
  # Author:: Dominik Richter (<dominik.richter@gmail.com>)
4
4
 
5
5
  module Train
6
- VERSION = "3.1.8".freeze
6
+ VERSION = "3.2.0".freeze
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: train
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.8
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominik Richter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-13 00:00:00.000000000 Z
11
+ date: 2019-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -146,6 +146,20 @@ dependencies:
146
146
  - - "~>"
147
147
  - !ruby/object:Gem::Version
148
148
  version: '0.17'
149
+ - !ruby/object:Gem::Dependency
150
+ name: azure_mgmt_security
151
+ requirement: !ruby/object:Gem::Requirement
152
+ requirements:
153
+ - - "~>"
154
+ - !ruby/object:Gem::Version
155
+ version: '0.18'
156
+ type: :runtime
157
+ prerelease: false
158
+ version_requirements: !ruby/object:Gem::Requirement
159
+ requirements:
160
+ - - "~>"
161
+ - !ruby/object:Gem::Version
162
+ version: '0.18'
149
163
  - !ruby/object:Gem::Dependency
150
164
  name: activesupport
151
165
  requirement: !ruby/object:Gem::Requirement