Class: WordCountRecursive::Command
- Inherits:
-
Object
- Object
- WordCountRecursive::Command
- Defined in:
- lib/wcr/command.rb
Instance Method Summary collapse
-
#initialize ⇒ Command
constructor
A new instance of Command.
- #wcr ⇒ Object
Constructor Details
#initialize ⇒ Command
Returns a new instance of Command.
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/wcr/command.rb', line 3 def initialize @paths, = ::WordCountRecursive::ArgumentsParser.new.parse if .include? :version puts [:version] exit(1) end @command = `wc #{@options[:command_opts]} #{"\`find #{@paths || '.'} -type f #{@options[:hidden_files]}\`"}` @command = @command.split('\n').grep(/^[^\.]/) end |
Instance Method Details
#wcr ⇒ Object
15 16 17 |
# File 'lib/wcr/command.rb', line 15 def wcr @command.each {|line| puts line.chomp } end |