Skip to content

Commit

Permalink
Add Ian Trudel's fix to remove shy tmpdir when Shoes quits.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cecil Coupe committed Nov 13, 2014
1 parent c99ef95 commit 33c041c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
8 changes: 6 additions & 2 deletions lib/shoes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -445,10 +445,10 @@ def self.visit(path)
@shy = true
require 'shoes/shy'
base = File.basename(path, ".shy")
tmpdir = "%s/shoes-%s.%d" % [Dir.tmpdir, base, $$]
@tmpdir = tmpdir = "%s/shoes-%s.%d" % [Dir.tmpdir, base, $$]
shy = Shy.x(path, tmpdir)
Dir.chdir(tmpdir)
Shoes.debug "Loaded SHY: #{shy.name} #{shy.version} by #{shy.creator}"
#Shoes.debug "Loaded SHY: #{shy.name} #{shy.version} by #{shy.creator}"
path = shy.launch
else
@shy = false
Expand All @@ -467,6 +467,10 @@ def self.visit(path)
show_log
end

def self.clean
FileUtils.rm_rf(@tmpdir, :secure => true) if @shy
end

def self.read_file path
if RUBY_VERSION =~ /^1\.9/ and !@shy
#File.open(path, 'r:utf-8') { |f| f.read }
Expand Down
8 changes: 6 additions & 2 deletions notes/Bugs.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
Bugs/Status - stick with Ruby 2.0.0 and gtk2 until things get sorted
out with GKt3

2014-11-13
done: implement, test, commit Ian's tmpdir fix.
done: comment debug message in Shy loading.

2014-11-11
----> I'm not sure the extra packaging step is worth the effort.
Don't delete the code. Comment out.
Don't delete the code. Comment out for now.

2014-11-10
----> try replacing icons with exerb. Projects/petest/iconcopy.rb
figure out getting a list of icons from the pe.
Not as easy as I hoped.

2014-11-09
done: Mock up a second level installer that saves the shy contents in
Expand Down
1 change: 1 addition & 0 deletions shoes/world.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ shoes_start(char *path, char *uri)
shoes_code
shoes_final()
{
rb_funcall(cShoes, rb_intern("clean"), 0);
shoes_world_free(shoes_world);
return SHOES_OK;
}
Expand Down

0 comments on commit 33c041c

Please sign in to comment.