File: util.rb

package info (click to toggle)
ruby-flipper 0.13.0-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,824 kB
  • sloc: ruby: 13,183; sh: 54; makefile: 14
file content (16 lines) | stat: -rw-r--r-- 342 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module Flipper
  module UI
    module Util
      # Private: 0x3000: fullwidth whitespace
      NON_WHITESPACE_REGEXP = /[^\s#{[0x3000].pack("U")}]/

      def self.blank?(str)
        str.to_s !~ NON_WHITESPACE_REGEXP
      end

      def self.titleize(str)
        str.to_s.split('_').map(&:capitalize).join(' ')
      end
    end
  end
end