Skip to content
Browse files

Support validation of states with validate_args.

Signed-off-by: Felipe Coury <felipe.coury@gmail.com>
  • Loading branch information...
1 parent b83136c commit 6425c50e6ff5b43330b5f73a6e3a080149772e74 @runpaint committed with fcoury
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

0 comments on commit 6425c50

Please sign in to comment.
Something went wrong with that request. Please try again.