Sha256: 694a0923b28d3630457a4fe5bfce79b5fa28b16d76eec217a457e70b211b4c0b

Contents?: true

Size: 1.41 KB

Versions: 12

Compression:

Stored size: 1.41 KB

Contents

#!/usr/bin/env ruby -wKU

=begin
  @history:
  2011-02-05 1.0.1: better myconf 
  2011-02-05 0.9.1: Created 
=end

  require 'optparse'       # http://ruby.about.com/od/advancedruby/a/optionparser.htm
  #require '~/lib/ric.rb'
  require 'rubygems'
  require 'ric'
  require 'yaml'
  

  $PROG_VER = '1.0.1'
  $DEBUG    = false
  
  $myconf = {
      'author'      => 'Riccardo Carlesso <riccardo.carlesso@gmail.com>',
      'description' => 'Please put an interesting description HERE for future use!',
      'from'        => '~/Documents/',
      'to'          => '/tmp/my_docs_backup/',
      'files'       => ["**/{*.{mp3,jpg}}", 'README', 'put', 'your', 'files', 'here' ],
      'dryrun'      => true,
  }

  def main
    debug_on 'Just created script, presuming u need some debug. TODO REMOVE ME when everything works!' if $DEBUG
      # Maybe you may want to check on ARGV
    deb "+ Your configuration: #{purple $myconf}"
    include Ric::Conf
    include Ric::Files
    myconf = load_auto_conf('xcopy', :sample_hash => $myconf)
    xcopy(
      File.expand_path(myconf['from']), 
      File.expand_path(myconf['to']), 
      myconf['files']  ,       #myconf
      :dryrun      => myconf['dryrun'] 
    )
  end
  
  ## remove me in 0.11.8!
  #def fatal(ret,str=nil)
  #  unless str
  #    str = ret
  #    ret = 66
  #  end
  #  STDERR.puts "#{red 'XCpFatal (remove me from gem 0.11.7!)'}(#{ret}) #{str}"
  #  exit ret
  #end

  main()

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ric-0.13.0 bin/xcopy
ric-0.12.2 bin/xcopy
ric-0.12.0 bin/xcopy
ric-0.11.19 bin/xcopy
ric-0.11.18 bin/xcopy
ric-0.11.16 bin/xcopy
ric-0.11.15 bin/xcopy
ric-0.11.14 bin/xcopy
ric-0.11.13 bin/xcopy
ric-0.11.12 bin/xcopy
ric-0.11.11 bin/xcopy
ric-0.11.10 bin/xcopy