Skip to content

Commit

Permalink
Use more expressive APIs for shorter code
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl committed Nov 22, 2023
1 parent eb56cdd commit 91bad04
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
6 changes: 1 addition & 5 deletions lib/beaker/host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -489,11 +489,7 @@ def do_rsync_to from_path, to_path, opts = {}
# We enable achieve mode and compression
rsync_args << "-az"

user = if not self['user']
"root"
else
self['user']
end
user = self['user'] || 'root'
hostname_with_user = "#{user}@#{reachable_name}"

Rsync.host = hostname_with_user
Expand Down
4 changes: 1 addition & 3 deletions lib/beaker/platform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,7 @@ def to_array
# @example Platform.new('debian-7-xxx').with_version_codename == 'debian-wheezy-xxx'
# @return [String] the platform string with the platform version represented as a codename
def with_version_codename
version_array = [@variant, @version, @arch]
version_array = [@variant, @codename, @arch] if @codename
return version_array.join('-')
[@variant, @codename || @version, @arch].join('-')
end

# Returns the platform string with the platform version as a number. If no conversion is necessary
Expand Down

0 comments on commit 91bad04

Please sign in to comment.