r46697 - in /branches/upstream/libapp-nopaste-perl/current: Changes META.yml lib/App/Nopaste.pm lib/App/Nopaste/Service/Debian.pm lib/App/Nopaste/Service/Gist.pm
dmn at users.alioth.debian.org
dmn at users.alioth.debian.org
Tue Nov 3 05:55:26 UTC 2009
Author: dmn
Date: Tue Nov 3 05:54:47 2009
New Revision: 46697
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=46697
Log:
[svn-upgrade] Integrating new upstream version, libapp-nopaste-perl (0.17)
Modified:
branches/upstream/libapp-nopaste-perl/current/Changes
branches/upstream/libapp-nopaste-perl/current/META.yml
branches/upstream/libapp-nopaste-perl/current/lib/App/Nopaste.pm
branches/upstream/libapp-nopaste-perl/current/lib/App/Nopaste/Service/Debian.pm
branches/upstream/libapp-nopaste-perl/current/lib/App/Nopaste/Service/Gist.pm
Modified: branches/upstream/libapp-nopaste-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-nopaste-perl/current/Changes?rev=46697&op=diff
==============================================================================
--- branches/upstream/libapp-nopaste-perl/current/Changes (original)
+++ branches/upstream/libapp-nopaste-perl/current/Changes Tue Nov 3 05:54:47 2009
@@ -1,4 +1,8 @@
Revision history for App-Nopaste
+
+0.17 Mon Nov 2 13:20:24 2009
+ fix Gist support harder by using the API rather than scraping (rjbs)
+ Improve --lang support for Debian (gregoa at debian.org) [rt.cpan.org #47911]
0.16 Fri Oct 16 14:32:09 2009
Fix Gist support (ckuskie at sterling.net) [rt.cpan.org #50500]
Modified: branches/upstream/libapp-nopaste-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-nopaste-perl/current/META.yml?rev=46697&op=diff
==============================================================================
--- branches/upstream/libapp-nopaste-perl/current/META.yml (original)
+++ branches/upstream/libapp-nopaste-perl/current/META.yml Tue Nov 3 05:54:47 2009
@@ -26,4 +26,4 @@
homepage: http://github.com/sartak/app-nopaste/tree
license: http://dev.perl.org/licenses/
repository: git://github.com/sartak/app-nopaste.git
-version: 0.16
+version: 0.17
Modified: branches/upstream/libapp-nopaste-perl/current/lib/App/Nopaste.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-nopaste-perl/current/lib/App/Nopaste.pm?rev=46697&op=diff
==============================================================================
--- branches/upstream/libapp-nopaste-perl/current/lib/App/Nopaste.pm (original)
+++ branches/upstream/libapp-nopaste-perl/current/lib/App/Nopaste.pm Tue Nov 3 05:54:47 2009
@@ -6,7 +6,7 @@
use base 'Exporter';
our @EXPORT_OK = 'nopaste';
-our $VERSION = '0.16';
+our $VERSION = '0.17';
sub nopaste {
# process arguments {{{
Modified: branches/upstream/libapp-nopaste-perl/current/lib/App/Nopaste/Service/Debian.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-nopaste-perl/current/lib/App/Nopaste/Service/Debian.pm?rev=46697&op=diff
==============================================================================
--- branches/upstream/libapp-nopaste-perl/current/lib/App/Nopaste/Service/Debian.pm (original)
+++ branches/upstream/libapp-nopaste-perl/current/lib/App/Nopaste/Service/Debian.pm Tue Nov 3 05:54:47 2009
@@ -4,425 +4,167 @@
use base 'App::Nopaste::Service';
my $languages = {
- "Plain" => "-1",
- "a65" => "3",
- "aap" => "4",
- "abaqus" => "5",
- "abc" => "6",
- "abel" => "7",
- "acedb" => "8",
- "ada" => "9",
- "aflex" => "10",
- "ahdl" => "11",
- "alsaconf" => "12",
- "amiga" => "13",
- "aml" => "14",
- "ampl" => "15",
- "antlr" => "16",
- "ant" => "17",
- "apachestyle" => "18",
- "apache" => "19",
- "arch" => "20",
- "art" => "21",
- "asm68k" => "22",
- "asmh8300" => "23",
- "asm" => "24",
- "asn" => "25",
- "aspperl" => "26",
- "aspvbs" => "27",
- "asterisk" => "28",
- "atlas" => "29",
- "automake" => "30",
- "ave" => "31",
- "awk" => "32",
- "ayacc" => "33",
- "baan" => "34",
- "basic" => "35",
- "bc" => "36",
- "bdf" => "37",
- "bib" => "38",
- "bindzone" => "39",
- "blank" => "40",
- "btm" => "41",
- "b" => "42",
- "calendar" => "43",
- "catalog" => "44",
- "cdl" => "45",
- "cfg" => "46",
- "cf" => "47",
- "changelog" => "48",
- "change" => "49",
- "chaskell" => "50",
- "cheetah" => "51",
- "chill" => "52",
- "ch" => "53",
- "clean" => "54",
- "clipper" => "55",
- "cl" => "56",
- "cobol" => "57",
- "colortest" => "58",
- "config" => "59",
- "conf" => "60",
- "cpp" => "61",
- "crm" => "62",
- "crontab" => "63",
- "csc" => "64",
- "csh" => "65",
- "csp" => "66",
- "css" => "67",
- "cs" => "68",
- "cterm" => "69",
- "ctrlh" => "70",
- "cuplsim" => "71",
- "cupl" => "72",
- "c" => "73",
- "cvsrc" => "74",
- "cvs" => "75",
- "cweb" => "76",
- "cynlib" => "77",
- "cynpp" => "78",
- "dcd" => "79",
- "dcl" => "80",
- "debchangelog" => "81",
- "debcontrol" => "82",
- "debsources" => "83",
- "def" => "84",
- "desc" => "85",
- "desktop" => "86",
- "diff" => "87",
- "dircolors" => "88",
- "diva" => "89",
- "dns" => "90",
- "docbksgml" => "91",
- "docbk" => "92",
- "docbkxml" => "93",
- "dosbatch" => "94",
- "dosini" => "95",
- "dot" => "96",
- "dracula" => "97",
- "dsl" => "98",
- "dtd" => "99",
- "dtml" => "100",
- "d" => "101",
- "dylanintr" => "102",
- "dylanlid" => "103",
- "dylan" => "104",
- "ecd" => "105",
- "edif" => "106",
- "eiffel" => "107",
- "elf" => "108",
- "elinks" => "109",
- "elmfilt" => "110",
- "erlang" => "111",
- "eruby" => "112",
- "esmtprc" => "113",
- "esqlc" => "114",
- "esterel" => "115",
- "eterm" => "116",
- "exim" => "117",
- "expect" => "118",
- "exports" => "119",
- "fasm" => "120",
- "fdcc" => "121",
- "fetchmail" => "122",
- "fgl" => "123",
- "focexec" => "124",
- "form" => "125",
- "forth" => "126",
- "fortran" => "127",
- "foxpro" => "128",
- "fstab" => "129",
- "fvwm2m4" => "130",
- "fvwm" => "131",
- "gdb" => "132",
- "gdmo" => "133",
- "gedcom" => "134",
- "gkrellmrc" => "135",
- "gnuplot" => "136",
- "gpg" => "137",
- "gp" => "138",
- "grads" => "139",
- "groff" => "140",
- "grub" => "141",
- "gsp" => "142",
- "gtkrc" => "143",
- "haskell" => "144",
- "hb" => "145",
- "help" => "146",
- "hercules" => "147",
- "hex" => "148",
- "hitest" => "149",
- "hog" => "150",
- "htmlcheetah" => "151",
- "htmlm4" => "152",
- "htmlos" => "153",
- "html" => "154",
- "ia64" => "155",
- "icemenu" => "156",
- "icon" => "157",
- "idlang" => "158",
- "idl" => "159",
- "indent" => "160",
- "inform" => "161",
- "inittab" => "162",
- "ipfilter" => "163",
- "ishd" => "164",
- "iss" => "165",
- "ist" => "166",
- "jal" => "167",
- "jam" => "168",
- "jargon" => "169",
- "javacc" => "170",
- "javascript" => "171",
- "java" => "172",
- "jess" => "173",
- "jgraph" => "174",
- "jproperties" => "175",
- "jsp" => "176",
- "kix" => "177",
- "kscript" => "178",
- "kwt" => "179",
- "lace" => "180",
- "latte" => "181",
- "ldif" => "182",
- "lex" => "183",
- "lftp" => "184",
- "lhaskell" => "185",
- "libao" => "186",
- "lifelines" => "187",
- "lilo" => "188",
- "lisp" => "189",
- "lite" => "190",
- "logtalk" => "191",
- "lotos" => "192",
- "lout" => "193",
- "lpc" => "194",
- "lprolog" => "195",
- "lscript" => "196",
- "lss" => "197",
- "lua" => "198",
- "lynx" => "199",
- "m4" => "200",
- "mailcap" => "201",
- "mail" => "202",
- "make" => "203",
- "manual" => "204",
- "man" => "205",
- "maple" => "206",
- "masm" => "207",
- "mason" => "208",
- "master" => "209",
- "matlab" => "210",
- "mel" => "211",
- "mf" => "212",
- "mgp" => "213",
- "mib" => "214",
- "mma" => "215",
- "mmix" => "216",
- "modconf" => "217",
- "model" => "218",
- "modsim3" => "219",
- "modula2" => "220",
- "modula3" => "221",
- "monk" => "222",
- "moo" => "223",
- "mplayerconf" => "224",
- "mp" => "225",
- "msidl" => "226",
- "msql" => "227",
- "mush" => "228",
- "muttrc" => "229",
- "mysql" => "230",
- "named" => "231",
- "nasm" => "232",
- "nastran" => "233",
- "natural" => "234",
- "ncf" => "235",
- "netrc" => "236",
- "nosyntax" => "237",
- "nqc" => "238",
- "nroff" => "239",
- "nsis" => "240",
- "objcpp" => "241",
- "objc" => "242",
- "ocaml" => "243",
- "occam" => "244",
- "omnimark" => "245",
- "openroad" => "246",
- "opl" => "247",
- "ora" => "248",
- "papp" => "249",
- "pascal" => "250",
- "pcap" => "251",
- "pccts" => "252",
- "perl" => "253",
- "pfmain" => "254",
- "pf" => "255",
- "php" => "256",
- "phtml" => "257",
- "pic" => "258",
- "pike" => "259",
- "pilrc" => "260",
- "pine" => "261",
- "pinfo" => "262",
- "plm" => "263",
- "plp" => "264",
- "plsql" => "265",
- "pod" => "266",
- "postscr" => "267",
- "po" => "268",
- "povini" => "269",
- "pov" => "270",
- "ppd" => "271",
- "ppwiz" => "272",
- "prescribe" => "273",
- "procmail" => "274",
- "progress" => "275",
- "prolog" => "276",
- "psf" => "277",
- "ptcap" => "278",
- "purifylog" => "279",
- "pyrex" => "280",
- "python" => "281",
- "qf" => "282",
- "quake" => "283",
- "radiance" => "284",
- "ratpoison" => "285",
- "rcslog" => "286",
- "rcs" => "287",
- "rc" => "288",
- "readline" => "289",
- "rebol" => "291",
- "registry" => "292",
- "remind" => "293",
- "resolv" => "294",
- "rexx" => "295",
- "rib" => "296",
- "rnc" => "297",
- "robots" => "298",
- "rpcgen" => "299",
- "rpl" => "300",
- "rst" => "301",
- "rtf" => "302",
- "ruby" => "303",
- "r" => "304",
- "samba" => "305",
- "sas" => "306",
- "sather" => "307",
- "scheme" => "308",
- "scilab" => "309",
- "screen" => "310",
- "sdl" => "311",
- "sed" => "312",
- "sendpr" => "313",
- "sgmldecl" => "314",
- "sgmllnx" => "315",
- "sgml" => "316",
- "sh" => "317",
- "sicad" => "318",
- "simula" => "319",
- "sindacmp" => "320",
- "sindaout" => "321",
- "sinda" => "322",
- "skill" => "323",
- "slang" => "324",
- "slice" => "325",
- "slrnrc" => "326",
- "slrnsc" => "327",
- "sl" => "328",
- "smarty" => "329",
- "smil" => "330",
- "smith" => "331",
- "sml" => "332",
- "sm" => "333",
- "snnsnet" => "334",
- "snnspat" => "335",
- "snnsres" => "336",
- "snobol4" => "337",
- "specman" => "338",
- "spec" => "339",
- "spice" => "340",
- "splint" => "341",
- "spup" => "342",
- "spyce" => "343",
- "sqlforms" => "344",
- "sqlj" => "345",
- "sql" => "346",
- "sqr" => "347",
- "squid" => "348",
- "sshconfig" => "349",
- "sshdconfig" => "350",
- "stp" => "351",
- "strace" => "352",
- "st" => "353",
- "sudoers" => "354",
- "svn" => "355",
- "syncolor" => "356",
- "synload" => "357",
- "syntax" => "358",
- "tads" => "359",
- "tags" => "360",
- "takcmp" => "361",
- "takout" => "362",
- "tak" => "363",
- "tasm" => "364",
- "tcl" => "365",
- "tcsh" => "366",
- "terminfo" => "367",
- "texinfo" => "368",
- "texmf" => "369",
- "tex" => "370",
- "tf" => "371",
- "tidy" => "372",
- "tilde" => "373",
- "tli" => "374",
- "tpp" => "375",
- "trasys" => "376",
- "tsalt" => "377",
- "tsscl" => "378",
- "tssgm" => "379",
- "tssop" => "380",
- "uc" => "381",
- "uil" => "382",
- "valgrind" => "383",
- "vb" => "384",
- "verilogams" => "385",
- "verilog" => "386",
- "vgrindefs" => "387",
- "vhdl" => "388",
- "viminfo" => "389",
- "vim" => "390",
- "virata" => "391",
- "vmasm" => "392",
- "vrml" => "393",
- "vsejcl" => "394",
- "wdiff" => "395",
- "webmacro" => "396",
- "web" => "397",
- "wget" => "398",
- "whitespace" => "399",
- "winbatch" => "400",
- "wml" => "401",
- "wsh" => "402",
- "wvdial" => "403",
- "xdefaults" => "404",
- "xf86conf" => "405",
- "xhtml" => "406",
- "xkb" => "407",
- "xmath" => "408",
- "xml" => "409",
- "xmodmap" => "410",
- "xpm2" => "411",
- "xpm" => "412",
- "xsd" => "413",
- "xslt" => "414",
- "xs" => "415",
- "xxd" => "416",
- "yacc" => "417",
- "yaml" => "418",
- "z8a" => "419",
- "zsh" => "420",
- "Plain" => "421",
+ "text" => "-1",
+ "abap" => "823",
+ "antlr" => "849",
+ "antlr-as" => "800",
+ "antlr-cpp" => "893",
+ "antlr-csharp" => "879",
+ "antlr-java" => "837",
+ "antlr-objc" => "838",
+ "antlr-perl" => "862",
+ "antlr-python" => "842",
+ "antlr-ruby" => "900",
+ "apacheconf" => "760",
+ "applescript" => "883",
+ "as" => "807",
+ "as3" => "889",
+ "aspx-cs" => "858",
+ "aspx-vb" => "857",
+ "basemake" => "841",
+ "bash" => "749",
+ "bat" => "847",
+ "bbcode" => "813",
+ "befunge" => "820",
+ "boo" => "805",
+ "brainfuck" => "745",
+ "c" => "788",
+ "cheetah" => "880",
+ "clojure" => "860",
+ "c-objdump" => "821",
+ "common-lisp" => "887",
+ "console" => "871",
+ "control" => "818",
+ "cpp" => "781",
+ "cpp-objdump" => "872",
+ "csharp" => "875",
+ "css" => "772",
+ "css+django" => "796",
+ "css+erb" => "776",
+ "css+genshitext" => "753",
+ "css+mako" => "829",
+ "css+myghty" => "754",
+ "css+php" => "751",
+ "css+smarty" => "877",
+ "cython" => "853",
+ "d" => "810",
+ "delphi" => "743",
+ "diff" => "826",
+ "django" => "759",
+ "d-objdump" => "774",
+ "dpatch" => "768",
+ "dylan" => "785",
+ "erb" => "812",
+ "erl" => "856",
+ "erlang" => "855",
+ "evoque" => "783",
+ "fortran" => "777",
+ "gas" => "846",
+ "genshi" => "790",
+ "genshitext" => "844",
+ "glsl" => "843",
+ "gnuplot" => "778",
+ "groff" => "859",
+ "haskell" => "834",
+ "html" => "789",
+ "html+cheetah" => "746",
+ "html+django" => "750",
+ "html+evoque" => "747",
+ "html+genshi" => "865",
+ "html+mako" => "825",
+ "html+myghty" => "770",
+ "html+php" => "830",
+ "html+smarty" => "884",
+ "ini" => "868",
+ "io" => "832",
+ "irc" => "793",
+ "java" => "763",
+ "js" => "886",
+ "js+cheetah" => "824",
+ "js+django" => "851",
+ "js+erb" => "839",
+ "js+genshitext" => "764",
+ "js+mako" => "744",
+ "js+myghty" => "798",
+ "jsp" => "822",
+ "js+php" => "894",
+ "js+smarty" => "773",
+ "lhs" => "890",
+ "lighty" => "762",
+ "llvm" => "881",
+ "logtalk" => "811",
+ "lua" => "835",
+ "make" => "831",
+ "mako" => "792",
+ "matlab" => "787",
+ "matlabsession" => "827",
+ "minid" => "852",
+ "modelica" => "861",
+ "moocode" => "869",
+ "mupad" => "816",
+ "mxml" => "898",
+ "myghty" => "864",
+ "mysql" => "779",
+ "nasm" => "899",
+ "newspeak" => "870",
+ "nginx" => "882",
+ "numpy" => "748",
+ "objdump" => "828",
+ "objective-c" => "885",
+ "ocaml" => "806",
+ "perl" => "867",
+ "php" => "892",
+ "pot" => "782",
+ "pov" => "836",
+ "prolog" => "794",
+ "py3tb" => "815",
+ "pycon" => "848",
+ "pytb" => "891",
+ "python" => "795",
+ "python3" => "845",
+ "ragel" => "755",
+ "ragel-c" => "854",
+ "ragel-cpp" => "819",
+ "ragel-d" => "769",
+ "ragel-em" => "888",
+ "ragel-java" => "767",
+ "ragel-objc" => "896",
+ "ragel-ruby" => "863",
+ "raw" => "873",
+ "rb" => "814",
+ "rbcon" => "771",
+ "rebol" => "780",
+ "redcode" => "758",
+ "rhtml" => "766",
+ "rst" => "791",
+ "scala" => "761",
+ "scheme" => "765",
+ "smalltalk" => "797",
+ "smarty" => "756",
+ "sourceslist" => "742",
+ "splus" => "803",
+ "sql" => "895",
+ "sqlite3" => "804",
+ "squidconf" => "809",
+ "tcl" => "866",
+ "tcsh" => "874",
+ "tex" => "876",
+ "text" => "878",
+ "trac-wiki" => "786",
+ "vala" => "833",
+ "vb.net" => "808",
+ "vim" => "752",
+ "xml" => "840",
+ "xml+cheetah" => "850",
+ "xml+django" => "897",
+ "xml+erb" => "817",
+ "xml+evoque" => "757",
+ "xml+mako" => "801",
+ "xml+myghty" => "901",
+ "xml+php" => "775",
+ "xml+smarty" => "784",
+ "xslt" => "802",
+ "yaml" => "799",
};
sub uri { "http://paste.debian.net/" }
Modified: branches/upstream/libapp-nopaste-perl/current/lib/App/Nopaste/Service/Gist.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapp-nopaste-perl/current/lib/App/Nopaste/Service/Gist.pm?rev=46697&op=diff
==============================================================================
--- branches/upstream/libapp-nopaste-perl/current/lib/App/Nopaste/Service/Gist.pm (original)
+++ branches/upstream/libapp-nopaste-perl/current/lib/App/Nopaste/Service/Gist.pm Tue Nov 3 05:54:47 2009
@@ -13,21 +13,20 @@
sub run {
my ($self, %arg) = @_;
- my $mech = WWW::Mechanize->new;
+ my $ua = LWP::UserAgent->new;
my %auth = $self->_get_auth;
- $mech->get('http://gist.github.com');
- $mech->submit_form(
- form_number => 2,
- fields => {
- 'file_ext[gistfile1]' => '.' . ( $arg{lang} || 'txt' ),
- 'file_contents[gistfile1]' => $arg{text},
- %auth,
- },
+ my $res = $ua->post(
+ 'http://gist.github.com/api/v1/json/new',
+ {
+ 'file_ext[gistfile1]' => '.' . ( $arg{lang} || 'txt' ),
+ 'file_contents[gistfile1]' => $arg{text},
+ %auth,
+ },
);
- return $self->return($mech => @_);
+ return $self->return($res);
}
sub _get_auth {
@@ -64,10 +63,9 @@
}
sub return {
- my $self = shift;
- my $mech = shift;
+ my ($self, $res) = @_;
- my ($id) = $mech->content =~ m{gist: (\d+)\s*-};
+ my ($id) = $res->content =~ qr{"repo":"([0-9a-f]+)"};
return (0, "Could not find paste link.") if !$id;
return (1, "http://gist.github.com/$id");
More information about the Pkg-perl-cvs-commits
mailing list