lib/cocoapods-core/dependency.rb
# Creates a string representation of the dependency suitable for
# serialization and de-serialization without loss of information. The
# string is also suitable for UI.
#
# @note     This representation is used by the {Lockfile}.
#
# @example  Output examples
#
#           "libPusher"
#           "libPusher (= 1.0)"
#           "libPusher (~> 1.0.1)"
#           "libPusher (> 1.0, < 2.0)"
#           "libPusher (HEAD)"
#           "libPusher (from `www.example.com')"
#           "libPusher (defined in Podfile)"
#           "RestKit/JSON"
#
# @return   [String] the representation of the dependency.
#
Creates a string representation of the dependency suitable for
serialization and de-serialization without loss of information. The
string is also suitable for UI.
Creates a string representation of the dependency suitable for serialization and de - serialization without loss of information . The string is also suitable for UI .
def to_s
      version = ''
      if external?
        version << external_source_description(external_source)
      elsif head?
        version << 'HEAD'
      elsif @version_requirements != Requirement.default
        version << @version_requirements.to_s
      end
      result = @name.dup
      result << " (#{version})" unless version.empty?
      result
    end
def to_s version = '' if external? version << external_source_description ( external_source ) elsif head? version << 'HEAD' elsif @version_requirements != Requirement . default version << @version_requirements . to_s end result = @name . dup result << " (#{version})" unless version . empty? result end
Creates a string representation of the dependency suitable for
serialization and de-serialization without loss of information.
Creates a string representation of the dependency suitable for serialization and de - serialization without loss of information .
the representation of the dependency.
the representation of the dependency .
String
note
This representation is used by the {Lockfile}.
This representation is used by the { Lockfile } .
example
None