Sha256: c902c828102febe0dff0f17cdbfb065b38856980c2d1e75c0960445f372798a5
Contents?: true
Size: 1.78 KB
Versions: 2
Compression:
Stored size: 1.78 KB
Contents
module Bowline # Provides paths to Bowline's required libraries. module Library PROJECT_URL = "http://bowline.s3.amazonaws.com/#{Platform.type}" DESKTOP_URL = "#{PROJECT_URL}/bowline-desktop" RUBYLIB_URL = "#{PROJECT_URL}/rubylib.zip" # Path to a folder stored under the users # home directory containing the downloaded libraries. def path File.expand_path( File.join(home_path, ".bowline") ) end module_function :path # Path to the bowline-desktop binary def desktop_path File.join(path, "bowline-desktop") end module_function :desktop_path # Path to Ruby's stdlib def rubylib_path File.join(path, "rubylib") end module_function :rubylib_path def local_bowline_path File.join(APP_ROOT, "vendor", "bowline") end module_function :local_bowline_path def local_rubylib_path File.join(APP_ROOT, "vendor", "rubylib") end module_function :local_rubylib_path def local_build_path File.join(APP_ROOT, "build") end module_function :local_build_path # Returns true if all required libraries exist. def ready? File.exist?(desktop_path) && File.directory?(rubylib_path) && File.directory?(local_bowline_path) end module_function :ready? private # Borrowed from Rubygems def home_path ['HOME', 'USERPROFILE'].each do |homekey| return ENV[homekey] if ENV[homekey] end if ENV['HOMEDRIVE'] && ENV['HOMEPATH'] then return "#{ENV['HOMEDRIVE']}#{ENV['HOMEPATH']}" end begin File.expand_path("~") rescue File::ALT_SEPARATOR ? "C:/" : "/" end end module_function :home_path end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
bowline-0.5.6 | lib/bowline/library.rb |
bowline-0.5.5 | lib/bowline/library.rb |