Class: Filerary::Command

Inherits:
Thor
  • Object
show all
Defined in:
lib/filerary/command.rb

Instance Method Summary collapse

Instance Method Details

#cleanupObject



42
43
44
# File 'lib/filerary/command.rb', line 42

def cleanup
  Filerary::Librarian.new.cleanup
end

#collect(*files) ⇒ Object



18
19
20
# File 'lib/filerary/command.rb', line 18

def collect(*files)
  Filerary::Librarian.new.collect(files)
end

#destroyObject



56
57
58
# File 'lib/filerary/command.rb', line 56

def destroy
  Filerary::Librarian.new.destroy
end

#listObject



13
14
15
# File 'lib/filerary/command.rb', line 13

def list
  puts Filerary::Librarian.new.list
end

#remove(path) ⇒ Object



47
48
49
50
51
52
53
# File 'lib/filerary/command.rb', line 47

def remove(path)
  begin
    Filerary::Librarian.new.remove(path)
  rescue ArgumentError => e
    STDERR.puts "#{e.class}: #{e.message}: #{path}"
  end
end

#search(word) ⇒ Object



23
24
25
# File 'lib/filerary/command.rb', line 23

def search(word)
  puts Filerary::Librarian.new.search(word)
end

#show(path) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/filerary/command.rb', line 28

def show(path)
  begin
    puts Filerary::Librarian.new.show(path)
  rescue ArgumentError => e
    STDERR.puts "#{e.class}: #{e.message}: #{path}"
  end
end

#updateObject



37
38
39
# File 'lib/filerary/command.rb', line 37

def update
  Filerary::Librarian.new.update
end

#versionObject



8
9
10
# File 'lib/filerary/command.rb', line 8

def version
  puts VERSION
end