summaryrefslogtreecommitdiff
path: root/apkbuild-gem-resolver.in
diff options
context:
space:
mode:
Diffstat (limited to 'apkbuild-gem-resolver.in')
-rw-r--r--apkbuild-gem-resolver.in10
1 files changed, 5 insertions, 5 deletions
diff --git a/apkbuild-gem-resolver.in b/apkbuild-gem-resolver.in
index e4ef424..9622928 100644
--- a/apkbuild-gem-resolver.in
+++ b/apkbuild-gem-resolver.in
@@ -21,7 +21,7 @@ class Package
@@augeas.load
apath = '/files' + dir
- fail if @@augeas.match("/augeas#{apath}//error").length > 0
+ fail unless @@augeas.match("/augeas#{apath}//error").empty?
repos = ['main']
repos << 'testing' if testing
@@ -271,7 +271,7 @@ class Update
def check_deps
specs, errors = Gem::SpecFetcher::fetcher.spec_for_dependency(dependency)
- raise "Invalid gem: #{@name}-#{version}" if specs.length == 0
+ raise "Invalid gem: #{@name}-#{version}" if specs.empty?
fail if specs.length > 1
deps = specs[0][0].runtime_dependencies
@@ -285,7 +285,7 @@ class Update
end
end
- if deps.length > 0
+ unless deps.empty?
raise 'Undeclared dependencies in ' + @package.name + deps.inject('') {
|s, dep| "#{s}\n#{dep.name} #{dep.requirements_list.join ' '}"
}
@@ -293,7 +293,7 @@ class Update
end
def update
- updated? || @obsolete_deps.length > 0 ? (
+ updated? || !@obsolete_deps.empty? ? (
{
:name => @package.name,
:version => version,
@@ -331,7 +331,7 @@ update.resolve
for pkg in update
obs = pkg[:obsolete_deps]
- obs = obs.length == 0 ? nil : " (obsolete dependencies: #{obs.join ', '})"
+ obs = obs.empty? ? nil : " (obsolete dependencies: #{obs.join ', '})"
puts "#{pkg[:name]}-#{pkg[:version]}#{obs}"
end