spec/liberty_buildpack/services/mongo_spec.rb
def add_mongo(doc, id, lib_id, user, password, host, port)
        mongo = REXML::Element.new('mongo', doc)
        mongo.add_attribute('id', id)
        mongo.add_attribute('libraryRef', lib_id)
        if user.nil? == false
          mongo.add_attribute('user', user)
          mongo.add_attribute('password', password)
        end
        # add hostNames and ports elements.
        hosts = REXML::Element.new('hostNames', mongo)
        hosts.add_text(host)
        ports = REXML::Element.new('ports', mongo)
        ports.add_text(port)
      end
#----------------------------------------------
# Helper method that adds a mongo stanza into a REXML server.xml doc
#----------------------------------------------
Helper method that adds a mongo stanza into a REXML server.xml doc
Helper method that adds a mongo stanza into a REXML server . xml doc
def add_mongo(doc, id, lib_id, user, password, host, port)
        mongo = REXML::Element.new('mongo', doc)
        mongo.add_attribute('id', id)
        mongo.add_attribute('libraryRef', lib_id)
        if user.nil? == false
          mongo.add_attribute('user', user)
          mongo.add_attribute('password', password)
        end
        hosts = REXML::Element.new('hostNames', mongo)
        hosts.add_text(host)
        ports = REXML::Element.new('ports', mongo)
        ports.add_text(port)
      end
def add_mongo ( doc , id , lib_id , user , password , host , port ) mongo = REXML :: Element . new ( 'mongo' , doc ) mongo . add_attribute ( 'id' , id ) mongo . add_attribute ( 'libraryRef' , lib_id ) if user . nil? == false mongo . add_attribute ( 'user' , user ) mongo . add_attribute ( 'password' , password ) end hosts = REXML :: Element . new ( 'hostNames' , mongo ) hosts . add_text ( host ) ports = REXML :: Element . new ( 'ports' , mongo ) ports . add_text ( port ) end
Helper method that adds a mongo stanza into a REXML server.xml doc
Helper method that adds a mongo stanza into a REXML server . xml doc
# add hostNames and ports elements.
doc
id
lib_id
user
password
host
port