class Object

Public Instance Methods

clean_path(path) click to toggle source
# File lib/hiptest-publisher/utils.rb, line 37
def clean_path(path)
  Pathname.new(path).cleanpath.to_s
end
hiptest_publisher_path() click to toggle source
# File lib/hiptest-publisher/utils.rb, line 8
def hiptest_publisher_path
  Gem.loaded_specs['hiptest-publisher'].full_gem_path
rescue
  '.'
end
hiptest_publisher_version() click to toggle source
# File lib/hiptest-publisher/utils.rb, line 14
def hiptest_publisher_version
  Gem.loaded_specs['hiptest-publisher'].version.to_s
rescue
  File.read("#{hiptest_publisher_path}/VERSION").strip if File.exists?("#{hiptest_publisher_path}/VERSION")
end
pluralize(count, singular, plural=nil) click to toggle source
# File lib/hiptest-publisher/utils.rb, line 28
def pluralize(count, singular, plural=nil)
  word = pluralize_word(count, singular, plural)
  "#{count} #{word}"
end
pluralize_word(count, singular, plural=nil) click to toggle source
# File lib/hiptest-publisher/utils.rb, line 20
def pluralize_word(count, singular, plural=nil)
  if count == 1
    singular
  else
    "#{singular}s"
  end
end
singularize(name) click to toggle source
# File lib/hiptest-publisher/utils.rb, line 33
def singularize(name)
  name.to_s.chomp("s")
end