-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
skip cache whem loading images from files #379
* image <path/to/file.png>, cache: false * still have work to do with the external cache and downloads.
- Loading branch information
Cecil
committed
Oct 21, 2017
1 parent
ab3c9b5
commit f3ec387
Showing
5 changed files
with
78 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
Shoes.app do | ||
require 'shoes/data' | ||
require 'shoes/image' | ||
stack do | ||
flow do | ||
@el = edit_line "#{DIR}/static/shoes-icon-walkabout.png" | ||
#@el = edit_line "https://shoes.mvmanila.com/public/images/dino.jpg" | ||
@cb = check; para "Don't cache" | ||
button "(Re)load" do | ||
@img.clear | ||
@img.append do | ||
if @cb.checked? | ||
image @el.text, cache: false | ||
else | ||
image @el.text | ||
end | ||
end | ||
end | ||
button "Show cache" do | ||
@cview.clear | ||
@cview.append do | ||
eb = edit_box width: 400 | ||
DATABASE.each do |key, value| | ||
eb.append "#{key} -> #{value}" | ||
end | ||
end | ||
end | ||
button "clear caches" do | ||
DATABASE.each do |k, val| | ||
v = val.split('|') | ||
path = Shoes::image_cache_path v[1], File.extname(k) | ||
File.delete path if File.exist? path | ||
end | ||
DATABASE.clear | ||
end | ||
end | ||
@img = flow {} | ||
@cview = flow {} | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f3ec387
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo this commit was for issue #377