Permalink
Browse files

improved code for obtaining version number

  • Loading branch information...
1 parent 6983e61 commit 6c4e0cb59e55e162fa20bfc0ba88b0dfb660894d @neoneye committed Apr 5, 2012
Showing with 7 additions and 6 deletions.
  1. +7 −6 Testees/41_mucommander.rb
@@ -1,17 +1,18 @@
+PATH_MUCOMMANDER = '/Applications/muCommander.app'
+
def name
'muCommander'
end
def is_installed
- true
+ Dir.exists?(PATH_MUCOMMANDER)
end
def version
- "0.8.5"
-end
-
-def print_full_version
- puts "0.8.5"
+ # muCommander's Info.plist is an XML plist
+ s = IO.read(PATH_MUCOMMANDER + '/Contents/Info.plist')
+ return "unknown" unless s =~ /CFBundleShortVersionString.*?<string>(.*?)<\/string>/m
+ $1
end
def copy_data(source_dir, dest_dir)

0 comments on commit 6c4e0cb

Please sign in to comment.