class Alfred::Workflow

Constants

CACHE_DIR
DATA_DIR

Attributes

bundle_id[R]

Public Class Methods

new(bundle_id) click to toggle source
# File lib/alfredlite/workflow.rb, line 9
def initialize(bundle_id)
  @bundle_id = bundle_id
end

Private Class Methods

mkdir(path) click to toggle source
# File lib/alfredlite/workflow.rb, line 30
def self.mkdir(path)
  FileUtils.mkdir_p(path) unless File.exists?(path)
end

Public Instance Methods

feedback_items() click to toggle source
# File lib/alfredlite/feedback.rb, line 5
def feedback_items
  @feedback_items ||= []
end
feedback_xml() click to toggle source
# File lib/alfredlite/feedback.rb, line 9
def feedback_xml
  doc = REXML::Document.new
  doc << REXML::Element.new('items')
  feedback_items.each { |item| doc.root << item.to_xml }

  doc
end
query(input) click to toggle source
# File lib/alfredlite/workflow.rb, line 25
def query(input)
end
storage_path() click to toggle source
# File lib/alfredlite/workflow.rb, line 13
def storage_path
  @storage_path ||= File.join(ENV['HOME'], DATA_DIR, bundle_id)
  self.class.mkdir(@storage_path)
  @storage_path
end
volatile_storage_path() click to toggle source
# File lib/alfredlite/workflow.rb, line 19
def volatile_storage_path
  @volatile_storage_path ||= File.join(ENV['HOME'], CACHE_DIR, bundle_id)
  self.class.mkdir(@volatile_storage_path)
  @volatile_storage_path
end