class Dcs::Debian::Command
Public Class Methods
define_commands(name)
click to toggle source
# File lib/dcs/debian.rb, line 13 def self.define_commands(name) desc "#{name} KEYWORD", "Search debian/#{name} file" define_method(name) do |*args, &block| dcs_search(name.to_s, args[0]) end end
Private Instance Methods
dcs_search(file, keyword)
click to toggle source
# File lib/dcs/debian.rb, line 26 def dcs_search(file, keyword) client = Searcher.new client.pagination(file, keyword) do |context| puts sprintf("%s (%s)", context[:path].bold.white_on_green, context[:url].white_on_blue) puts context[:pre].gsub(/#{keyword}/, '\&'.red_on_yellow) end end
method_missing(id, *arguments)
click to toggle source
# File lib/dcs/debian.rb, line 36 def method_missing(id, *arguments) dcs_search(id.to_s, arguments[0]) end