Module: QuickSync

Defined in:
lib/quicksync.rb,
lib/quicksync/cli.rb,
lib/quicksync/rsync.rb,
lib/quicksync/logger.rb,
lib/quicksync/version.rb

Defined Under Namespace

Classes: CLI, Logger, RSync

Constant Summary collapse

VERSION =
"0.0.7.2"

Class Method Summary collapse

Class Method Details

.ConfigObject



10
11
12
# File 'lib/quicksync.rb', line 10

def self.Config
  @config ||= QuickSync.LoadConfig
end

.LoadConfigObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/quicksync.rb', line 14

def self.LoadConfig
  
  home_path = Etc.getpwuid.dir
  gem_path = File.join(Pathname.new(File.dirname(__FILE__)).parent,"config")
  search_paths = [home_path, gem_path]
  yaml_filename = "quicksync.yaml"
  yaml_file= "#{gem_path}/#{yaml_filename}"
  search_paths.each { |p|
    file = "#{p}/#{yaml_filename}"
    if File.exists?(file)
      yaml_file = file
      break
    end
  }
  return YAML::load( File.open( yaml_file ) )
end

.LoggerObject



3
4
5
# File 'lib/quicksync/logger.rb', line 3

def self.Logger
  @logger ||= QuickSync::Logger.new(:output => STDOUT)
end