lib/bones/main.rb
# Archive any existing tasks in the project's tasks folder, and then
# copy in new tasks from the bones/data directory.
#
Archive any existing tasks in the project's tasks folder, and then
copy in new tasks from the bones/data directory.
Archive any existing tasks in the project ' s tasks folder and then copy in new tasks from the bones / data directory .
def update
    abort "'#{output_dir}' does not exist" unless test ?e, output_dir
    task_dir = File.join(output_dir, 'tasks')
    abort "no tasks directory found in '#{output_dir}'" unless test ?d, task_dir
    archive_dir = File.join(task_dir, 'archive')
    FileUtils.rm_rf archive_dir
    FileUtils.mkdir archive_dir
    Dir.glob(File.join(task_dir, '*')).each do |fn|
      next if fn == archive_dir
      FileUtils.cp fn, archive_dir
    end
    files_to_copy.each do |fn|
      next unless %r/^tasks\// =~ fn
      cp fn
    end
    msg = "updated tasks for '#{name}'"
    msg << " in directory '#{output_dir}'" if name != output_dir
    STDOUT.puts msg
  end
def update abort "'#{output_dir}' does not exist" unless test ?e , output_dir task_dir = File . join ( output_dir , 'tasks' ) abort "no tasks directory found in '#{output_dir}'" unless test ?d , task_dir archive_dir = File . join ( task_dir , 'archive' ) FileUtils . rm_rf archive_dir FileUtils . mkdir archive_dir Dir . glob ( File . join ( task_dir , '*' ) ) . each do | fn | next if fn == archive_dir FileUtils . cp fn , archive_dir end files_to_copy . each do | fn | next unless %r/ ^tasks \/ / =~ fn cp fn end msg = "updated tasks for '#{name}'" msg << " in directory '#{output_dir}'" if name != output_dir STDOUT . puts msg end
Archive any existing tasks in the project's tasks folder, and then
copy in new tasks from the bones/data directory.
Archive any existing tasks in the project ' s tasks folder and then copy in new tasks from the bones / data directory .