glv / beholder forked from spicycode/beholder

An ancient beholder that watches your treasure, and deals with thiefs.

This URL has Read+Write access

name age message
file .gitignore Mon Jan 05 06:01:42 -0800 2009 Removing DS_Store [spicycode]
file LICENSE Sun Jan 04 14:43:18 -0800 2009 0.0.1 [spicycode]
file README.textile Loading commit data...
file Rakefile
file TODO Sun Jan 04 14:43:18 -0800 2009 0.0.1 [spicycode]
file beholder.gemspec
directory bin/
directory editor_integration/ Sun Jan 11 13:23:27 -0800 2009 Minor merge conflict fix [spicycode]
directory examples/
directory lib/
README.textile

Beholder

An ancient beholder that watches your treasure, and deals with thiefs.

What does it do?

Think autotest, but powered by fseventd.

Requirements

  1. OSX 10.5 or higher
  2. RubyCocoa
  3. fsevents gem

The default treasure map:

map_for(:default_dungeon) do |wizard|

wizard.keep_a_watchful_eye_for ‘app’, ‘config’, ‘lib’, ‘examples’ wizard.prepare_spell_for /\/app\/(.*)\.rb/ do |spell_component| [“examples/#{spell_component1}.rb”] end wizard.prepare_spell_for /\/lib\/(.*)\.rb/ do |spell_component| [“examples/lib/#{spell_component1}_example.rb”] end wizard.prepare_spell_for /\/examples\/(.*)example\.rb/ do |spellcomponent| [“examples/#{spell_component1}_example.rb”] end wizard.prepare_spell_for /\/examples\/example_helper\.rb/ do |spell_component| Dir[“examples//_example.rb”] end wizard.prepare_spell_for /\/config/ do Dir[“examples//_example.rb”] end

end

In your own treasure map (stored as treasure_map.rb, .treasure_map.rb, or config/treasure_map.rb) you could do:

map_for(:beholders_lair) do |wizard|

  1. Clear all watched paths => wizard.paths_to_watch.clear
  2. Add these paths to the paths to watch
    wizard.keep_a_watchful_eye_for ‘coverage’
  1. Forget all other treasure maps loaded
  2. wizard.cast_feeble_mind
  1. Add your own rules
  2. wizard.prepare_spell_for /\/foobar/ do
  3. Dir[“examples/foobar/*_example.rb”]
  4. end
  1. You could set the list of all examples to be run after pressing ctrl-c once
  2. it defaults to any files in examples, spec, and test
    wizard.all_examples = Dir[‘your/path//_here.rb’]
    end