Module: Outlook2GCal

Defined in:
lib/outlook2gcal/outlook_calendar.rb,
lib/outlook2gcal/sync.rb,
lib/outlook2gcal/counter.rb,
lib/outlook2gcal/install.rb,
lib/outlook2gcal/sync_entry.rb,
lib/outlook2gcal/google_calendar.rb

Overview

Info:

http://msdn.microsoft.com/en-us/library/dd469461(v=office.12).aspx
http://msdn.microsoft.com/en-us/library/ff870661.aspx

Defined Under Namespace

Classes: Counter, EventRepeat, GoogleCalendar, OutlookCalendar, OutlookEvent, OutlookEvents, OutlookGoogleSync, SyncEntry

Class Method Summary collapse

Class Method Details

.copy_files(src_dir, dest_dir) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/outlook2gcal/install.rb', line 26

def Outlook2GCal::copy_files(src_dir, dest_dir)
  puts "Copying files from " + src_dir
  puts "to " + dest_dir
  FileUtils::mkdir_p(dest_dir)
  FileUtils::cp_r(src_dir, dest_dir)
  puts "Install successful!" 
end

.create_licence_file(dest_dir) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/outlook2gcal/install.rb', line 33

def Outlook2GCal::create_licence_file(dest_dir)
  licence =<<__END__
Copyright (c) 2012 Elias Kugler

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
__END__

  f= File.new(dest_dir+"/MIT-LICENSE",'w+') 
  f.write(licence)
  f.close
end

.create_start_file(dest_dir) ⇒ Object



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/outlook2gcal/install.rb', line 62

def Outlook2GCal::create_start_file(dest_dir)
  cmd =<<__END__
@goto :end                ;@rem TODO: delete this line, edit the next one !!!
.\\bin\\ruby .\\src\\outlook2gcal_portable sync -U <google-user> -P <google-password> -C <calendar-name> -D 30  --sync-desc --sync-alarm
@echo.
@pause
@rem TODO: delete the following lines !!!

:end                          
@echo off                                                                     
echo --------------------------
echo  TODO!!! Edit this file!!                                             
echo --------------------------
.\\bin\\ruby .\\src\\outlook2gcal_portable   
echo --------------------------
echo  TODO!!! Edit this file!!                                             
echo --------------------------
@pause
__END__

  f= File.new(dest_dir+"/start_outlook2gcal_portable.bat",'w+') 
  f.write(cmd)
  f.close
end

.install(conf) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/outlook2gcal/install.rb', line 8

def Outlook2GCal::install(conf)
  raise "environment variable %APPDATA% not set" unless ENV['APPDATA'] 
  puts File.realdirpath(__FILE__+ '/../..')
  puts File.realdirpath($0+ '/../..')
  puts "---"
  
  src_dir = File.realdirpath($0 + '/../..') + '/.'
  dest_dir = File.realdirpath(ENV['APPDATA']+"/outlook2gcal_standalone_0.0.1")
  if !File.exists?(dest_dir)
    copy_files(src_dir,dest_dir)
    create_licence_file(dest_dir)
    create_start_file(dest_dir)
  else
    puts "Dir (#{dest_dir}) already exists. "
  end  

end