Class: Array
- Inherits:
-
Object
show all
- Defined in:
- lib/dev_commands.rb
Direct Known Subclasses
Add, Analyze, Build, Clean, Clobber, Commit, Doc, Publish, Pull, Push, Setup, Tag, Test, Update, Upgrade
Instance Method Summary
collapse
Instance Method Details
#add(command) ⇒ Object
263
264
265
|
# File 'lib/dev_commands.rb', line 263
def add command
self << command if(!include?(command))
end
|
#execute(value = nil) ⇒ Object
248
249
250
251
252
253
254
255
256
257
258
259
260
261
|
# File 'lib/dev_commands.rb', line 248
def execute value=nil
i=0
while i < self.length
self[i]=Command.new(self[i]) if(self[i].is_a?(String))
self[i]=Command.new(self[i]) if(self[i].is_a?(Hash) && !self[i].is_a?(Command))
if(!value.nil? && value.is_a?(Hash))
value.each{|k,v|self[i][k]=v}
end
self[i].execute if(self[i].is_a?(Command))
i=i+1
end
end
|
#to_html ⇒ Object
267
268
269
270
271
272
273
274
275
|
# File 'lib/dev_commands.rb', line 267
def to_html
html=Array.new
html << '<div>'
self.each{|e|
html << e.to_html if e.respond_to?(:to_html)
}
html << '</div>'
html.join
end
|