module Chore::Util

Collection of utilities and helpers used by Chore internally

Public Instance Methods

constantize(camel_cased_word) click to toggle source

To avoid bringing in all of active_support, we implemented constantize here

# File lib/chore/util.rb, line 7
def constantize(camel_cased_word)
  names = camel_cased_word.split('::')
  names.shift if names.empty? || names.first.empty?

  constant = Object
  names.each do |name|
    constant = constant.const_defined?(name) ? constant.const_get(name) : constant.const_missing(name)
  end
  constant
end
procline(str) click to toggle source
# File lib/chore/util.rb, line 18
def procline(str)
  $0 = str
end