Class: Justy::Finder
- Inherits:
-
Object
- Object
- Justy::Finder
- Defined in:
- lib/justy/finder.rb
Instance Attribute Summary collapse
-
#find_command ⇒ Object
readonly
Returns the value of attribute find_command.
-
#parser ⇒ Object
readonly
Returns the value of attribute parser.
Instance Method Summary collapse
- #folder_for_options(options) ⇒ Object
-
#initialize ⇒ Finder
constructor
A new instance of Finder.
- #run(args) ⇒ Object
Constructor Details
Instance Attribute Details
#find_command ⇒ Object (readonly)
Returns the value of attribute find_command.
10 11 12 |
# File 'lib/justy/finder.rb', line 10 def find_command @find_command end |
#parser ⇒ Object (readonly)
Returns the value of attribute parser.
9 10 11 |
# File 'lib/justy/finder.rb', line 9 def parser @parser end |
Instance Method Details
#folder_for_options(options) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/justy/finder.rb', line 28 def () if ([:relative]) folder_path = Dir.pwd if ([:folder]) folder_path = folder_path + "/" + [:folder] end else folder_path = [:folder] end return folder_path end |
#run(args) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/justy/finder.rb', line 17 def run(args) = @parser.parse(args) if (![:type].nil?) @find_command = FindCommandFactory.create_command([:type].to_sym) folder = () @find_command.run(folder) else puts @parser. end end |