diff options
author | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2015-07-09 11:26:34 +0300 |
---|---|---|
committer | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2015-07-09 19:40:38 +0300 |
commit | 8704797efea97c8b01dbb7cdea34c3a701c04e85 (patch) | |
tree | 9028d0b6cba5214fb846d3434ad90310b2b5c3eb /apkbuild-gem-resolver.in | |
parent | 4567343ea079c0c53830fd9f7875c3f29b3c0ace (diff) | |
download | abuild-8704797efea97c8b01dbb7cdea34c3a701c04e85.tar.gz abuild-8704797efea97c8b01dbb7cdea34c3a701c04e85.tar.bz2 abuild-8704797efea97c8b01dbb7cdea34c3a701c04e85.tar.xz abuild-8704797efea97c8b01dbb7cdea34c3a701c04e85.zip |
apkbuild-gem-resolver: use Array.empty?
Diffstat (limited to 'apkbuild-gem-resolver.in')
-rw-r--r-- | apkbuild-gem-resolver.in | 10 |
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 |