train 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f52a89e11554a1520fed7d09db564885c954e88d
4
- data.tar.gz: ca15551ae18c8a60cdf9c4f246170ddb5f04b123
3
+ metadata.gz: 8d1f4e075a5038b0b0a9775e730adb61029aa31c
4
+ data.tar.gz: e6bca8857718107fcaae0683d99e921dc38cdf7e
5
5
  SHA512:
6
- metadata.gz: c723c108b4a86e02d646f7389c2ea075a6c86d83aaaf87c845da1356b84eeeaf9b209f3cebbf959655e812db0dbbcb08929170f9539576cd1326fae7adc4751c
7
- data.tar.gz: 8596b9929258af323373aae7a6d34bb1f341d3ab9aa28d92bd7739b62e325a56832833ea063f81619fb6a2d752ba4736c42741547b0f51bd8f49f4a53ce98bea
6
+ metadata.gz: 1ad43c36e91b4471e56d623433239db881c32ba7a266bf8de70bf7f863feaee87dc78b5628c4fa7980db451a8c220c604a97ee4346df2109d0010be1411ee115
7
+ data.tar.gz: 8fde9bf9ae3281f82abd7785ba8e4886c878b152bc4fa00434a2d3271cbaccc9e86abb9262394baa66798eb9a8a6522ca0905eee4016d17abfd4400c2de0ac1a
data/CHANGELOG.md CHANGED
@@ -1,7 +1,15 @@
1
1
  # Change Log
2
2
 
