lib/bones/main.rb
# Freeze the project skeleton to the current Mr Bones gem. If the project
# skeleton has already been frozen, then it will be archived before being
# overwritten by the current Mr Bones skeleton.
#
# If the project skeleton is already frozen, only the tasks from the Mr
# Bones skeleton will be copied to the user's data directory.
#
Freeze the project skeleton to the current Mr Bones gem. If the project
skeleton has already been frozen, then it will be archived before being
overwritten by the current Mr Bones skeleton.

If the project skeleton is already frozen, only the tasks from the Mr
Bones skeleton will be copied to the user's data directory.
Freeze the project skeleton to the current Mr Bones gem . If the project skeleton has already been frozen then it will be archived before being overwritten by the current Mr Bones skeleton . If the project skeleton is already frozen only the tasks from the Mr Bones skeleton will be copied to the user ' s data directory .
def freeze
    self.data = ::Bones.path('data')
    data_dir = File.join(mrbones_dir, 'data')
    archive_dir = File.join(mrbones_dir, 'archive')
    tasks_only = false
    if test(?d, data_dir)
      STDOUT.puts "archiving #{data_dir}" if verbose
      FileUtils.rm_rf(archive_dir)
      FileUtils.mkdir(archive_dir)
      FileUtils.cp_r(File.join(data_dir, '.'), archive_dir)
      tasks_only = true
    else
      FileUtils.mkdir_p(data_dir)
    end
    files_to_copy.each do |file|
      next if tasks_only && !(%r/^tasks\// =~ file)
      src = File.join(data, file)
      dst = File.join(data_dir, file)
      STDOUT.puts "freezing #{dst}" if verbose
      FileUtils.mkdir_p(File.dirname(dst))
      FileUtils.cp(src, dst)
    end
    File.open(frozen_version_file, 'w') {|fd| fd.puts ::Bones::VERSION}
    if tasks_only
      STDOUT.puts "project skeleton tasks have been updated " <<
                  "from Mr Bones #{::Bones::VERSION}"
    else
      STDOUT.puts "project skeleton has been frozen " <<
                  "to Mr Bones #{::Bones::VERSION}"
    end
  end
def freeze self . data = :: Bones . path ( 'data' ) data_dir = File . join ( mrbones_dir , 'data' ) archive_dir = File . join ( mrbones_dir , 'archive' ) tasks_only = false if test ( ?d , data_dir ) STDOUT . puts "archiving #{data_dir}" if verbose FileUtils . rm_rf ( archive_dir ) FileUtils . mkdir ( archive_dir ) FileUtils . cp_r ( File . join ( data_dir , '.' ) , archive_dir ) tasks_only = true else FileUtils . mkdir_p ( data_dir ) end files_to_copy . each do | file | next if tasks_only && ! ( %r/ ^tasks \/ / =~ file ) src = File . join ( data , file ) dst = File . join ( data_dir , file ) STDOUT . puts "freezing #{dst}" if verbose FileUtils . mkdir_p ( File . dirname ( dst ) ) FileUtils . cp ( src , dst ) end File . open ( frozen_version_file , 'w' ) { | fd | fd . puts :: Bones :: VERSION } if tasks_only STDOUT . puts "project skeleton tasks have been updated " << "from Mr Bones #{::Bones::VERSION}" else STDOUT . puts "project skeleton has been frozen " << "to Mr Bones #{::Bones::VERSION}" end end
Freeze the project skeleton to the current Mr Bones gem.
Freeze the project skeleton to the current Mr Bones gem .