Method: LessonsIndexer::Course#generate_files

Defined in:
lib/lessons_indexer/course.rb

#generate_files(lessons_count) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/lessons_indexer/course.rb', line 15

def generate_files(lessons_count)
  within(dir, true) do
    lessons_count.map {|l| Integer(l)}.each_with_index do |steps, lesson|
      (1..steps).each do |step|
        File.new("lesson#{lesson + 1}-#{step}.md", 'w+').close
      end
    end
  end
end