Thimblr 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/thimblr.rb +3 -5
- metadata +2 -2
data/lib/thimblr.rb
CHANGED
@@ -18,13 +18,13 @@ class Thimblr::Application < Sinatra::Base
|
|
18
18
|
Locations = {
|
19
19
|
"mac" => {"dir" => "~/Library/Application Support/Thimblr/", 'name' => "Application Support", 'platform' => "mac"},
|
20
20
|
"nix" => {'dir' => "~/.thimblr/",'name' => "Home directory", 'platform' => "nix"},
|
21
|
-
"win" => {'dir' => "~/AppData/Roaming/Thimblr/",'name' => "AppData", 'platform' => "
|
21
|
+
"win" => {'dir' => "~/AppData/Roaming/Thimblr/",'name' => "AppData", 'platform' => "win"} # TODO: This value is hardcoded for vista/7, I should probably superceed expand_path and parse for different versions of Windows here
|
22
22
|
}
|
23
23
|
|
24
24
|
case RbConfig::CONFIG['target_os']
|
25
25
|
when /darwin/i
|
26
26
|
Platform = "mac"
|
27
|
-
when /mswin32/i
|
27
|
+
when /mswin32/i,/mingw32/i
|
28
28
|
Platform = "win"
|
29
29
|
else
|
30
30
|
Platform = "nix"
|
@@ -46,9 +46,7 @@ class Thimblr::Application < Sinatra::Base
|
|
46
46
|
set :settingsfile, File.expand_path(File.join(Locations[Platform]['dir'],'settings.yaml'))
|
47
47
|
|
48
48
|
# Generate Data & Theme directories if required
|
49
|
-
|
50
|
-
FileUtils.cp_r(File.join(root,'themes'),File.expand_path(Locations[Platform]['dir']))
|
51
|
-
end
|
49
|
+
FileUtils.cp_r(File.join(root,'themes'),File.expand_path(Locations[Platform]['dir'])) if not File.directory?(File.expand_path(File.join(Locations[Platform]['dir'],"themes")))
|
52
50
|
|
53
51
|
if not File.directory?(File.expand_path(File.join(Locations[Platform]['dir'],"data")))
|
54
52
|
FileUtils.mkdir_p(File.expand_path(File.join(Locations[Platform]['dir'],"data")))
|