Sha256: d34bcba3522700c5c8f46e41e78e2c66ede99f05520891dfb3244543eff8789c
Contents?: true
Size: 846 Bytes
Versions: 6
Compression:
Stored size: 846 Bytes
Contents
### More about Tasks Incidentally, there's nothing stopping you from implementing the "Test" example functionally. It could look (simplifying a little) like this: Test = lambda {|arg| type = lambda {|*dirs| dirs.each do |dir| Dir["./test/#{dir}/*.rb"].each { |f| require_relative f } end } suite = lambda { type['unit','functional','acceptance'] } arg ? type[arg] : suite[] } Ing can either invoke class instance methods (on things that respond to `new`), or call Procs directly. The advantage of using classes is that some of the argument parsing is done for you (especially true of option arguments as we'll see in a minute). You can use methods to basically model the command line syntax. The advantage of Procs is you have more flexibility in how arguments are interpreted.
Version data entries
6 entries across 6 versions & 1 rubygems
Version | Path |
---|---|
ing-0.2.7 | TASKS.md |
ing-0.2.2 | TASKS.md |
ing-0.2.1 | TASKS.md |
ing-0.1.5 | TASKS.md |
ing-0.1.2 | TASKS.md |
ing-0.1.1 | TASKS.md |