README.md in atd-0.3.2 vs README.md in atd-0.4.0
- old
+ new
@@ -1,8 +1,8 @@
[![build status][build status badge]][build status link] [![coverage report][coverage report badge]][coverage report link] [![gem version][gem version badge]][gem version link] [![documentation coverage][documentation coverage badge]][documentation coverage link]
-[documentation coverage badge]: https://img.shields.io/badge/YARD%20coverage-93.18%-green.svg?style=flat-square
+[documentation coverage badge]: https://img.shields.io/badge/YARD%20coverage-100%-brightgreen.svg?style=flat-square
[documentation coverage link]: http://izwick-schachter.gitlab.io/atd/YARD/coverage
[build status badge]: https://gitlab.com/izwick-schachter/atd/badges/master/build.svg?style=flat-square
[build status link]: https://gitlab.com/izwick-schachter/atd/commits/master
@@ -17,10 +17,11 @@
- [Installation](#installation)
- [Usage](#usage)
- [Setup](#setup)
- [Routing](#routing)
- [Basic Routing](#basic-routing)
+ - [Options Hash](#options-hash)
- [Serving Files](#serving-files)
- [Advanced Routing](#advanced-routing)
- [DefaultApp](#defaultapp)
- [Inheritance](#inheritance)
- [Blocks](#blocks)
@@ -35,10 +36,11 @@
- [Design Paradigms](#design-paradigms)
- [Documentation](#documentation)
- [Development](#development)
- [Contributing](#contributing)
+
# ATD
ATD is a new web development backend framework for Ruby. It is built on top of rack, and is meant to be small easy and light. That is why it provides a very minimalist way of writing your backend. It treats a request as a request, without splitting it based on the HTTP method.
## Installation
@@ -123,10 +125,23 @@
```ruby
request "/", "Hello World", ignore: :delete
```
+#### Options Hash
+
+You can pass various options through the options hash. The options hash is put as the last arguemtn when creating a route. For example: `request "/", "Hello World", option: value, other-option: value`
+
+Here is a list of the option which are currently valid and default values:
+
+```ruby
+status: 200 # Integer > 99 and < 1000. This will be the status code returned unless it is overridden by
+status_code: 200 # Same as status, but overrides. A slightly more verbose syntax.
+respond_to: nil # A list of HTTP methods as lowercase symbols which the route should respond to.
+ignore: nil # A list of HTTP methods as lowercase symbols which the route should not respond to.
+```
+
#### Serving Files
All files that you want to serve must be in the `assets` directory if they are, then it is simple to just create a route, and put the filename as the output. For example this will serve `assets/index.html`:
```ruby
@@ -291,10 +306,26 @@
end
```
The compilation works by going through the file extensions from last to first and running the compilations for each extension in that order. For example `file.html.erb` will first be compiled by the ERB compiler, then the output of the ERB compiler will be compiled by the HTML compiler.
+When you include a file with then `request "/route", "file.ext` it will be precompiled, but not compiled. If you want live compilation there are a few options. If you want live compilation and precompilation you will have to use the following syntax:
+
+```ruby
+request "/", "file.ext" do
+ live_compilation_method @http[:output]
+end
+```
+
+If you don't need precompilation and just want live compilation (the ususal use case) then you can just use the following format:
+
+```ruby
+request "/" do
+ live_compilation_method File.read("/assets/file.ext")
+end
+```
+
## Design Paradigms
ATD is designed to fit into many different design paradigms, and to allow each person to adopt their own styles while leaving code readable to everyone. Do do this, the code was left fairly unstructured, but [here are a few examples from well known frameworks](https://gitlab.com/izwick-schachter/atd-examples.git).
## Documentation
@@ -307,6 +338,10 @@
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
## Contributing
-Bug reports and pull requests are welcome on GitLab at https://gitlab.com/izwick-schachter/atd/issues. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
+Bug reports and pull requests are welcome on GitLab at https://gitlab.com/izwick-schachter/atd/issues. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
+
+### Contribution Policies
+
+Every constribution should correspond to a relevent issue which you keep up to date with notes on what you are working on. Each issues gets branched off of development and is named issue/<issue number>. When you are ready to merege it back in, make sure it passes both rubocop and all the tests. Each issue should get additional test if necessary.
\ No newline at end of file