class Glue::Mounters

Attributes

target[R]
warnings[R]

Public Class Methods

add(klass) click to toggle source
# File lib/glue/mounters.rb, line 11
def self.add klass
  @mounters << klass unless @mounters.include? klass
end
get_mounter_name(mounter_class) click to toggle source
# File lib/glue/mounters.rb, line 47
 def self.get_mounter_name mounter_class
  mounter_class.to_s.split("::").last
end
mount(tracker) click to toggle source
# File lib/glue/mounters.rb, line 27
def self.mount tracker
      target = tracker.options[:target]
      Glue.debug "Mounting target: #{target}"
      trigger = Glue::Event.new(tracker.options[:appname])
      @mounters.each do | c |
        mounter = c.new trigger, tracker.options
        begin
             Glue.debug "Checking about mounting #{target} with #{mounter}"
          if mounter.supports? target
               Glue.notify "Mounting #{target} with #{mounter}"
               path = mounter.mount target
               Glue.notify "Mounted #{target} with #{mounter}"
                return path
             end
        rescue => e
             Glue.notify e.message
        end
      end
end
mounters() click to toggle source
# File lib/glue/mounters.rb, line 15
def self.mounters
      @mounters
end
new() click to toggle source
# File lib/glue/mounters.rb, line 19
def initialize
      @warnings = []
end

Public Instance Methods

add_warning(warning) click to toggle source
# File lib/glue/mounters.rb, line 23
def add_warning warning
  @warnings << warning
end