aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Brett Witherspoon <spoonb@exherbo.org> 2011-02-24 02:45:07 +0000
committerAvatar Brett Witherspoon <spoonb@exherbo.org> 2011-02-24 02:45:07 +0000
commit972fbcc9f989780169765aa8d0515d178de03785 (patch)
treeeba25f26e84c2f77f53ecfed2ee5a5220db9481b
parent54d823d99c802c5ac6228315a10dbcf06e854a56 (diff)
downloaddexter-972fbcc9f989780169765aa8d0515d178de03785.tar.gz
dexter-972fbcc9f989780169765aa8d0515d178de03785.tar.xz
cleanup
-rwxr-xr-xdexter.rb30
1 files changed, 14 insertions, 16 deletions
diff --git a/dexter.rb b/dexter.rb
index bc31b3c..5c3e7e0 100755
--- a/dexter.rb
+++ b/dexter.rb
@@ -35,7 +35,7 @@ module Enumerable
def group_by
res = []
prev = nil
- each do | item |
+ each do |item|
curr = yield item
res << [] if res.empty? || curr != prev
res.last << item
@@ -53,7 +53,7 @@ class Graveyard
end
def string
- return @graves.string
+ @graves.string
end
def find_pos(qpn)
@@ -78,7 +78,6 @@ class Graveyard
end
end
pos = Position.new(cat_pos, pkg_pos)
- return pos
else
until @graves.eos?
if @graves.check(/^[-\w]+\/\s*\n/)
@@ -99,7 +98,6 @@ class Graveyard
end
end
pos = Position.new(cat_pos, nil)
- return pos
end
end
@@ -107,7 +105,7 @@ class Graveyard
name.strip!
name.delete! "-"
name.delete! "/"
- return name
+ name
end
end
@@ -124,24 +122,24 @@ class Victim
end
def repo
- return @repo.nil? ? nil : @repo.name
+ @repo.nil? ? nil : @repo.name
end
def is_repo?
- return @is_repo
+ @is_repo
end
def is_pkg?
- return @is_pkg
+ @is_pkg
end
protected
- def bury_single(qpn)
+ def bury_slots(qpn=@qpn)
commit_id = ""
- user_name = "#{`git config --get user.name`.strip} " + "<#{`git config --get user.email`.strip}>"
homepage = "[no homepage available]"
desc = "[no description available]"
+ user_name = "#{`git config --get user.name`.strip} " + "<#{`git config --get user.email`.strip}>"
grave = ""
if self.is_pkg?
@@ -156,7 +154,7 @@ protected
Paludis::Generator::Package.new(qpn) &
Paludis::Generator::InRepository.new(@repo.name) |
Paludis::Filter::SupportsAction.new(Paludis::InstallAction))].
- group_by { | id | id.slot_key.value }
+ group_by { |id| id.slot_key.value }
first_slot_in_pkg = true
@@ -194,7 +192,7 @@ protected
grave << " removed-by = #{user_name}\n"
grave << " removed-from = #{@repo.name}\n"
end
- return grave
+ grave
end
end
@@ -209,7 +207,7 @@ class Victim::Package < Victim
end
def bury
- return self.bury_single(@qpn)
+ self.bury_slots
end
end
@@ -226,10 +224,10 @@ class Victim::Repository < Victim
@repo.category_names do |cat|
graves << "#{cat}/\n" if not @repo.package_names(cat).empty?
@repo.package_names(cat) do |qpn|
- graves << self.bury_single(qpn)
+ graves << self.bury_slots(qpn)
end
end
- return graves
+ graves
end
end
@@ -249,7 +247,7 @@ targets = []
comment = nil
envspec = ""
-options.each do | opt, arg |
+options.each do |opt, arg|
case opt
when '--help'
puts "Usage: #$0 [OPTIONS] package1 package2 ..."