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