Class: MDir
- Inherits:
-
Object
- Object
- MDir
- Defined in:
- lib/appswarm/dir_tool.rb
Instance Method Summary collapse
- #dir(name, &p) ⇒ Object
- #dirs(*names, &p) ⇒ Object
- #file(f) ⇒ Object
- #files(*f) ⇒ Object
- #gather(base = "") ⇒ Object
-
#initialize(path) ⇒ MDir
constructor
A new instance of MDir.
Constructor Details
#initialize(path) ⇒ MDir
Returns a new instance of MDir.
2 3 4 5 6 |
# File 'lib/appswarm/dir_tool.rb', line 2 def initialize(path) @path=path @files=[] @dirs=[] end |
Instance Method Details
#dir(name, &p) ⇒ Object
13 14 15 16 17 |
# File 'lib/appswarm/dir_tool.rb', line 13 def dir(name,&p) dir = MDir.new(name) dir.instance_eval(&p) @dirs << dir end |
#dirs(*names, &p) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/appswarm/dir_tool.rb', line 18 def dirs(*names,&p) names.each{|name| dir=MDir.new(name) dir.instance_eval(&p) @dirs << dir } end |
#file(f) ⇒ Object
7 8 9 |
# File 'lib/appswarm/dir_tool.rb', line 7 def file(f) @files << f end |
#files(*f) ⇒ Object
10 11 12 |
# File 'lib/appswarm/dir_tool.rb', line 10 def files(*f) @files += f end |