AGRFを1回のみ使う
This commit is contained in:
parent
d38889ea48
commit
3e8b029d8e
1 changed files with 5 additions and 6 deletions
11
wc.rb
11
wc.rb
|
@ -24,12 +24,11 @@ def count_file_stats(input)
|
||||||
end
|
end
|
||||||
|
|
||||||
def process_input(source)
|
def process_input(source)
|
||||||
input = if source == '-'
|
if source == '-'
|
||||||
$stdin.read
|
count_file_stats(ARGF)
|
||||||
else
|
else
|
||||||
File.read(source)
|
count_file_stats(File.read(source))
|
||||||
end
|
end
|
||||||
count_file_stats(input)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_totals(totals, stats)
|
def update_totals(totals, stats)
|
||||||
|
|
Loading…
Reference in a new issue