aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2013-10-28add cookie support to responseGibheer2-6/+125
This commit adds support for response cookies. Response now has a method cookie to fetch the current cookie. One cookie has multiple crumbs which represent a key value pair. For each crumb multiple options can be set according to the specs.
2013-10-22some more cleanup of the responseGibheer1-0/+3
2013-10-22some minor cleanupGibheer1-3/+0
2013-10-22add cookie support in requestsGibheer1-1/+20
2013-10-21remove debug outputGibheer1-1/+0
2013-09-10allow a dash in the middle url partGibheer1-1/+1
2013-09-09sort routes for more specific resultsGibheer1-2/+2
This change sorts the routes to get the most specific routes first and avoid hitting a route which is not the most specific match. With this the regex to extract variables is made more strict to avoid matching half of the URI.
2013-09-03add partial render methodGibheer1-6/+13
This enables the user to render partial templates to embed them into other templates and the like.
2013-08-14add request method override for browsersGibheer1-1/+29
Browsers are not able to send put, delete or any other request from a plain html form. This limits the possibilities with APIs so an override was introduced in many frameworks in the form, that `_method` could be defined in a post payload. With this, zero also supports `_method` in the post payload to make it possible to use all functions of the API with javascript through plain html.
2013-08-13fix paramter extraction with charsetGibheer1-1/+12
This fixes a bug where a charset in the content type blocked the extraction of the payload. A browser may send a string like multipart/form-data; charset=UTF-8 which include? could not find the defined types. Now it gets split and then checked against the defined types.
2013-08-06make it possible to push lists as paramtersGibheer1-1/+12
This makes it possible to push lists as paramters by naming the variables with `[]` at the end, for example `foo[]`.
2013-07-29drop 1.8 support and add 2.0Gibheer1-5/+0
As MRI 1.8 is EOL, I think it is okay to drop 1.8 support.
2013-07-26extend server with protocol informationGibheer1-0/+47
This extends the server class with the information, if it is serving http or https. This can then be used to generate a root uri to the web application.
2013-07-22Revert "generate a name from the server details"Gibheer1-7/+0
This reverts commit 94a2d399eb81d59f9d66c5d16121611c4d1ae0cd.
2013-07-22generate a name from the server detailsGibheer1-0/+7
2013-02-27reworked the rendererGibheer1-47/+38
The renderer is now a bit smaller and asks the TemplateFinder for the actual resources. That way it can just concentrate on rendering instead of finding out, which stuff actually exists and which not.
2013-02-27reworked parts of the template finderGibheer1-4/+72
The template finder is now the instance to ask for templates. It was already looking for them, so it should be able to handle questions regarding the existence of templates too.
2013-02-12extracted the building of template treeGibheer2-44/+168
This step is a preparation to extend the functionality of the renderer. To make the main class easier, the search for templates and building of the tree is extracted into its own class.
2013-02-11change route regex to string beginning and endGibheer1-2/+7
2013-01-29catch empty routesGibheer1-1/+1
This fixes a bug where an empty route would catch all requests resulting in all routes found with the empty route.
2013-01-29remove more leftovers from class_optionsGibheer2-3/+0
2013-01-29make request and response staticGibheer1-10/+11
This is a step back but makes the controller work for the moment. It should be reimplemented in a better way in the future.
2013-01-28use new api of class_optionsGibheer2-3/+4
2013-01-11use class_options for the controllerGibheer2-25/+5
2013-01-09take strings for bodyGibheer1-1/+19
This makes the assignment for bodies easier when using plain Strings. They get wrapped in an array as per rack definition. For every other type, they have to implement each and get directly set as body or have to be rendered to Strings first.
2013-01-08prepare for version 0.2.0Gibheer1-1/+1
2013-01-06Kill all mutants in Zero::RendererStormwind1-1/+2
2013-01-06Kill all mutants i Zero::RequestStormwind1-1/+1
Fix tests for PATCH, because spec_helper didn't support it and the tests where wrong. Remove if statement from "conent_type", because ruby already returns nil, if the requested key in a hash is not found. (Sounds a bit ugly, but it's true.)
2013-01-06Kill all mutants in Zero::Request::ParameterStormwind1-2/+3
I've also changed "extract_query_params" because it does not matter, if the query string it empty or not for the "parse_string" method.
2013-01-05Kill almost all mutants in Zero::Request:AcceptTypeStormwind1-6/+3
Killed 13 of 14 mutants. I will see later, how it's possible to kill the last one. I also fixed the return value of "preferred", if the in initialize given string is empty. Fixed the default value here.
2012-12-23Add zero-fix18 to dependenciesStormwind1-0/+6
Will make URI.decode_www_form usable with Ruby 1.8.
2012-12-23Remove 1.8 fixesStormwind2-92/+0
The fixes for Ruby 1.8 will take place in a seperate gem. So I remove all the changes here.
2012-12-22Merge remote-tracking branch 'origin/master'Stormwind1-4/+8
2012-12-22Remove backports from dependenciesStormwind1-3/+0
... not used.
2012-12-22Improve query valid regexStormwind1-2/+2
Now a query string cannot look like 'foo=bar=foo' anymore.
2012-12-22kick out Zero::Request from routerGibheer1-4/+8
To make the router more loose, I replaced the router with the plain environment. The custom parameters are stored in the same key, so can be used by the request later.
2012-12-22Add and use decode_www_form_component_18Stormwind1-22/+42
This replaces URI encoded chars back into their original form.
2012-12-22Add first implementation of decode_www_form_18Stormwind1-1/+26
Seperates now foo=bar&bar=foo;baz=foo queries. But does not fix url encoded strings and such things. Also added testcase for an empty query string.
2012-12-22Add patch for URI decode_www_formStormwind2-0/+46
Plus some specs. This should it make later possible to make Zero work with Ruby 1.8. But at the moment it only routes to the original decode_www_form method, if it exists. Otherwise it returns an empty Array. So this will still fail on the 1.8 versions at the moment.
2012-12-18reuse render for actual renderingGibheer1-4/+13
The splitting of rendering and processing is good, but on the other side it makes some double steps or even introduce workarounds. That is why I made the method #render just a call to the renderer. This should help much more than the strict seperation. The method will only return the resulting string and not add it to the body of the response. That still has to be taken care of by the user.
2012-12-17require backports for ruby 1.8Gibheer1-0/+4
2012-12-17remove require_relative to make it 1.8 compatibleGibheer3-10/+10
2012-12-17release 0.1.2v0.1.2Gibheer1-1/+1
2012-12-17initialize the responseGibheer1-1/+1
2012-12-13added LICENSE and release new versionv0.1.1Gibheer1-1/+1
2012-12-13added options to controllerGibheer1-5/+16
This avoids hardcoding the options into the controller and therefore should it make possible to use Rack::Request or Sinatra apps as requests. (That sounds so weird.)
2012-12-12typo in the documentationGibheer1-1/+1
2012-12-12replaced .create with .new on Zero::RequestGibheer3-6/+23
2012-12-10define the renderer at initializationGibheer1-4/+5
2012-12-01release version 0.1.0v0.1.0Gibheer1-1/+1