module Noty

Constants

STORAGE_PATH
VERSION

Public Instance Methods

bookmark() click to toggle source
# File lib/noty.rb, line 55
def bookmark
  bm = Bookmark.from_url(ARGV.first)
  bm.save
  bm.edit
end
help() click to toggle source
# File lib/noty.rb, line 15
  def help
    version
    puts <<-EOT
Snippets and bookmarks manager.

Usage:
  noty [command|inputs]

Commands:
  help, -h, --help : print this message
  version, -v, --version : print noty version

Input types:
  url: e.g "http://www.example.com", add URL as a bookmark file
  keyword: search bookmarks and perform action on it, a single word of multiple words or regex, it is passed to "ag silver searcher"
  snippet text: any multiword text, it will search first if no files contain this text you'll be asked if you want to create a snippet for it
EOT
  end
snippet() click to toggle source
# File lib/noty.rb, line 46
def snippet
  content = ARGV.join ' '
  path = File.join(Noty::STORAGE_PATH, Time.now.to_i.to_s + '.snippet')

  snippet = Snippet.new(path)
  snippet.content = content
  snippet.save
end
version() click to toggle source
# File lib/noty.rb, line 11
def version
  puts "Noty version #{VERSION}"
end