Sha256: 951ec1ae775fe5993619add4e5c5925088b53d266bd7fe8a69cd8d57d051a893

Contents?: true

Size: 1003 Bytes

Versions: 1

Compression:

Stored size: 1003 Bytes

Contents

require('zerenity/fileselection')

fileName = Zerenity::FileSelection(:title=>"Which file do you want?",:filename=>File.expand_path(__FILE__),:action=>:open)

puts "You chose #{fileName}" if fileName
puts "You did not select a file" unless fileName

fileNames = Zerenity::FileSelection(:title=>"Please choose the required files",:multiple=>true)

if fileNames
  puts "You chose the following files"
  fileNames.each do |fileName|
    puts "\t#{fileName}"
  end
else
  puts "You did not choose any files"
end

filename = Zerenity::FileSelection(:title=>"Save file as",:action=>:save)
filename ? puts("File saved as #{filename}") : puts("No file saved")

folder = Zerenity::FileSelection(:title=>"Select a folder",:action=>:select_folder,:multiple=>true)
folder ? puts("You selected folder #{folder}") : puts("You did not choose a folder") 

folder = Zerenity::FileSelection(:title=>"Create folder",:action=>:create_folder)
folder ? puts("Created folder #{folder}") : puts("You did not create a folder") 

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
zerenity-1.3 examples/example_fileselection.rb