cucumber-attic / cucumber-tmbundle

TextMate bundle for Cucumber
http://www.benmabey.com
MIT License
204 stars 54 forks source link

A tool tip for existing step_definitions #20

Closed mikehoward closed 13 years ago

mikehoward commented 13 years ago

Apologies: Don't know how to submit this other than creating an issue.

This is a TM command which snarfs the [WT]hen|Given|And|But lines from all the step definition files and presents them as a tool tip:

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

beforeRunningCommand nop command echo 'Phrases Recognized in step_definitions/_.rb' echo '-------------------------------------------' egrep '^\s_([TW]hen|Given|And|But)' ${TM_PROJECT_DIRECTORY}/features/step_definitions/_.rb | sed -e 's| do._$||' | sort input none keyEquivalent ^h name Show web_steps output showAsTooltip scope text.gherkin.feature, source.ruby.rspec.cucumber.steps uuid BA0E41CA-589F-454A-B1FC-49AF1CE6D0DB
aslakhellesoy commented 13 years ago

That soinds great! I'm planning to hack on the plugin this weekend, will try to get it merged in.

Aslak

On Mar 11, 2011, at 17:42, mikehoward reply@reply.github.com wrote:

Apologies: Don't know how to submit this other than creating an issue.

This is a TM command which snarfs the [WT]hen|Given|And|But lines from all the step definition files and presents them as a tool tip:

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

beforeRunningCommand nop command echo 'Phrases Recognized in step_definitions/_.rb' echo '-------------------------------------------' egrep '^\s_([TW]hen|Given|And|But)' ${TM_PROJECT_DIRECTORY}/features/step_definitions/_.rb | sed -e 's| do._$||' | sort input none keyEquivalent ^h name Show web_steps output showAsTooltip scope text.gherkin.feature, source.ruby.rspec.cucumber.steps uuid BA0E41CA-589F-454A-B1FC-49AF1CE6D0DB

https://github.com/aslakhellesoy/cucumber-tmbundle/issues/20

mikehoward commented 13 years ago

Correction: the script as given doesn't handle multiple files correctly:

try this:

echo 'Phrases Recognized in stepdefinitions/.rb' echo '-------------------------------------------' egrep '^\s_([TW]hen|Given|And|But)' ${TM_PROJECT_DIRECTORY}/features/stepdefinitions/.rb | sed -e 's/^._.rb//' -e 's/^://' -e 's| do.*$||' | sort