Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

filter out annoying warnings on cucumber steps

This patch filters out annoying warnings about "ambiguous first argument" that occur on typically formatted Cucumber step definitions like the following:

Given /^I am logged in$/ do
  pending
end

These are particularly annoying since the cursor gets moved to the first occurence of the warning every time you save.
  • Loading branch information...
commit f932a159e21bb833994267f0f19095ad73edb205 1 parent 74683ec
Gabriel Gilder authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 Commands/Validate and Save.tmCommand
View
6 Commands/Validate and Save.tmCommand
@@ -15,6 +15,12 @@ if compiler_ruby.length == 0
end
result = `#{compiler_ruby} -wc "$TM_FILEPATH" 2>&1`
+
+scopes = ENV['TM_SCOPE'].split
+if scopes.include? 'source.ruby.rspec.cucumber.steps'
+ result.gsub!(/^.+warning: ambiguous first argument; put parentheses or even spaces$/, '')
+end
+
if result =~ /:(\d+):/
print result
TextMate.go_to :line => $1
Please sign in to comment.
Something went wrong with that request. Please try again.