File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ def get_safari_version
42
42
43
43
f = read_file ( "/Applications/Safari.app/Contents/version.plist" )
44
44
xml = REXML ::Document . new ( f ) rescue nil
45
- return version if xml . root . nil?
45
+ return version if xml . nil?
46
46
47
47
xml . elements [ 'plist/dict' ] . each_element do |e |
48
48
if e . text == 'CFBundleShortVersionString'
@@ -66,7 +66,7 @@ def peer
66
66
#
67
67
def plutil ( filename )
68
68
cmd_exec ( "plutil -convert xml1 #{ filename } " )
69
- cmd_exec ( "cat #{ filename } " )
69
+ read_file ( filename )
70
70
end
71
71
72
72
@@ -76,7 +76,7 @@ def plutil(filename)
76
76
#
77
77
def get_lastsession
78
78
print_status ( "#{ peer } - Looking for LastSession.plist" )
79
- plutil ( "~ /Library/Safari/LastSession.plist" )
79
+ plutil ( "#{ expand_path ( "~" ) } /Library/Safari/LastSession.plist" )
80
80
end
81
81
82
82
@@ -89,7 +89,7 @@ def get_sessions(lastsession)
89
89
session_dict = nil
90
90
91
91
xml = REXML ::Document . new ( lastsession ) rescue nil
92
- return nil if xml . root . nil?
92
+ return nil if xml . nil?
93
93
94
94
xml . elements [ 'plist' ] . each_element do |e |
95
95
found = false
You can’t perform that action at this time.
0 commit comments