packages feed

Ketchup 0.4.0 → 0.4.1

raw patch · 49 files changed

+34/−28 lines, 49 filesbinary-addedPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

.git/COMMIT_EDITMSG view
@@ -1,15 +1,1 @@-Remove unneded comments-# Please enter the commit message for your changes. Lines starting-# with '#' will be ignored, and an empty message aborts the commit.-# On branch master-# Your branch is up-to-date with 'origin/master'.-#-# Changes to be committed:-#	modified:   Ketchup/Routing.hs-#-# Untracked files:-#	.gitignore~-#	Ketchup.cabal~-#	example.core-#	gendocs.sh~-#+Fix URL parsing to work with empty sections
.git/ORIG_HEAD view
@@ -1,1 +1,1 @@-85b4c8d2256c11c570cacf64895353c0b9bd374f+2382296bb15427910f85a9a4a5be39677a6d9005
.git/index view

binary file changed (1136 → 1136 bytes)

.git/logs/HEAD view
@@ -28,3 +28,12 @@ 694dea2e0fc5c15b1ef710cee6f953b1afb623bd 695dee0b1313795711418347aedd65f5bcbca02f Hamcha <zikyky@gmail.com> 1407086956 +0200	commit: Version bump for cabal 695dee0b1313795711418347aedd65f5bcbca02f 83ac9915be5493cf66f1f96de88b5edce6c39929 Hamcha <zikyky@gmail.com> 1407714950 +0200	commit: Doesn't work, but it's a start, will work on it tomorrow 83ac9915be5493cf66f1f96de88b5edce6c39929 85b4c8d2256c11c570cacf64895353c0b9bd374f Hamcha <zikyky@gmail.com> 1407715002 +0200	commit: Remove unneded comments+85b4c8d2256c11c570cacf64895353c0b9bd374f 9c007b2a800ccd64ea6589e3aaf436dd386c5879 Hamcha <zikyky@gmail.com> 1411050080 +0200	commit: Routing rewritten, now Regexp(tm) free+9c007b2a800ccd64ea6589e3aaf436dd386c5879 c91a524dd7612f6b6b1a10132e0315ee38c4e7ac Hamcha <zikyky@gmail.com> 1411050528 +0200	commit: Take "Regexp" out of docs+c91a524dd7612f6b6b1a10132e0315ee38c4e7ac 2382296bb15427910f85a9a4a5be39677a6d9005 Hamcha <zikyky@gmail.com> 1411050630 +0200	commit: Ehm+2382296bb15427910f85a9a4a5be39677a6d9005 2382296bb15427910f85a9a4a5be39677a6d9005 Hamcha <zikyky@gmail.com> 1411050635 +0200	rebase -i (start): checkout refs/remotes/origin/master+2382296bb15427910f85a9a4a5be39677a6d9005 2382296bb15427910f85a9a4a5be39677a6d9005 Hamcha <zikyky@gmail.com> 1411050635 +0200	rebase -i (finish): returning to refs/heads/master+2382296bb15427910f85a9a4a5be39677a6d9005 c91a524dd7612f6b6b1a10132e0315ee38c4e7ac Hamcha <zikyky@gmail.com> 1411050647 +0200	rebase -i (start): checkout HEAD~2+c91a524dd7612f6b6b1a10132e0315ee38c4e7ac 2ba3de09ad5a0b0b58d543705380a9a44a31ae2b Hamcha <zikyky@gmail.com> 1411050648 +0200	rebase -i (squash): Take "Regexp" out of docs+2ba3de09ad5a0b0b58d543705380a9a44a31ae2b 2ba3de09ad5a0b0b58d543705380a9a44a31ae2b Hamcha <zikyky@gmail.com> 1411050651 +0200	rebase -i (finish): returning to refs/heads/master+2ba3de09ad5a0b0b58d543705380a9a44a31ae2b cec17859d0a08acd01b9297297b32881bc4f7104 Hamcha <zikyky@gmail.com> 1411488463 +0200	commit: Fix URL parsing to work with empty sections
.git/logs/refs/heads/master view
@@ -28,3 +28,8 @@ 694dea2e0fc5c15b1ef710cee6f953b1afb623bd 695dee0b1313795711418347aedd65f5bcbca02f Hamcha <zikyky@gmail.com> 1407086956 +0200	commit: Version bump for cabal 695dee0b1313795711418347aedd65f5bcbca02f 83ac9915be5493cf66f1f96de88b5edce6c39929 Hamcha <zikyky@gmail.com> 1407714950 +0200	commit: Doesn't work, but it's a start, will work on it tomorrow 83ac9915be5493cf66f1f96de88b5edce6c39929 85b4c8d2256c11c570cacf64895353c0b9bd374f Hamcha <zikyky@gmail.com> 1407715002 +0200	commit: Remove unneded comments+85b4c8d2256c11c570cacf64895353c0b9bd374f 9c007b2a800ccd64ea6589e3aaf436dd386c5879 Hamcha <zikyky@gmail.com> 1411050080 +0200	commit: Routing rewritten, now Regexp(tm) free+9c007b2a800ccd64ea6589e3aaf436dd386c5879 c91a524dd7612f6b6b1a10132e0315ee38c4e7ac Hamcha <zikyky@gmail.com> 1411050528 +0200	commit: Take "Regexp" out of docs+c91a524dd7612f6b6b1a10132e0315ee38c4e7ac 2382296bb15427910f85a9a4a5be39677a6d9005 Hamcha <zikyky@gmail.com> 1411050630 +0200	commit: Ehm+2382296bb15427910f85a9a4a5be39677a6d9005 2ba3de09ad5a0b0b58d543705380a9a44a31ae2b Hamcha <zikyky@gmail.com> 1411050651 +0200	rebase -i (finish): refs/heads/master onto c91a524dd7612f6b6b1a10132e0315ee38c4e7ac+2ba3de09ad5a0b0b58d543705380a9a44a31ae2b cec17859d0a08acd01b9297297b32881bc4f7104 Hamcha <zikyky@gmail.com> 1411488463 +0200	commit: Fix URL parsing to work with empty sections
.git/logs/refs/remotes/origin/master view
@@ -25,3 +25,7 @@ 694dea2e0fc5c15b1ef710cee6f953b1afb623bd 695dee0b1313795711418347aedd65f5bcbca02f Hamcha <zikyky@gmail.com> 1407086961 +0200	update by push 695dee0b1313795711418347aedd65f5bcbca02f 83ac9915be5493cf66f1f96de88b5edce6c39929 Hamcha <zikyky@gmail.com> 1407714965 +0200	update by push 83ac9915be5493cf66f1f96de88b5edce6c39929 85b4c8d2256c11c570cacf64895353c0b9bd374f Hamcha <zikyky@gmail.com> 1407715015 +0200	update by push+85b4c8d2256c11c570cacf64895353c0b9bd374f 9c007b2a800ccd64ea6589e3aaf436dd386c5879 Hamcha <zikyky@gmail.com> 1411050084 +0200	update by push+9c007b2a800ccd64ea6589e3aaf436dd386c5879 c91a524dd7612f6b6b1a10132e0315ee38c4e7ac Hamcha <zikyky@gmail.com> 1411050533 +0200	update by push+c91a524dd7612f6b6b1a10132e0315ee38c4e7ac 2ba3de09ad5a0b0b58d543705380a9a44a31ae2b Hamcha <zikyky@gmail.com> 1411050656 +0200	update by push+2ba3de09ad5a0b0b58d543705380a9a44a31ae2b cec17859d0a08acd01b9297297b32881bc4f7104 Hamcha <zikyky@gmail.com> 1411488467 +0200	update by push
+ .git/objects/02/229886a2c1f7622014655936cde900885e9810 view

