module Onering module Util module String def nil_empty return nil if (self.strip.chomp.empty? rescue true) self.strip.chomp end end def self.gem_path(name) if Gem::Specification.respond_to?(:find_by_name) return Gem::Specification.find_by_name(name).gem_dir else return Gem::SourceIndex.from_installed_gems.find_name(name).sort{|a,b| a.version.to_s <=> b.version.to_s }.last.full_gem_path end end end end class String include Onering::Util::String end