Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Support validation of states with validate_args.

Signed-off-by: Felipe Coury <felipe.coury@gmail.com>
  • Loading branch information...
commit 6425c50e6ff5b43330b5f73a6e3a080149772e74 1 parent b83136c
@runpaint authored fcoury committed
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/octopi/base.rb
View
7 lib/octopi/base.rb
@@ -19,7 +19,12 @@ class Base
:msg => "%s is an invalid filename"},
:sha => {
:pat => /^[a-f0-9]{40}$/,
- :msg => "%s is an invalid SHA hash"}
+ :msg => "%s is an invalid SHA hash"},
+ :state => {
+ # FIXME: Any way to access Issue::STATES from here?
+ :pat => /^(open|closed)$/,
+ :msg => "%s is an invalid state; should be 'open' or 'closed'."
+ }
}
attr_accessor :api
Please sign in to comment.
Something went wrong with that request. Please try again.