Sha256: 5c97d645ef31a4d5807f2639f08e2745c4d3a4625ecb931479cfc45779ad7acf

Contents?: true

Size: 556 Bytes

Versions: 12

Compression:

Stored size: 556 Bytes

Contents

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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
onering-client-0.0.46 lib/onering/util.rb
onering-client-0.0.45 lib/onering/util.rb
onering-client-0.0.44 lib/onering/util.rb
onering-client-0.0.43 lib/onering/util.rb
onering-client-0.0.42 lib/onering/util.rb
onering-client-0.0.41 lib/onering/util.rb
onering-client-0.0.40 lib/onering/util.rb
onering-client-0.0.39 lib/onering/util.rb
onering-client-0.0.37 lib/onering/util.rb
onering-client-0.0.36 lib/onering/util.rb
onering-client-0.0.35 lib/onering/util.rb
onering-client-0.0.34 lib/onering/util.rb