Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 6th, 2012  |  syntax: None  |  size: 0.88 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ## Old matching
  2.  
  3. # Match different properties (tag 1)
  4. tag "test" do
  5.   regex /foo/
  6.   match [:instance]
  7.   gravity :center
  8. end
  9.  
  10. # Match different properties (tag 2)
  11. tag "test" do
  12.   regex /bar/
  13.   match [:name]
  14.   gravity :center
  15. end
  16.  
  17. # Match different properties (tag 3)
  18. tag "test" do
  19.   type :dialog
  20.   gravity :center
  21. end
  22.  
  23. # Match default instance and class
  24. tag "test2" do
  25.   regex /foo/
  26.   gravity :center
  27. end
  28.  
  29. # Match name and class
  30. tag "test3" do
  31.   regex /foo/
  32.   match [:name, :class]
  33.   gravity :center
  34. end
  35.  
  36. ## New matching
  37.  
  38. # Match different properties
  39. tag "test" do
  40.   match :instance => /foo/
  41.   match :name     => /bar/
  42.   match :type     => :dialog
  43.   gravity :center
  44. end
  45.  
  46. # Match default instance and class
  47. tag "test2" do
  48.   match /foo/
  49.   gravity :center
  50. end
  51.  
  52. # Match name and class
  53. tag "test3" do
  54.   match [:name, :class] => /foo/
  55.   gravity :center
  56. end