class Feedcellar::Curses::Command
Attributes
database_dir[R]
Public Class Methods
new(*args)
click to toggle source
Calls superclass method
# File lib/feedcellar/curses/command.rb, line 30 def initialize(*args) super default_base_dir = File.join(File.expand_path("~"), ".feedcellar") @base_dir = ENV["FEEDCELLAR_HOME"] || default_base_dir @database_dir = File.join(@base_dir, "db") end
Public Instance Methods
search(*words)
click to toggle source
# File lib/feedcellar/curses/command.rb, line 49 def search(*words) if words.empty? && (options["resource"].nil? || options["resource"].empty?) $stderr.puts "WARNING: required one of word or resource option." return 1 end GroongaDatabase.new.open(@database_dir) do |database| sorted_feeds = GroongaSearcher.search(database, words, options) View.run(sorted_feeds) end end
version()
click to toggle source
# File lib/feedcellar/curses/command.rb, line 38 def version puts VERSION end