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.
Files changed (3) hide show
  1. data/bin/rubyc +10 -0
  2. data/lib/rubyc/version.rb +1 -1
  3. 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
@@ -1,3 +1,3 @@
1
1
  module Rubyc
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyc
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Martin Chabot