Top Level Namespace

Defined Under Namespace

Modules: Rmobio Classes: Geocode, Messaging, Platform, Registration, Rss

Constant Summary

Constants included from Rmobio::ConfigManager

Rmobio::ConfigManager::EXTERNAL_CONTEXT_PROP, Rmobio::ConfigManager::MOBIO_CONFIG

Instance Method Summary collapse

Methods included from Rmobio::ConfigManager

#get_external_context

Methods included from Rmobio::ClientInfo

#checkClient, #getDeviceAttrValue, #get_device_info, #paramsFromXml

Methods included from Rmobio::Utils

#backURL, #backurl_xml, #cacheControl, #cacheimg, #cacheloader, get_domain, #logHeaders

Methods included from Rmobio::Auth

#authorize, #get_msisdn, #get_user_attributes

Instance Method Details

#get_ad_from_serviceObject

above included functions do get_ad to just retrieve an ad from a backend network call below gets an ad from the hosted ads service for a specified page and app

Parameters:

  • :service - the URL of the service, defaults to the URL specified in MOBIO_CONFIG

  • :app - the name of the application

  • :page - the specified page in the application

Returns



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/rmobio/ads.rb', line 40

def get_ad_from_service
  service=params[:service]
  service||=MOBIO_CONFIG['ad_service']
  service||='http://homer.qa.mobiolabs.com/hub/ads/pages'
  service=service + "?"
  adurl=service+"app=" + params[:app] if params[:app]
  adurl=adurl+"&" if params[:app] and params[:page]
  adurl=service+"page="+params[:page] if params[:page]
  text=nil
  begin 
    text=open(adurl).read
  rescue
    logger.info "Failed to open ad url: " + $!
  end 
  if text
    doc=XmlSimple.xml_in(adtext) 
    @linktext=doc["linktext"][0]
    @linkurl=doc["linkurl"][0]
    @phonetext=doc["calltext"][0]
    @phone=doc["callurl"][0]
    @moretext=doc["moretext"][0]
    logger.info("Ad Url: " + @urltext + "(" + @adurl + "): " + @extratext) if @urltext
    logger.info("Ad phone: " + @phonetext + "(" + @phone + ")") if @phonetext and @phone
  end
end

#get_versionObject

BEGIN CRUISE SECTION



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/rmobio/raketasks.rb', line 32

def get_version
  if not defined? PKG_VERSION
    @version = `svnversion #{RAILS_ROOT}`
    if @version.nil? || @version == 'exported'
      @version = '1.0.0'
    else
      @version =~ /([0-9]+)/
      @version = $1
      if @version.nil?
        @version = '1.0.0'
      else
        @version = '1.0.' + @version
      end
    end
  else
    @version = PKG_VERSION
  end
  @version
end