Class: Pipeline::Mounters
- Inherits:
-
Object
- Object
- Pipeline::Mounters
- Defined in:
- lib/pipeline/mounters.rb
Instance Attribute Summary collapse
-
#target ⇒ Object
readonly
Returns the value of attribute target.
-
#warnings ⇒ Object
readonly
Returns the value of attribute warnings.
Class Method Summary collapse
- .add(klass) ⇒ Object
- .get_mounter_name(mounter_class) ⇒ Object
- .mount(tracker) ⇒ Object
- .mounters ⇒ Object
Instance Method Summary collapse
- #add_warning(warning) ⇒ Object
-
#initialize ⇒ Mounters
constructor
A new instance of Mounters.
Constructor Details
#initialize ⇒ Mounters
Returns a new instance of Mounters.
19 20 21 |
# File 'lib/pipeline/mounters.rb', line 19 def initialize @warnings = [] end |
Instance Attribute Details
#target ⇒ Object (readonly)
Returns the value of attribute target.
8 9 10 |
# File 'lib/pipeline/mounters.rb', line 8 def target @target end |
#warnings ⇒ Object (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.[:target] Pipeline.debug "Mounting target: #{target}" trigger = Pipeline::Event.new(tracker.[:appname]) @mounters.each do | c | mounter = c.new trigger, tracker. 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. end end end |
.mounters ⇒ Object
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 |