Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rubocop code style improvements
Browse files Browse the repository at this point in the history
lacostej committed Nov 21, 2019
1 parent 96a8eee commit 34bca38
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions lib/u3d/commands.rb
Original file line number Diff line number Diff line change
@@ -275,10 +275,8 @@ def cache_versions(os, offline: false, force_refresh: false, central_cache: true

def verify_package_names(packages, definition)
unless packages.nil?
invalid_packages = packages.select { |package| !definition.available_package? package }
unless invalid_packages.empty?
raise ArgumentError, "Package(s) '#{invalid_packages.join(',')}' are not known. Use #{definition.available_packages.join(',')}"
end
invalid_packages = packages.reject { |package| definition.available_package? package }
raise ArgumentError, "Package(s) '#{invalid_packages.join(',')}' are not known. Use #{definition.available_packages.join(',')}" unless invalid_packages.empty?
end
packages
end
@@ -437,4 +435,4 @@ def get_administrative_privileges(options)
end

class InstallationSetupError < StandardError
end
end
4 changes: 2 additions & 2 deletions spec/u3d/commands_spec.rb
Original file line number Diff line number Diff line change
@@ -359,7 +359,7 @@
]
)

expect{
expect do
U3d::Commands.install(
args: ['1.2.3f4'],
options: {
@@ -368,7 +368,7 @@
packages: ['not.a.package']
}
)
}.to raise_error ArgumentError, /'not.a.package'/
end.to raise_error ArgumentError, /'not.a.package'/
end
# support downloading the not current platform -> not yet supported
# TODO: Implement me

0 comments on commit 34bca38

Please sign in to comment.