<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/mobile/config.rb</filename>
    </added>
    <added>
      <filename>lib/mobile/globe/callback.rb</filename>
    </added>
    <added>
      <filename>lib/mobile/globe/response.rb</filename>
    </added>
    <added>
      <filename>lib/mobile/globe/rest.rb</filename>
    </added>
    <added>
      <filename>lib/mobile/globe/soap.rb</filename>
    </added>
    <added>
      <filename>lib/mobile/support.rb</filename>
    </added>
    <added>
      <filename>lib/mobile/version.rb</filename>
    </added>
    <added>
      <filename>lib/test.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,5 @@
 .project
 .loadpath
 *.gem
+*.swp
 </diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,28 @@
-= Mobile API Ruby Gem
+= Globe-Mobile API in Ruby
 
-== Required gems
+* Website: http://github.com/gregmoreno/globe-mobile/tree/master
+
+== Developers
+* {Greg Moreno}[http://gregmoreno.ca] &lt;hello at gregmoreno dot ca&gt;
+* {Neil Decapia}
+* {Mikong Galero}
+
+== Description
+
+globe-mobile provides a Ruby-based interface to Globe Telecoms Mobile API platform.
+To learn more of the Globe's API, visit http://www.globelabs.com.ph
+
+
+== External gem dependencies 
 
 For using the API:
-  soap4r
-  xml-simple
+* SOAP4R (tested with soap4r-1.5.8)
+* XMLSimple (tested with xml-simple-1.0.12)
 
-For testing and debugging:
+For running tests
   rspec
-  ruby-debug
\ No newline at end of file
+
+
+== Usage examples
+
+TODO:</diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -1,2 +1,17 @@
-require File.dirname(__FILE__) + '/base'
-require File.dirname(__FILE__) + '/mobile/globe'
\ No newline at end of file
+require 'rubygems'
+
+module Mobile; end
+
+require 'xmlsimple'
+require 'hpricot'
+require 'net/https'
+require 'uri'
+
+def require_local(suffix)
+  require(File.expand_path(File.join(File.dirname(__FILE__), suffix)))
+end
+
+require_local('mobile/support')
+require_local('mobile/version')
+require_local('mobile/globe')
+</diff>
      <filename>lib/mobile.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,183 +1,10 @@
-require 'rubygems'
-require 'soap/rpc/driver'
-require 'xmlsimple'
-
-module Mobile
-  
-  # Required values when using this service
-  # :username =&gt; String
-  # :pin =&gt; String
-  class GlobeProxy &lt; Base
-    include Validation
-    
-    # This is the version of the API that we will use
-    API_VERSION = '1.03'
-
-    def initialize(params = {})
-      params = {
-        :transport =&gt; 'soap',
-        :namespace =&gt; 'http://ESCPlatform/xsd',
-        :url       =&gt; 'http://iplaypen.globelabs.com.ph:1881/axis2/services/Platform/'
-      }.merge(params)
-
-      super(params)
-      validate_presence_of :username, :pin, :transport, :in =&gt; self.params
-    end
-    
-    def server
-      @server ||= send(&quot;initialize_proxy_#{self.params[:transport]}&quot;, self.params)
-    end
-        
-    def send_sms(sms)
-      validate_presence_of :to, :message, :in =&gt; sms
-      @response = server.send_sms(
-        self.params[:username], 
-        self.params[:pin],
-        sms[:to], 
-        sms[:message],
-        sms[:display] || '1',
-        sms[:user_data_header] || '',
-	      sms[:message_waiting_indicator] || '',
-        sms[:coding] || '0'
-      )
-    end
-
-    def send_mms(mms)
-      validate_presence_of :to, :subject, :in =&gt; mms
-      @response = server.send_mms(
-        self.params[:username],
-        self.params[:pin],
-        mms[:to],
-        mms[:subject],
-        mms[:body] || ''
-      )
-    end
-    
-    class &lt;&lt; self
-      def parse_callback_xml(xml)
-        GlobeCallback.parse_xml(xml)
-      end
-    end
-    
-    #######
-    private
-    #######
-    
-    def initialize_proxy_soap(params)
-      ProxySoap.new(params)      
-    end
-    
-    class ProxySoap
-      def initialize(params)
-        @server = SOAP::RPC::Driver.new(params[:url], params[:namespace])
-        @server.add_method('sendSMS', 'uName', 'uPin', 'MSISDN', 'messageString',
-          'Display', 'udh', 'mwi', 'coding')
-
-        @server.add_method('sendMMS', 'uName', 'uPin', 'MSISDN', 'Subject', 'SMIL')
-      end
-      
-      def send_sms(uname, upin, msisdn, message, display, udh, mwi, coding)
-        result = @server.sendSMS(uname, upin, msisdn, message, display, udh, mwi, coding)
-        GlobeProxyResponse.new(result.to_i)
-      end
-
-      def send_mms(u_name, u_pin, msisdn, subject, smil)
-        result = @server.sendMMS(u_name, u_pin, msisdn, subject, smil)
-
-        # XXX API bug? If smil is not well-formed, sendMMS returns an empty
-        # SOAP::Mapping::Object. For now, force the result to &quot;402 MMS sending failed&quot;
-        result = 402 if result.is_a? SOAP::Mapping::Object
-        GlobeProxyResponse.new(result.to_i)
-      end
-    end
-    
-    class GlobeCallback
-      @@field_map = {
-        'id'          =&gt; :id,        # unique message identifier
-        'source'      =&gt; :sender,    # sender MSISDN/cellular number
-        'target'      =&gt; :recipient, # receiver MSISDN/cellular number
-        'msg'         =&gt; :message,   # message
-        'file'        =&gt; :files,     # MMS attachments
-        'subject'     =&gt; :subject,   # MMS subject
-        'messageType' =&gt; :type,      # &quot;SMS&quot; or &quot;MMS&quot;
-        'type'        =&gt; :status     # delivery status report code
-      }
-      
-      class &lt;&lt; self
-        def parse_xml(xml)
-          message = XmlSimple.xml_in(xml)
-          message['param'].inject({}) do |h, param|
-            k, v = param['name'].first, param['value'].first
-            # Should still capture unknown parameters
-            h[(f = @@field_map[k]) ? f : k.to_sym] = v
-            h
-          end
-        end
-      end
-    end
-  end
-  
-  class GlobeProxyResponse
-    attr_reader :response_code
-    
-    @@error_map = {
-      :sms_accepted? =&gt; 201,
-      :sms_failed?   =&gt; 401,
-      :mms_accepted? =&gt; 202,
-      :mms_failed?   =&gt; 402,
-      :not_allowed?  =&gt; 301,
-      :cap_exceeded? =&gt; 302,
-      :invalid_size? =&gt; 303,
-      :connection_exceeded? =&gt; 304,
-      :invalid_login?   =&gt; 305,
-      :invalid_target?  =&gt; 501,
-      :invalid_display? =&gt; 502,
-      :invalid_mwi?     =&gt; 503,
-      :invalid_coding?  =&gt; 504,
-    }
-    
-    @@status_messages = {
-      201 =&gt; &quot;SMS Accepted for delivery&quot;,
-      202 =&gt; &quot;MMS Accepted for delivery&quot;,
-      301 =&gt; &quot;User is not allowed to access this service&quot;,
-      302 =&gt; &quot;User exceeded daily cap&quot;,
-      303 =&gt; &quot;Invalid message_length&quot;,
-      304 =&gt; &quot;Maximum number of simultaneous connections reached&quot;,
-      305 =&gt; &quot;Invalid login credentials&quot;,
-      401 =&gt; &quot;SMS sending failed&quot;,
-      402 =&gt; &quot;MMS sending failed&quot;,
-      501 =&gt; &quot;Invalid target MSISDN&quot;,
-      502 =&gt; &quot;Invalid display type&quot;,
-      503 =&gt; &quot;Invalid MWI&quot;,
-      504 =&gt; &quot;Invalid coding&quot;,
-      505 =&gt; &quot;Empty value given in required argument&quot;,
-      506 =&gt; &quot;Badly formed XML in SOAP request&quot;,
-      507 =&gt; &quot;Argument too large&quot;,
-      509 =&gt; &quot;Malformed SMIL&quot;
-    }
-    
-    def initialize(code)
-      @response_code = code
-    end
-    
-    def valid?
-      [201, 202].include?(@response_code)
-    end
-    
-    def message(code = @response_code)
-      if msg = @@status_messages[code]
-        msg
-      else
-        raise ArgumentError, &quot;undefined response code&quot;
-      end
-    end
-
-    def method_missing(method_id)
-      if code = @@error_map[method_id.to_sym]
-        @response_code == code
-      else
-        raise NoMethodError, &quot;undefined GlobeProxyResponse matcher&quot;
-      end
-    end
-  end
+module Mobile::Globe
+  class Response; end
+  module SOAP; end
+  module REST; end
+  module Callback; end
 end
+require 'mobile/globe/response'
+require 'mobile/globe/soap'
+require 'mobile/globe/rest'
+require 'mobile/globe/callback'</diff>
      <filename>lib/mobile/globe.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>lib/base.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>0a4179b01e46592ab40c9b7b7d57f02a8cb62cfc</id>
    </parent>
  </parents>
  <author>
    <name>Greg Moreno</name>
    <email>greg@gokou.local</email>
  </author>
  <url>http://github.com/gregmoreno/globe-mobile/commit/45462a76a78ae0a015610345413510e8d571c75f</url>
  <id>45462a76a78ae0a015610345413510e8d571c75f</id>
  <committed-date>2009-04-03T04:16:49-07:00</committed-date>
  <authored-date>2009-04-03T04:16:49-07:00</authored-date>
  <message>Major refactor and support for REST.</message>
  <tree>d6e55e520e41d4e6493ea0d72c8de41813d9e3a4</tree>
  <committer>
    <name>Greg Moreno</name>
    <email>greg@gokou.local</email>
  </committer>
</commit>
