rubyc 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/rubyc +5 -5
- data/lib/rubyc/version.rb +1 -1
- metadata +4 -4
data/bin/rubyc
CHANGED
@@ -34,7 +34,7 @@ class Rubyc < Thor
|
|
34
34
|
def map(code)
|
35
35
|
proc = eval( "Proc.new{|line| l = line; #{code}}" )
|
36
36
|
STDIN.map do |line|
|
37
|
-
puts proc.call(line).to_s
|
37
|
+
puts proc.call(line.chomp).to_s
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
@@ -43,7 +43,7 @@ class Rubyc < Thor
|
|
43
43
|
code ||= "line"
|
44
44
|
proc = eval("Proc.new{|line| l = line; #{code}}")
|
45
45
|
sum = STDIN.sum do |line|
|
46
|
-
proc.call(line).to_f
|
46
|
+
proc.call(line.chomp).to_f
|
47
47
|
end
|
48
48
|
puts sum
|
49
49
|
end
|
@@ -52,7 +52,7 @@ class Rubyc < Thor
|
|
52
52
|
def select(code)
|
53
53
|
proc = eval( "Proc.new{|line| l = line; #{code}}" )
|
54
54
|
STDIN.map do |line|
|
55
|
-
puts line if proc.call(line)
|
55
|
+
puts line if proc.call(line.chomp)
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
@@ -61,7 +61,7 @@ class Rubyc < Thor
|
|
61
61
|
code ||= "line"
|
62
62
|
proc = eval( "Proc.new{|line| l = line; #{code}}" )
|
63
63
|
counts = STDIN.count_by do |line|
|
64
|
-
proc.call(line
|
64
|
+
proc.call(line.chomp)
|
65
65
|
end
|
66
66
|
puts counts.to_yaml
|
67
67
|
end
|
@@ -71,7 +71,7 @@ class Rubyc < Thor
|
|
71
71
|
code ||= "line"
|
72
72
|
proc = eval( "Proc.new{|line| l = line; #{code}}" )
|
73
73
|
counts = STDIN.sort_by do |line|
|
74
|
-
proc.call(line)
|
74
|
+
proc.call(line.chomp)
|
75
75
|
end
|
76
76
|
puts counts
|
77
77
|
end
|
data/lib/rubyc/version.rb
CHANGED
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:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 10
|
10
|
+
version: 0.0.10
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Martin Chabot
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-06-02 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|