module Aozora

Public Class Methods

titles() click to toggle source
# File lib/aozora.rb, line 5
def titles
  @titles ||= Dir["#{data_path}/*"].map {|path| File.basename(path) }
end

Private Class Methods

data_path() click to toggle source
# File lib/aozora.rb, line 17
def data_path
  @data_path ||= File.expand_path('../data', __FILE__)
end
generate(title, size) click to toggle source
# File lib/aozora.rb, line 11
def generate(title, size)
  LoopFile.open("#{data_path}/#{title}") do |file|
    size.times.map { file.getc }.join
  end
end