Changeset 2153

Show
Ignore:
Timestamp:
01/29/07 18:35:53
Author:
miyagawa
Message:

support camelcase

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • POE-Component-Client-Lingr/trunk/Changes

    r2148 r2153  
    11Revision history for Perl extension POE::Component::Client::Lingr 
     2 
     3  0.02  Mon Jan 29 01:33:58 PST 2007 
     4        - Fixed ticket handling in room.* methods 
     5        - Fixed camelCase method to URI mapping 
     6        - Renamed sample script to bot.pl 
     7        - Added Google Calculator bot example code 
     8        - Set Debug to 0 
    29 
    310  0.01  Sun Jan 28 20:07:34 2007 
  • POE-Component-Client-Lingr/trunk/lib/POE/Component/Client/Lingr.pm

    r2151 r2153  
    22 
    33use strict; 
    4 our $VERSION = '0.01'; 
     4our $VERSION = '0.02'; 
    55 
    66use Data::Visitor::Callback; 
     
    1111 
    1212our $APIBase = "http://www.lingr.com/api"; 
    13 our $Debug = 1
     13our $Debug = 0
    1414 
    1515# scraped from Lingr wiki page 
     
    6161        Alias => 'lingr_ua', 
    6262    ); 
     63 
     64    1; 
    6365} 
    6466 
     
    203205    my($heap, $method, $args) = @_; 
    204206 
    205     my @method = split /\./, $method; 
     207    my @method = map { s/([A-Z])/"_".lc($1)/eg; $_ } split /\./, $method; 
    206208    my $uri = URI->new($APIBase . "/" . join("/", @method)); 
    207209 
     
    250252    my $uri = shift; 
    251253    $uri =~ s/^\Q$APIBase\E//; 
    252     my @method = grep length, split '/', $uri; 
     254    my @method = grep length, map { s/_(\w)/uc($1)/eg; $_ } split '/', $uri; 
    253255    return join ".", @method; 
    254256}