cookstyle
This commit is contained in:
Родитель
550cc0dae9
Коммит
c87dfdc9cd
|
@ -25,7 +25,6 @@ module MacOS
|
|||
end
|
||||
|
||||
def convert_array_to_string(value)
|
||||
|
||||
end
|
||||
|
||||
def convert_to_string_from_data_type(value)
|
||||
|
@ -39,7 +38,7 @@ module MacOS
|
|||
when TrueClass
|
||||
"-bool #{value}"
|
||||
when Hash
|
||||
"-dict #{value.map { |key,value| Shellwords.shellescape(key) + ' ' + convert_to_string_from_data_type(value)}.join(' ')}"
|
||||
"-dict #{value.map { |key, value| Shellwords.shellescape(key) + ' ' + convert_to_string_from_data_type(value) }.join(' ')}"
|
||||
when String
|
||||
"-string #{Shellwords.shellescape(value)}"
|
||||
when Float
|
||||
|
|
|
@ -147,15 +147,15 @@ describe MacOS::PlistHelpers, '#convert_to_string_from_data_type' do
|
|||
end
|
||||
|
||||
it 'returns the required dictionary entry' do
|
||||
expect(convert_to_string_from_data_type({'a' => 'b', 'c' => 'd'})).to eq '-dict a -string b c -string d'
|
||||
expect(convert_to_string_from_data_type({ 'a' => 'b', 'c' => 'd' })).to eq '-dict a -string b c -string d'
|
||||
end
|
||||
|
||||
it 'returns the required dictionary entry with embedded quotes and numbers' do
|
||||
expect(convert_to_string_from_data_type({'a' => 3, 'c' => '"d"'})).to eq '-dict a -integer 3 c -string \"d\"'
|
||||
expect(convert_to_string_from_data_type({ 'a' => 3, 'c' => '"d"' })).to eq '-dict a -integer 3 c -string \"d\"'
|
||||
end
|
||||
|
||||
it 'returns the required array entry' do
|
||||
expect(convert_to_string_from_data_type(['a', 'b', 'c'])).to eq '-array -string a -string b -string c'
|
||||
expect(convert_to_string_from_data_type(%w(a b c))).to eq '-array -string a -string b -string c'
|
||||
end
|
||||
|
||||
it 'returns the required array entry with embedded quotes' do
|
||||
|
|
|
@ -3,7 +3,8 @@ user_home = File.join('/', 'Users', user)
|
|||
|
||||
if Gem::Version.new(node['platform_version']) >= Gem::Version.new('10.13')
|
||||
admin_credentials = ['-adminUser', node['macos']['admin_user'], '-adminPassword', node['macos']['admin_password']]
|
||||
else ''
|
||||
else
|
||||
''
|
||||
end
|
||||
|
||||
execute "add user #{user}" do
|
||||
|
|
Загрузка…
Ссылка в новой задаче