3
- ## [1.1.0](https://github.com/chef/train/tree/1.1.0) (2018-02-08)
4
- [Full Changelog](https://github.com/chef/train/compare/v1.0.0...1.1.0)
3
+ ## [1.1.1](https://github.com/chef/train/tree/1.1.1) (2018-02-14)
4
+ [Full Changelog](https://github.com/chef/train/compare/v1.1.0...1.1.1)
5
+
6
+ **Merged pull requests:**
7
+
8
+ - Add api sdk versions as platform release [\#258](https://github.com/chef/train/pull/258) ([jquick](https://github.com/jquick))
9
+ - Add plat helper methods to api direct platforms. [\#257](https://github.com/chef/train/pull/257) ([jquick](https://github.com/jquick))
10
+
11
+ ## [v1.1.0](https://github.com/chef/train/tree/v1.1.0) (2018-02-08)
12
+ [Full Changelog](https://github.com/chef/train/compare/v1.0.0...v1.1.0)
5
13
 
6
14
  **Closed issues:**
7
15
 
@@ -9,6 +17,7 @@
9
17
 
10
18
  **Merged pull requests:**
11
19
 
20
+ - Release train 1.1.0 [\#255](https://github.com/chef/train/pull/255) ([jquick](https://github.com/jquick))
12
21
  - Add qnx platform support [\#253](https://github.com/chef/train/pull/253) ([jquick](https://github.com/jquick))
13
22
  - Add azure transport [\#250](https://github.com/chef/train/pull/250) ([jquick](https://github.com/jquick))
14
23
  - Fix AIX and QNX file support [\#249](https://github.com/chef/train/pull/249) ([adamleff](https://github.com/adamleff))
@@ -46,7 +46,6 @@ module Train::Platforms::Detect
46
46
  next unless instance_eval(&plat.detect) == true
47
47
 
48
48
  if plat.class == Train::Platforms::Platform
49
- @platform[:family] = parent.name
50
49
  return plat if condition.empty? || check_condition(condition)
51
50
  elsif plat.class == Train::Platforms::Family
52
51
  plat = scan_family_children(plat)
@@ -22,6 +22,10 @@ module Train::Platforms
22
22
  @families.collect { |k, _v| k.name }
23
23
  end
24
24
 
25
+ def family
26
+ @platform[:family] || @family_hierarchy[0]
27
+ end
28
+
25
29
  def name
26
30
  # Override here incase a updated name was set
27
31
  # during the detect logic
@@ -77,10 +77,12 @@ class Train::Plugins::Transport
77
77
  false
78
78
  end
79
79
 
80
- def direct_platform(name)
80
+ def direct_platform(name, platform_details = nil)
81
81
  plat = Train::Platforms.name(name)
82
82
  plat.backend = self
83
+ plat.platform = platform_details unless platform_details.nil?
83
84
  plat.family_hierarchy = family_hierarchy(plat).flatten
85
+ plat.add_platform_methods
84
86
  plat
85
87
  end
86
88
 
@@ -31,11 +31,15 @@ module Train::Transports
31
31
  @cache_enabled[:api_call] = true
32
32
  @cache[:api_call] = {}
33
33
 
34
+ # additional platform details
35
+ release = Gem.loaded_specs['aws-sdk'].version
36
+ @platform_details = { release: "aws-sdk-v#{release}" }
37
+
34
38
  connect
35
39
  end
36
40
 
37
41
  def platform
38
- direct_platform('aws')
42
+ direct_platform('aws', @platform_details)
39
43
  end
40
44
 
41
45
  def aws_client(klass)
@@ -35,11 +35,16 @@ module Train::Transports
35
35
  if @options[:client_secret].nil? && @options[:client_id].nil?
36
36
  parse_credentials_file
37
37
  end
38
+
39
+ # additional platform details
40
+ release = Gem.loaded_specs['azure_mgmt_resources'].version
41
+ @platform_details = { release: "azure_mgmt_resources-v#{release}" }
42
+
38
43
  connect
39
44
  end
40
45
 
41
46
  def platform
42
- direct_platform('azure')
47
+ direct_platform('azure', @platform_details)
43
48
  end
44
49
 
45
50
  def azure_client(klass = ::Azure::Resources::Profiles::Latest::Mgmt::Client)
data/lib/train/version.rb CHANGED
@@ -3,5 +3,5 @@
3
3
  # Author:: Dominik Richter (<dominik.richter@gmail.com>)
4
4
 
5
5
  module Train
6
- VERSION = '1.1.0'.freeze
6
+ VERSION = '1.1.1'.freeze
7
7
  end
@@ -44,9 +44,32 @@ describe 'v1 Connection Plugin' do
44
44
  end
45
45
 
46
46
  it 'provides direct platform' do
47
- plat = connection.direct_platform('linux')
48
- plat.name.must_equal 'linux'
49
- plat.family_hierarchy.must_equal ['linux', 'unix']
47
+ plat = connection.direct_platform('mac_os_x')
48
+ plat.name.must_equal 'mac_os_x'
49
+ plat.linux?.must_equal false
50
+ plat.cloud?.must_equal false
51
+ plat.unix?.must_equal true
52
+ plat.family.must_equal 'darwin'
53
+ plat.family_hierarchy.must_equal ['darwin', 'bsd', 'unix']
54
+ end
55
+
56
+ it 'provides api direct platform' do
57
+ plat = connection.direct_platform('aws')
58
+ plat.name.must_equal 'aws'
59
+ plat.linux?.must_equal false
60
+ plat.cloud?.must_equal true
61
+ plat.family.must_equal 'cloud'
62
+ plat.family_hierarchy.must_equal ['cloud', 'api']
63
+ end
64
+
65
+ it 'provides api direct platform with platform options' do
66
+ aws_version = Gem.loaded_specs['aws-sdk'].version
67
+ aws_version = "aws-sdk-v#{aws_version}"
68
+ details = { release: aws_version }
69
+ plat = connection.direct_platform('aws', details)
70
+ plat.name.must_equal 'aws'
71
+ plat.release.must_equal aws_version
72
+ plat[:release].must_equal aws_version
50
73
  end
51
74
 
52
75
  it 'provides family hierarchy' do
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: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominik Richter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-08 00:00:00.000000000 Z
11
+ date: 2018-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -190,6 +190,9 @@ files:
190
190
  - README.md
191
191
  - Rakefile
192
192
  - lib/train.rb
193
+ - lib/train/.git/HEAD
194
+ - lib/train/.git/config
195
+ - lib/train/.git/hooks/pre-push
193
196
  - lib/train/errors.rb
194
197
  - lib/train/extras.rb
195
198
  - lib/train/extras/command_wrapper.rb