GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: a tiny graphical app kit for ruby
Homepage: http://code.whytheluckystiff.net/shoes
Clone URL: git://github.com/why/shoes.git
shoes / samples / simple-rubygems.rb
100644 30 lines (24 sloc) 0.721 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#
# The setup block will install gems before launching the
# rest of the app below it.
#
Shoes.setup do
  gem 'RedCloth'
  gem 'metaid'
end
 
require 'redcloth'
require 'metaid'
 
Shoes.app :width => 300, :height => 400, :resizable => false do
  background "#eed"
 
  stack :margin => 40 do
    tagline "Loaded Gems:", :align => "center", :underline => "single"
    Gem.loaded_specs.each do |name, spec|
      para "#{name}\n#{spec.version}", :align => "center"
    end
 
    caption "Total Gems: #{Gem.source_index.length}", :align => "center", :margin_bottom => 0
    para "(includes unloaded gems)", :align => "center", :margin_top => 0
    button "OK", :bottom => 30, :left => 0.4 do
      self.close
    end
  end
 
end