Sha256: 50845b2230a959f539db09165d0247239ca008e1b186e733c7585816b17a2894

Contents?: true

Size: 740 Bytes

Versions: 6

Compression:

Stored size: 740 Bytes

Contents

Shoes.app :title => "Dictionary, powered by Definr", :width => 370, :height => 320 do
  stack do
    background red, :height => 60
    flow :margin => 20 do
      caption "Define: ", :stroke => white
      @lookup = edit_line
      button "Go" do
        download "http://definr.com/definr/show/#{@lookup.text}" do |dl|
          doc = dl.response.body.gsub(' ', ' ').
              gsub(%r!(</a>|<br />|<a href.+?>)!, '').
              gsub(%r!\(http://.+?\)!, '').strip
          title, doc = doc.split(/\n+/, 2)
          @deft.replace title
          @defn.replace doc
        end
      end
    end
    stack :margin => 20 do
      @deft = subtitle "", :margin => 10
      @defn = para ""
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
shoesgem-0.1480.0 shoes/samples/expert-definr.rb
shoesgem-0.1469.0 shoes/samples/expert-definr.rb
shoesgem-0.1430.0 shoes/samples/expert-definr.rb
shoesgem-0.1429.0 shoes/samples/expert-definr.rb
shoesgem-0.1428.0 shoes/samples/expert-definr.rb
shoesgem-0.1426.0 shoes/samples/expert-definr.rb