module Patterns
  extend ActiveSupport::Concern

  SPECIAL_CHARACTERS = ".-_".freeze
  ALLOWED_CHARACTERS = "[A-Za-z0-9#{Regexp.escape(SPECIAL_CHARACTERS)}]+".freeze
  ROUTE_PATTERN      = /#{ALLOWED_CHARACTERS}/
  LAZY_ROUTE_PATTERN = /#{ALLOWED_CHARACTERS}?/
  NAME_PATTERN       = /\A#{ALLOWED_CHARACTERS}\Z/
  GEM_NAME_BLACKLIST = %w(
    abbrev
    base64
    benchmark
    bigdecimal
    cgi
    cgi-session
    cmath
    complex
    continuation
    coverage
    csv
    date
    delegate
    digest
    drb
    e2mmap
    english
    enumerator
    erb
    etc
    expect
    fcntl
    fiber
    fileutils
    find
    forwardable
    getoptlong
    gserver
    io-console
    io-nonblock
    io-wait
    ipaddr
    irb
    logger
    mathn
    matrix
    mkmf
    monitor
    mutex_m
    net-ftp
    net-http
    net-imap
    net-pop
    net-protocol
    net-smtp
    net-telnet
    nkf
    observer
    open-uri
    open3
    openssl
    optparse
    ostruct
    pathname
    prettyprint
    prime
    profile
    profiler
    pstore
    pty
    rational
    rbconfig
    resolv
    rexml
    rinda
    rss
    rubygems
    scanf
    securerandom
    set
    shellwords
    singleton
    socket
    stringio
    strscan
    sync
    syslog
    tempfile
    thread
    thwait
    time
    timeout
    tk
    tmpdir
    tsort
    un
    unicode_normalize
    uri
    weakref
    webrick
    win32ole
    yaml
    zlib
    ubygems
  ).freeze
end

module Patterns
  extend ActiveSupport::Concern

  SPECIAL_CHARACTERS = ".-_".freeze
  ALLOWED_CHARACTERS = "[A-Za-z0-9#{Regexp.escape(SPECIAL_CHARACTERS)}]+".freeze
  ROUTE_PATTERN      = /#{ALLOWED_CHARACTERS}/
  LAZY_ROUTE_PATTERN = /#{ALLOWED_CHARACTERS}?/
  NAME_PATTERN       = /\A#{ALLOWED_CHARACTERS}\Z/
  GEM_NAME_BLACKLIST = %w(
    abbrev
    base64
    benchmark
    cgi
    cgi-session
    cmath
    complex
    continuation
    coverage
    csv
    date
    delegate
    digest
    drb
    e2mmap
    english
    enumerator
    erb
    etc
    expect
    fcntl
    fiber
    fileutils
    find
    forwardable
    getoptlong
    io-nonblock
    io-wait
    ipaddr
    irb
    logger
    mathn
    matrix
    mkmf
    monitor
    mutex_m
    net-ftp
    net-http
    net-imap
    net-pop
    net-protocol
    net-smtp
    nkf
    observer
    open-uri
    open3
    openssl
    optparse
    ostruct
    pathname
    prettyprint
    prime
    profile
    profiler
    pstore
    pty
    rational
    rbconfig
    resolv
    rexml
    rinda
    rss
    rubygems
    scanf
    securerandom
    set
    shellwords
    singleton
    socket
    stringio
    strscan
    sync
    syslog
    tempfile
    thread
    thwait
    time
    timeout
    tk
    tmpdir
    tsort
    un
    unicode_normalize
    uri
    weakref
    webrick
    win32ole
    yaml
    zlib
    ubygems
  ).freeze
end

Remove extracted gems from blacklist. These need to maintain as standalone gem without blacklist.
Remove extracted gems from blacklist. These need to maintain as standalone gem without blacklist.

 * io-console: https://github.com/ruby/ruby/tree/trunk/ext/io/console
 * bigdecimal: https://github.com/ruby/bigdecimal
 * net-telnet: https://github.com/ruby/net-telnet
 * gserver: https://github.com/ruby/gserver
