Class: Pipeline::Mounters

Inherits:
Object
  • Object
show all
Defined in:
lib/pipeline/mounters.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMounters

Returns a new instance of Mounters.



19
20
21
# File 'lib/pipeline/mounters.rb', line 19

def initialize
	@warnings = []
end

Instance Attribute Details

#targetObject (readonly)

Returns the value of attribute target.



8
9
10
# File 'lib/pipeline/mounters.rb', line 8

def target
  @target
end

#warningsObject (readonly)

Returns the value of attribute warnings.



9
10
11
# File 'lib/pipeline/mounters.rb', line 9

def warnings
  @warnings
end

Class Method Details

.add(klass) ⇒ Object



11
12
13
# File 'lib/pipeline/mounters.rb', line 11

def self.add klass
  @mounters << klass unless @mounters.include? klass
end

.get_mounter_name(mounter_class) ⇒ Object



47
48
49
# File 'lib/pipeline/mounters.rb', line 47

def self.get_mounter_name mounter_class
  mounter_class.to_s.split("::").last
end

.mount(tracker) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/pipeline/mounters.rb', line 27

def self.mount tracker
	target = tracker.options[:target]
	Pipeline.debug "Mounting target: #{target}"
	trigger = Pipeline::Event.new(tracker.options[:appname])
	@mounters.each do | c |
	  mounter = c.new trigger, tracker.options
  begin 
 	Pipeline.debug "Checking about mounting #{target} with #{mounter}"
	    if mounter.supports? target
 	  Pipeline.notify "Mounting #{target} with #{mounter}"
 	  path = mounter.mount target
 	  Pipeline.notify "Mounted #{target} with #{mounter}"
  return path
 	end
 rescue => e 
 	Pipeline.notify e.message
 end
	end
end

.mountersObject



15
16
17
# File 'lib/pipeline/mounters.rb', line 15

def self.mounters
	@mounters
end

Instance Method Details

#add_warning(warning) ⇒ Object



23
24
25
# File 'lib/pipeline/mounters.rb', line 23

def add_warning warning
  @warnings << warning
end