lib/guard.rb
# Locate a path to a Guard gem.
#
# @param [String] name the name of the Guard without the prefix `guard-`
# @return [String] the full path to the Guard gem
#
Locate a path to a Guard gem.
Locate a path to a Guard gem .
def locate_guard(name)
      if Gem::Version.create(Gem::VERSION) >= Gem::Version.create('1.8.0')
        Gem::Specification.find_by_name("guard-#{ name }").full_gem_path
      else
        Gem.source_index.find_name("guard-#{ name }").last.full_gem_path
      end
    rescue
      UI.error "Could not find 'guard-#{ name }' gem path."
    end
def locate_guard ( name ) if Gem :: Version . create ( Gem :: VERSION ) >= Gem :: Version . create ( '1.8.0' ) Gem :: Specification . find_by_name ( "guard-#{ name }" ) . full_gem_path else Gem . source_index . find_name ( "guard-#{ name }" ) . last . full_gem_path end rescue UI . error "Could not find 'guard-#{ name }' gem path." end
Locate a path to a Guard gem.
Locate a path to a Guard gem .
the full path to the Guard gem
the full path to the Guard gem
String
name
name the name of the Guard without the prefix `guard-`
name the name of the Guard without the prefix ` guard - `