Class: Findrr::Command
- Inherits:
-
Thor
- Object
- Thor
- Findrr::Command
- Defined in:
- lib/findrr/command.rb
Instance Method Summary collapse
Instance Method Details
#collect(path) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/findrr/command.rb', line 14 def collect(path) Config.new.save(path) begin Database.new.collect(path) rescue => e $stderr.puts <<-END_OF_MESSAGE #{e.class}: #{e.} Hint: table schema might be changed. Please try `findrr destroy` command. END_OF_MESSAGE end end |
#destroy ⇒ Object
39 40 41 |
# File 'lib/findrr/command.rb', line 39 def destroy Database.new.destroy end |
#search(part_of_filename) ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/findrr/command.rb', line 27 def search(part_of_filename) begin Database.new.search(part_of_filename) rescue => e $stderr.puts <<-END_OF_MESSAGE #{e.class}: #{e.} Hint: database probably isn't created. Please try `findrr collect` command. END_OF_MESSAGE end end |
#version ⇒ Object
9 10 11 |
# File 'lib/findrr/command.rb', line 9 def version puts VERSION end |