@@ -47,6 +47,45 @@ var GitHub = (function () {
4747  return  gh_parser ; 
4848} ) ( ) ; 
4949
50+ var  GitLab  =  ( function  ( )  { 
51+   var  gl_parser  =  function  ( )  {  Parser . apply ( this ,  arguments ) ;  } ; 
52+   util . inherits ( gl_parser ,  Parser ) ; 
53+ 
54+   gl_parser . prototype . parse_body  =  function  ( )  { 
55+     try  {  return  ( this . payload  =  JSON . parse ( this . body ) ) ;  } 
56+     catch  ( e )  {  return  undefined ;  } 
57+   } ; 
58+ 
59+   gl_parser . prototype . verify_signature  =  function  ( )  { 
60+     return  true ; 
61+    } ; 
62+ 
63+   gl_parser . prototype . extract  =  function  ( )  { 
64+     if  ( ! ( this . payload . repository  && 
65+           this . payload . repository . git_ssh_url  && 
66+           this . payload . repository . homepage  && 
67+           this . payload . ref  && 
68+           this . payload . total_commits_count  && 
69+           this . payload . commits ) )  { 
70+       return  undefined ; 
71+     } 
72+ 
73+     var  slug  =  this . payload . repository . git_ssh_url . split ( ':' ) [ 1 ] ; 
74+     if  ( slug . endsWith ( '.git' ) )  { 
75+       slug  =  slug . slice ( 0 , - 4 ) ; 
76+     } 
77+ 
78+     return  ( this . data  =  { 
79+       slug :   slug , 
80+       branch : this . payload . ref . replace ( / ^ r e f s \/ h e a d s \/ / ,  '' ) , 
81+       url :    this . payload . repository . homepage , 
82+       commit : this . payload . total_commits_count  >  0  ? this . payload . commits . slice ( - 1 )  : undefined 
83+     } ) ; 
84+   } ; 
85+ 
86+   return  gl_parser ; 
87+ } ) ( ) ; 
88+ 
5089var  Travis  =  ( function  ( )  { 
5190  var  travis_parser  =  function  ( )  {  Parser . apply ( this ,  arguments ) ;  } ; 
5291  util . inherits ( travis_parser ,  Parser ) ; 
@@ -82,5 +121,6 @@ var Travis = (function () {
82121
83122module . exports  =  { 
84123  GitHub : GitHub , 
124+   GitLab : GitLab , 
85125  Travis : Travis 
86126} ; 
0 commit comments