Class: Judges::Packs
- Inherits:
-
Object
- Object
- Judges::Packs
- Defined in:
- lib/judges/packs.rb
Overview
Collection of all packs to run.
- Author
-
Yegor Bugayenko (yegor256@gmail.com)
- Copyright
-
Copyright © 2024 Yegor Bugayenko
- License
-
MIT
Instance Method Summary collapse
-
#each {|Pack| ... } ⇒ Object
Iterate over them all.
-
#each_with_index {|(Pack, Integer)| ... } ⇒ Object
Iterate over them all.
-
#initialize(dir) ⇒ Packs
constructor
A new instance of Packs.
Constructor Details
#initialize(dir) ⇒ Packs
Returns a new instance of Packs.
31 32 33 |
# File 'lib/judges/packs.rb', line 31 def initialize(dir) @dir = dir end |
Instance Method Details
#each {|Pack| ... } ⇒ Object
Iterate over them all.
37 38 39 40 41 42 |
# File 'lib/judges/packs.rb', line 37 def each Dir.glob(File.join(@dir, '**/*.rb')).each do |f| d = File.dirname(File.absolute_path(f)) yield Judges::Pack.new(d) end end |
#each_with_index {|(Pack, Integer)| ... } ⇒ Object
Iterate over them all.
46 47 48 49 50 51 52 53 |
# File 'lib/judges/packs.rb', line 46 def each_with_index idx = 0 each do |p| yield [p, idx] idx += 1 end idx end |