r-train 0.11.2 → 0.11.3
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 +4 -4
- data/CHANGELOG.md +18 -2
- data/Gemfile +7 -1
- data/lib/train/extras/stat.rb +2 -3
- data/lib/train/version.rb +1 -1
- data/test/unit/extras/stat_test.rb +38 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25ae706efd7e9f84207d633ab61c5d73ea2101eb
|
4
|
+
data.tar.gz: 3e20d84d3c015686578dc9d463ca7f6e723267fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78854edff4a0765ed4a89f0b43afd0ae17a602ce63002df329bc35d2f27943f5443690d2d9b48e7d28d975ab90dc44c5964c80739a187f03f4068fe018f509b4
|
7
|
+
data.tar.gz: 4dcecbbdcf1343d03287b3356155766756fcc19e7c3f301d9ff4c2e1636bb92c3a92cb472419da31ef34547bf443995cf2ba4e8f9a68492ec1ad7ca9aaa6273c
|
data/CHANGELOG.md
CHANGED
@@ -1,12 +1,28 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## [0.11.
|
4
|
-
[Full Changelog](https://github.com/chef/train/compare/v0.11.
|
3
|
+
## [0.11.3](https://github.com/chef/train/tree/0.11.3) (2016-05-10)
|
4
|
+
[Full Changelog](https://github.com/chef/train/compare/v0.11.2...0.11.3)
|
5
|
+
|
6
|
+
**Fixed bugs:**
|
7
|
+
|
8
|
+
- appveyor fixing... [\#98](https://github.com/chef/train/pull/98) ([arlimus](https://github.com/arlimus))
|
9
|
+
|
10
|
+
**Merged pull requests:**
|
11
|
+
|
12
|
+
- fix: winrm https listener is not configured anymore in appveyor [\#100](https://github.com/chef/train/pull/100) ([chris-rock](https://github.com/chris-rock))
|
13
|
+
- use aix stats implementation for hpux as well [\#99](https://github.com/chef/train/pull/99) ([Anirudh-Gupta](https://github.com/Anirudh-Gupta))
|
14
|
+
|
15
|
+
## [v0.11.2](https://github.com/chef/train/tree/v0.11.2) (2016-04-29)
|
16
|
+
[Full Changelog](https://github.com/chef/train/compare/v0.11.1...v0.11.2)
|
5
17
|
|
6
18
|
**Fixed bugs:**
|
7
19
|
|
8
20
|
- bugfix: windows file failed to initialize with new symlink handler [\#96](https://github.com/chef/train/pull/96) ([arlimus](https://github.com/arlimus))
|
9
21
|
|
22
|
+
**Merged pull requests:**
|
23
|
+
|
24
|
+
- 0.11.2 [\#97](https://github.com/chef/train/pull/97) ([alexpop](https://github.com/alexpop))
|
25
|
+
|
10
26
|
## [v0.11.1](https://github.com/chef/train/tree/v0.11.1) (2016-04-28)
|
11
27
|
[Full Changelog](https://github.com/chef/train/compare/v0.11.0...v0.11.1)
|
12
28
|
|
data/Gemfile
CHANGED
@@ -2,8 +2,14 @@
|
|
2
2
|
source 'https://rubygems.org'
|
3
3
|
gemspec
|
4
4
|
|
5
|
+
# pin dependency for Ruby 1.9.3 since bundler is not
|
6
|
+
# detecting that net-ssh 3 does not work with 1.9.3
|
7
|
+
if Gem::Version.new(RUBY_VERSION) <= Gem::Version.new('1.9.3')
|
8
|
+
gem 'net-ssh', '~> 2.9'
|
9
|
+
end
|
10
|
+
|
5
11
|
group :test do
|
6
|
-
gem 'bundler', '~> 1.
|
12
|
+
gem 'bundler', '~> 1.11'
|
7
13
|
gem 'minitest', '~> 5.8'
|
8
14
|
gem 'rake', '~> 10'
|
9
15
|
gem 'rubocop', '~> 0.36.0'
|
data/lib/train/extras/stat.rb
CHANGED
@@ -21,7 +21,7 @@ module Train::Extras
|
|
21
21
|
|
22
22
|
def self.stat(shell_escaped_path, backend, follow_symlink)
|
23
23
|
# use perl scripts for aix and solaris 10
|
24
|
-
if backend.os.aix? || (backend.os.solaris? && backend.os[:release].to_i < 11)
|
24
|
+
if backend.os.aix? || (backend.os.solaris? && backend.os[:release].to_i < 11) || backend.os.hpux?
|
25
25
|
return aix_stat(shell_escaped_path, backend, follow_symlink)
|
26
26
|
end
|
27
27
|
return bsd_stat(shell_escaped_path, backend, follow_symlink) if backend.os.bsd?
|
@@ -114,10 +114,9 @@ module Train::Extras
|
|
114
114
|
|
115
115
|
res = backend.run_command(stat_cmd)
|
116
116
|
return {} if res.exit_status != 0
|
117
|
-
|
118
117
|
fields = res.stdout.split("\n")
|
118
|
+
return {} if fields.length != 7
|
119
119
|
tmask = fields[0].to_i(8)
|
120
|
-
|
121
120
|
{
|
122
121
|
type: find_type(tmask),
|
123
122
|
mode: tmask & 07777,
|
data/lib/train/version.rb
CHANGED
@@ -107,4 +107,42 @@ describe 'stat' do
|
|
107
107
|
})
|
108
108
|
end
|
109
109
|
end
|
110
|
+
|
111
|
+
describe 'aix stat' do
|
112
|
+
let(:backend) { Minitest::Mock.new }
|
113
|
+
|
114
|
+
it 'ignores failed stat results' do
|
115
|
+
res = Minitest::Mock.new
|
116
|
+
res.expect :stdout, '.....'
|
117
|
+
res.expect :exit_status, 1
|
118
|
+
backend.expect :run_command, res, [String]
|
119
|
+
cls.aix_stat('/path', backend, false).must_equal({})
|
120
|
+
end
|
121
|
+
|
122
|
+
it 'ignores wrong stat results' do
|
123
|
+
res = Minitest::Mock.new
|
124
|
+
res.expect :stdout, ''
|
125
|
+
res.expect :exit_status, 0
|
126
|
+
backend.expect :run_command, res, [String]
|
127
|
+
cls.aix_stat('/path', backend, false).must_equal({})
|
128
|
+
end
|
129
|
+
|
130
|
+
it 'reads correct stat results' do
|
131
|
+
res = Minitest::Mock.new
|
132
|
+
res.expect :stdout, "41777\nroot\n0\nrootz\n1\n1444522445\n360\n"
|
133
|
+
res.expect :exit_status, 0
|
134
|
+
backend.expect :run_command, res, [String]
|
135
|
+
cls.aix_stat('/path', backend, false).must_equal({
|
136
|
+
type: :directory,
|
137
|
+
mode: 01777,
|
138
|
+
owner: 'root',
|
139
|
+
uid: 0,
|
140
|
+
group: 'rootz',
|
141
|
+
gid: 1,
|
142
|
+
mtime: 1444522445,
|
143
|
+
size: 360,
|
144
|
+
selinux_label: nil,
|
145
|
+
})
|
146
|
+
end
|
147
|
+
end
|
110
148
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: r-train
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dominik Richter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -239,7 +239,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
239
239
|
version: '0'
|
240
240
|
requirements: []
|
241
241
|
rubyforge_project:
|
242
|
-
rubygems_version: 2.
|
242
|
+
rubygems_version: 2.4.6
|
243
243
|
signing_key:
|
244
244
|
specification_version: 4
|
245
245
|
summary: Transport interface to talk to different backends.
|