binary file changed (absent → 884 bytes)

+ .git/objects/17/f0b2fcca6037579949bed0f62ed8508429855c view

binary file changed (absent → 931 bytes)

+ .git/objects/20/0e8a1d9e64883c4442f155f3695cb99ecdb392 view

binary file changed (absent → 321 bytes)

+ .git/objects/23/82296bb15427910f85a9a4a5be39677a6d9005 view

binary file changed (absent → 151 bytes)

+ .git/objects/2b/a3de09ad5a0b0b58d543705380a9a44a31ae2b view
@@ -0,0 +1,1 @@+xÎ»j1…a×zŠÁ­ÁŒ®+	.]‡¼Àh4k/kYËF†8OŸmÒ»=ðq~nµNŒq»¾Š@0Æ£u£ËÖjY‹–˜sJ6—RL…©ð0¨…VytHŒ8dC‘¹'|Lb‰FgC)c‡¤èÙom…U¾œ~§ù5¿Î×JÓýÈ­~€v۟Go"Ð ªmÝÒº¼‚ûGê‹fý§\ågÙC{vh#”Æßê¡ZE_
+ .git/objects/33/126c8981c21f9755c7eaca90e81ca7d5d6fd62 view

binary file changed (absent → 208 bytes)

+ .git/objects/62/25034f4b33110b1e1e8bb9938649989dcadc77 view

binary file changed (absent → 321 bytes)

+ .git/objects/6d/9f02d0603a9cec81b119f36d16fdcfaebada1e view

binary file changed (absent → 706 bytes)

+ .git/objects/8d/9c0ac2c94c7beeb8658183e131da7ce5effefb view

binary file changed (absent → 321 bytes)

+ .git/objects/98/786dafc5b13181d5e4f6806a98124101fe317b view

