Skip to content

Commit 00e3c3f

Browse files
committed
fixing lint errors and add header to libraries/docker.rb
Signed-off-by: Patrick Münch <patrick.muench1111@gmail.com>
1 parent f52dbc0 commit 00e3c3f

2 files changed

Lines changed: 30 additions & 10 deletions

File tree

controls/docker_level1.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -581,13 +581,13 @@
581581
info['Mounts'].each do |mounts|
582582
describe mounts['Source'] do
583583
it { should_not eq '/' }
584-
it { should_not match(/\/boot/) }
585-
it { should_not match(/\/dev/) }
586-
it { should_not match(/\/etc/) }
587-
it { should_not match(/\/lib/) }
588-
it { should_not match(/\/proc/) }
589-
it { should_not match(/\/sys/) }
590-
it { should_not match(/\/usr/) }
584+
it { should_not match(%r{\/boot}) }
585+
it { should_not match(%r{\/dev}) }
586+
it { should_not match(%r{\/etc}) }
587+
it { should_not match(%r{\/lib}) }
588+
it { should_not match(%r{\/proc}) }
589+
it { should_not match(%r{\/sys}) }
590+
it { should_not match(%r{\/usr}) }
591591
end
592592
end
593593
end

libraries/docker.rb

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
# encoding: utf-8
2+
#
3+
# Copyright 2016, Christoph Hartmann
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# author: Christoph Hartmann
18+
# author: Dominik Richter
19+
# author: Patrick Muench
20+
121
require 'yaml'
222

323
class Docker < Inspec.resource(1)
@@ -26,7 +46,7 @@ def path
2646
params = parse_systemd_values(cmd.stdout.chomp)
2747

2848
# return the value
29-
params["FragmentPath"]
49+
params['FragmentPath']
3050
end
3151

3252
def socket
@@ -37,7 +57,7 @@ def socket
3757
params = parse_systemd_values(cmd.stdout.chomp)
3858

3959
# return the value
40-
params["FragmentPath"]
60+
params['FragmentPath']
4161
end
4262

4363
private
@@ -47,7 +67,7 @@ def parse_systemd_values(stdout)
4767
SimpleConfig.new(
4868
stdout,
4969
assignment_re: /^\s*([^=]*?)\s*=\s*(.*?)\s*$/,
50-
multiple_values: false,
70+
multiple_values: false
5171
).params
5272
end
5373
end

0 commit comments

Comments
 (0)