Forum: Ruby-Gnome 2 New FileTreeView update on visualruby

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
C37e335e7250698ebcc8a092a4baded3?d=identicon&s=25 Eric C. (Guest)
on 2016-05-30 21:49

I just updated the FileTreeView class in visualruby.  For those of you
who aren't familiar with it, its a great class that automatically
creates a tree of folders and files that is expandable and clickable
etc.  All you need to do is pass the folder path as an argument, and you
have a "windows explorer" like file tree on the screen.  You can pass a
glob to designate what files to include and pass a code block that will
further exclude files.

Thanks to my correspondence with the user cediemo, I realized that it
was a little bit difficult to open a folder in visualruby because the
user must choose a folder that contains a visualruby project in it.  So
my FileTreeView must show only folders with a hidden file,
(.vr_settings.yaml) in it.  This task was easy with the new

@ftv =, "*/**/")
@ftv.test_block = { |folder| has_settings_file?(folder) }


  def has_settings_file?(path)
    Find.find(path) do |file|
      if File.basename(file) == VR_ENV::SETTINGS_FILE
        return true
    return false

Now visualruby has a beautiful custom project selector that only shows
valid visualruby project folders.

This is available on github.

This topic is locked and can not be replied to.