binary file changed (absent → 955 bytes)

+ .git/objects/9c/007b2a800ccd64ea6589e3aaf436dd386c5879 view

binary file changed (absent → 181 bytes)

+ .git/objects/9c/39c23ffc9888f808ae093fdbd8ab7f27d175a2 view
@@ -0,0 +1,1 @@+xe”MoÛ0†w.ÐÿÀ5‡¥Aw@±a½µÝ!Ãz(ú1`T¶˜Z,i]7ÿ~¯ä$‡
0™")òá+×Ö×ôñìËçwZùAoç$­I„ç;KÓöáýñÑñÑnÍŠ^9n)uÊZZ=<ÜRâ™.XîØ‰ãݜš>F¼Ù-ý²œò*Gçggtã¯I¼(û{ڊ„‹ª2oKã+Ý´§ÿf“§NiFÕL*QçuoU$å4qW³Öª¶e'ø”Ös2kÚúžå7ªVv±ŽÌ´RiÃ(\…0§—>	‰Ú yë~_I›ÝÖ%—ŽY—£B/dð¸lŽ¢áFJ½×‡N÷œß!~0Ò^d|ºRÉ4”ÛÕ´î]“)kdKÓo·?ÎÉ;pZûHΧ9àñî†î|/Æ=—<TTÇDSÃKzªz€¯.¬ÕS‰¹Ïè›R<¶¶˜Êè›Æ“åÉSF‘˜«K	ë»ì¥¥)ƨ@ésÃ>ÏV•IßSd¼ÁŽîß¶<>šL&ô•;Í®1œ²í¡ej|„›Š’ȯ÷Z"c֍FD@ÏÀ5§2ÚÆöÜv—«‚+ÏyoycÑ6A˜,GQ	¿	¤6?ø]·½Û°>]ŽÅäãö¢‡?½‰yª(&#”»öÖú!Ã.òⴛÛþàÚ) $šÍ:ÓñB¶ÓlVøíýF‚;¯?/ê­p’ˆäÅydvIƒ:³TtØûçš9_”ë»Àb$WééÞ©@4Úl°þÉÉküã®.çtŹ 4Ï
ŽW¦ÜÔҞ“û È+ò6e&5A­yn)p”N¹†‘W·ªBÚñˆ]£‡4„såoÁ=îÃ_FKsƒ
+ .git/objects/9e/312f7816623a831ed832285328746834e6886c view

binary file changed (absent → 953 bytes)

+ .git/objects/ac/4473886e6ba9209e373ecacdf085588c79d527 view

binary file changed (absent → 616 bytes)

+ .git/objects/ba/09adf09da69f7bd0411faa4beae8d28026eb7c view

binary file changed (absent → 958 bytes)

+ .git/objects/c1/1eddba9f3bf52258e78eac875bb8d59575c4ef view

binary file changed (absent → 319 bytes)

+ .git/objects/c3/ba3cdbd0c2f4fe371654b40c77b6d22dddc459 view

binary file changed (absent → 915 bytes)

+ .git/objects/c9/1a524dd7612f6b6b1a10132e0315ee38c4e7ac view

binary file changed (absent → 169 bytes)

+ .git/objects/ce/c17859d0a08acd01b9297297b32881bc4f7104 view

binary file changed (absent → 185 bytes)

+ .git/objects/d5/02a059e60a1f025639da03678a15d54c4b3e78 view

binary file changed (absent → 208 bytes)

+ .git/objects/d6/ef2f17034da6c0b06de2b23faea8f7240cf232 view

binary file changed (absent → 207 bytes)

.git/refs/heads/master view
@@ -1,1 +1,1 @@-85b4c8d2256c11c570cacf64895353c0b9bd374f+cec17859d0a08acd01b9297297b32881bc4f7104
.git/refs/remotes/origin/master view
@@ -1,1 +1,1 @@-85b4c8d2256c11c570cacf64895353c0b9bd374f+cec17859d0a08acd01b9297297b32881bc4f7104
Ketchup.cabal view
@@ -1,5 +1,5 @@ Name:           Ketchup
-Version:        0.4.0
+Version:        0.4.1
 Cabal-Version:  >= 1.6
 Build-Type:     Simple
 License:        MIT
@@ -18,7 +18,7 @@     .
     * Basic httpd functionality (IPV4 only for now)
     .
-    * Regexp routing with parameters (ie. \`/user/:name/?\`)
+    * URL Routing with parameters (ie. \`/user/:name/\`)
     .
     * Static file handler (ie. \`static \".\"\` as route/handler)
     .
Ketchup.cabal~ view
@@ -1,5 +1,5 @@ Name:           Ketchup
-Version:        0.3
+Version:        0.4.0
 Cabal-Version:  >= 1.6
 Build-Type:     Simple
 License:        MIT
@@ -18,7 +18,7 @@     .
     * Basic httpd functionality (IPV4 only for now)
     .
-    * Regexp routing with parameters (ie. \`/user/:name/(.\*)\`)
+    * URL Routing with parameters (ie. \`/user/:name/\`)
     .
     * Static file handler (ie. \`static \".\"\` as route/handler)
     .
@@ -29,8 +29,6 @@     The core parts of Ketchup are all depedency free, that includes Ketchup.Httpd and Ketchup.Utils (and to a certain extent, Ketchup.Chunked).
     The dependencies required are for the following modules:
     .
-    * Ketchup.Routing (uses regex-pcre-builtin, This can ben modified to use builtin POSIX regexp)
-    .
     * Ketchup.Static (uses mime-types)
     .
     * Ketchup.Auth (uses base64-bytestring)
@@ -57,7 +55,6 @@     directory           <1.3,
     mime-types          <0.2,
     network             <2.5,
-    regex-pcre-builtin  <1.0,
     text                <2.0
 
 Source-Repository head
+ Ketchup/Auth.hi view

binary file changed (absent → 1502 bytes)

+ Ketchup/Auth.o view

binary file changed (absent → 12392 bytes)

+ Ketchup/Chunked.hi view

binary file changed (absent → 1681 bytes)

+ Ketchup/Chunked.o view

binary file changed (absent → 13656 bytes)

+ Ketchup/Httpd.hi view

binary file changed (absent → 2571 bytes)

+ Ketchup/Httpd.o view

binary file changed (absent → 42304 bytes)

+ Ketchup/Routing.hi view

binary file changed (absent → 2332 bytes)

Ketchup/Routing.hs view
@@ -17,6 +17,7 @@ type Matcher = B.ByteString -> (Bool, Arguments)
 data Arguments = None | Parameters [(B.ByteString, B.ByteString)]
     deriving Show
+
 -- |Router function
 -- Takes a list of routes and iterates through them for every requeust
 route :: [(Matcher, Route)] -- ^ Routes
@@ -30,12 +31,12 @@     params  = snd matched
     matched = (fst r) (uri request)
 
-
 -- |Wrap a handler in a route
 -- Lets you use a handler (no parameters) as a route
 useHandler :: Handler -> Route
 useHandler handler hnd req params = handler hnd req
 
+-- |Create a matchable template with parameters (:param)
 match :: B.ByteString -> Matcher
 match template url =
     (isMatch, Parameters params)
@@ -51,14 +52,17 @@       -> [(B.ByteString, B.ByteString)]
       -> (Bool, [(B.ByteString, B.ByteString)])
 parse []      []       params = (True, params)
+parse [""]    []       params = (True, params)
 parse (u:url) []       params = (False, [])
 parse []      (t:temp) params = (False, [])
 parse (u:url) (t:temp) params
     | B.length t < 1  = parse url temp params
+    | B.length u < 1  = parse url (t:temp) params
     | B.head t == ':' = parse url temp ((B.tail t, u) : params)
     | u == t          = parse url temp params
     | otherwise       = (False, [])
 
+-- |Create a prefix matcher
 prefix :: B.ByteString -> Matcher
 prefix urlPrefix url = (B.isPrefixOf urlPrefix url, None)
 
+ Ketchup/Routing.o view

binary file changed (absent → 20128 bytes)

+ Ketchup/Static.hi view

binary file changed (absent → 1990 bytes)

+ Ketchup/Static.o view

binary file changed (absent → 11208 bytes)

+ Ketchup/Utils.hi view

binary file changed (absent → 2218 bytes)

+ Ketchup/Utils.o view

binary file changed (absent → 36072 bytes)

README.md view
@@ -7,7 +7,7 @@ Currently Ketchup comes with:
 
 - Basic httpd functionality (IPV4 only for now)
-- Regexp routing with parameters (ie. `/user/:name/(.\*)`)
+- URL Routing with parameters (ie. `/user/:name/`)
 - Static file handler (ie. `static "."` as route/handler)
 - Basic Auth (please use it over a HTTPS reverse proxy)
 
@@ -16,7 +16,6 @@ The core parts of Ketchup are all depedency free, that includes Ketchup.Httpd and Ketchup.Utils (and to a certain extent, Ketchup.Chunked).
 The dependencies required are for the following modules:
 
-- Ketchup.Routing (uses **regex-pcre-builtin**, *This can ben modified to use builtin POSIX regexp*)
 - Ketchup.Static (uses **mime-types**)
 - Ketchup.Auth (uses **base64-bytestring**)
 
+ example view

file too large to diff

example.core view

file too large to diff

+ example.hi view

binary file changed (absent → 2970 bytes)

+ example.o view

binary file changed (absent → 36760 bytes)