bin/rubyc in rubyc-0.0.3 vs bin/rubyc in rubyc-0.0.4
- old
+ new
@@ -64,9 +64,19 @@
proc.call(line).chomp
end
puts counts.to_yaml
end
+ desc :sort_by, "Sort by"
+ def sort_by(code = nil)
+ code ||= "line"
+ proc = eval( "Proc.new{|line| l = line; #{code}}" )
+ counts = STDIN.sort_by do |line|
+ proc.call(line)
+ end
+ puts counts
+ end
+
desc :uniq, "uniq"
def uniq
puts STDIN.to_a.uniq
end