lib/onering/util.rb in onering-client-0.0.33 vs lib/onering/util.rb in onering-client-0.0.34

- old
+ new

@@ -4,9 +4,20 @@ 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 \ No newline at end of file