module BiweekFinder

Constants

VERSION

biweek_finder version

Public Class Methods

from_a(arr = []) click to toggle source
# File lib/biweek_finder.rb, line 13
def self.from_a(arr = [])
  arr.find_all do |name|
    self.is_biweek? name
  end
end
from_path(path = '.') click to toggle source
# File lib/biweek_finder.rb, line 4
def self.from_path(path = '.')
  sort from_a subdirectories(path)
end
is_biweek?(str) click to toggle source
# File lib/biweek_finder.rb, line 23
def self.is_biweek?(str)
  if /^20/ =~ str
    true
  else false
  end
end
sort(arr = []) click to toggle source
# File lib/biweek_finder.rb, line 19
def self.sort(arr = [])
  arr.sort {|a, b| a <=> b}
end
subdirectories(path = '.') click to toggle source
# File lib/biweek_finder.rb, line 8
def self.subdirectories(path = '.')
  dir = Dir.open(path)
  dir.select {|f| File.directory?(File.join(path, f))}
end