module Warp::Dir
Constants
- DOTFILES
- INSTALL_NOTICE
- INSTALL_TIME
tried in order.
- SERIALIZERS
- SHELL_WRAPPER_DEST
- SHELL_WRAPPER_FILE
- SHELL_WRAPPER_REGX
- SHELL_WRAPPER_SRCE
- VERSION
Public Class Methods
absolute(path)
click to toggle source
# File lib/warp/dir.rb, line 35 def absolute(path) path.gsub '~', ::Dir.home end
commander()
click to toggle source
# File lib/warp/dir.rb, line 61 def commander ::Warp::Dir::Commander.instance end
default_config()
click to toggle source
# File lib/warp/dir.rb, line 39 def default_config relative Warp::Dir::Config::DEFAULTS[:warprc] end
eval_context?()
click to toggle source
# File lib/warp/dir.rb, line 23 def eval_context? ENV['WARP_DIR_SHELL'] == 'yes' end
on(type, &block)
click to toggle source
# File lib/warp/dir.rb, line 57 def on(type, &block) Warp::Dir::App::Response.new.type(type).configure(&block) end
pwd()
click to toggle source
# File lib/warp/dir.rb, line 27 def pwd %x(pwd).chomp.gsub ::Dir.home, '~' end
relative(path)
click to toggle source
# File lib/warp/dir.rb, line 31 def relative(path) path.gsub ::Dir.home, '~' end
require_all_from(folder)
click to toggle source
# File lib/warp/dir.rb, line 19 def require_all_from(folder) ::Dir.glob("#{Warp::PROJECT_LIBS}#{folder}/*.rb") { |file| Kernel.require file } end
sort_by(collection, field)
click to toggle source
# File lib/warp/dir.rb, line 43 def sort_by(collection, field) collection.sort { |a, b| a.send(field) <=> b.send(field) } end