On Fri, Oct 30, 2020 at 03:34:50PM +0800, Xu Xijian wrote:
On Fri, Oct 30, 2020 at 03:07:29PM +0800, Lin Jiaxin wrote:
On Fri, Oct 30, 2020 at 02:56:50PM +0800, Luan Shengde wrote:
[why]: esaier for user to config the default yaml file
[how]: when get request data, parse the data and write the user infos to
- def setup_default_yaml(account)
- default_yaml_dir = File.join('/home', account, '.config/compass-ci/defaults')
- FileUtils.mkdir_p default_yaml_dir
- File.open("#{default_yaml_dir}/#{account}.yaml", 'a') do |file|
file.puts "my_email: #{@data['my_email']}"
file.puts "my_name: #{@data['my_name']}" if @data.key? 'my_name'
file.puts "my_uuid: #{@data['my_uuid']}" if @data.key? 'my_uuid'
file.puts "lab: #{@data['lab']}" if @data.key? 'lab'
file.puts "my_email: #{@data['my_email']}" file.puts "my_name: #{@data['my_name']}" if @data.key? 'my_name' file.puts "my_uuid: #{@data['my_uuid']}" if @data.key? 'my_uuid' file.puts "lab: #{@data['lab']}" if @data.key? 'lab'
align with if
Thanks, Jiaxin
How about this: file.puts "my_email: #{@data['my_email']}" file.puts "my_name: #{@data['my_name']}" if @data.key? 'my_name' file.puts "my_uuid: #{@data['my_uuid']}" if @data.key? 'my_uuid' file.puts "lab: #{@data['lab']}" if @data.key? 'lab'
yes, this can pass the rubocop
Thanks Luan Shengde
Thanks, Xijian