This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RingBuffer < Array | |
attr_reader :max_size | |
def initialize(max_size, enum = nil) | |
@max_size = max_size | |
enum.each { |e| self << e } if enum | |
end | |
def <<(el) | |
if self.size < @max_size || @max_size.nil? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adapted from http://stackoverflow.com/questions/1686779/multifile-rake-build | |
# Runs a task (in this case the default task) for each Rakefile nested in the current directory | |
task :default do | |
FileList["*/**/Rakefile"].each do |project| | |
next if project =~ /^admin_console/ | |
next if project =~ /^logging/ | |
# clear current tasks | |
Rake::Task.clear | |
#load tasks from this project | |
load project |