rubyc 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/rubyc +10 -0
- data/lib/rubyc/version.rb +1 -1
- metadata +3 -3
data/bin/rubyc
CHANGED
@@ -66,6 +66,16 @@ class Rubyc < Thor
|
|
66
66
|
puts counts.to_yaml
|
67
67
|
end
|
68
68
|
|
69
|
+
desc :sort_by, "Sort by"
|
70
|
+
def sort_by(code = nil)
|
71
|
+
code ||= "line"
|
72
|
+
proc = eval( "Proc.new{|line| l = line; #{code}}" )
|
73
|
+
counts = STDIN.sort_by do |line|
|
74
|
+
proc.call(line)
|
75
|
+
end
|
76
|
+
puts counts
|
77
|
+
end
|
78
|
+
|
69
79
|
desc :uniq, "uniq"
|
70
80
|
def uniq
|
71
81
|
puts STDIN.to_a.uniq
|
data/lib/rubyc/version.rb
CHANGED
metadata
CHANGED