Skip to content

Instantly share code, notes, and snippets.

@fukayatsu
Created February 19, 2014 06:49
Show Gist options
  • Save fukayatsu/9087223 to your computer and use it in GitHub Desktop.
Save fukayatsu/9087223 to your computer and use it in GitHub Desktop.
作るかもしれないgem
# 知見 - 登録されるとつらいユーザー名リスト - Qiita http://qiita.com/phimcall/items/4c559b70f70ea7f1953b
require 'reserved_string'
ReservedString.configure do |config|
config.strip_string = true # default
config.use_default_list = true # default
config.lists = {
your_list: %w(foo bar baz),
another_list: %w(hoge piyo),
}
end
"foo".reserved? #=> true
"foo".reserved_in_your_list? #=> true
"hoge".reserved? #=> true
"hoge".reserved_in_your_list? #=> false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment