Skip to content

Commit

Permalink
new rubocop: apply -A
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Dec 29, 2023
1 parent 806906e commit 4bc5880
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/lib/users/ssh_public_key.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def initialize(raw)
#
# @return [String] Comment field
def comment
@comment ||= raw.split(" ")[2]
@comment ||= raw.split[2]
end

# Returns the string version of the public key
Expand Down
2 changes: 1 addition & 1 deletion src/lib/y2users/linux/set_user_password_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def chpasswd_options
def chage_options
return [] unless user.password

opts = chage_options_hash.reject { |_, v| v.nil? }.flatten
opts = chage_options_hash.compact.flatten
return [] if opts.empty?

opts + root_path_options
Expand Down
2 changes: 1 addition & 1 deletion src/lib/y2users/username.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class << self
# @param text [String] text for generating the username (usually the user fullname)
# @return [String] a valid username
def generate_from(text)
username = text.split(" ").first || ""
username = text.split.first || ""
username = transliterate(username)
username = sanitize(username)
username.downcase
Expand Down
4 changes: 2 additions & 2 deletions src/lib/y2users/users_module/reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def read_users(system_config, target_config)
["local", "system"].each do |type|
next unless removed_users[type]

removed_users[type].values.each { |u| system_config.attach(user(u, system_config)) }
removed_users[type].each_value { |u| system_config.attach(user(u, system_config)) }
end
end

Expand All @@ -142,7 +142,7 @@ def read_groups(system_config, target_config)
["local", "system"].each do |type|
next unless removed_groups[type]

removed_groups[type].values.each { |u| system_config.attach(group(u)) }
removed_groups[type].each_value { |u| system_config.attach(group(u)) }
end
end

Expand Down

0 comments on commit 4bc5880

Please sign in to comment.