README.md in acfs-0.7.0 vs README.md in acfs-0.8.0
- old
+ new
@@ -1,18 +1,21 @@
# Acfs - *API client for services*
[![Gem Version](https://badge.fury.io/rb/acfs.png)](http://badge.fury.io/rb/acfs) [![Build Status](https://travis-ci.org/jgraichen/acfs.png?branch=master)](https://travis-ci.org/jgraichen/acfs) [![Coverage Status](https://coveralls.io/repos/jgraichen/acfs/badge.png?branch=master)](https://coveralls.io/r/jgraichen/acfs) [![Code Climate](https://codeclimate.com/github/jgraichen/acfs.png)](https://codeclimate.com/github/jgraichen/acfs) [![Dependency Status](https://gemnasium.com/jgraichen/acfs.png)](https://gemnasium.com/jgraichen/acfs)
-TODO: Develop asynchronous parallel API client library for service oriented applications.
+Acfs is a library to develop API client libraries for single services within a
+larger service oriented application.
-TODO: Write a gem description
+Acfs covers model and service abstraction, convenient query and filter methods,
+full middleware stack for pre-processing requests and responses on a per service
+level and automatic request queuing and parallel processing. See Usage for more.
## Installation
Add this line to your application's Gemfile:
- gem 'acfs', '0.7.0'
+ gem 'acfs', '0.8.0'
**Note:** Acfs is under development. I'll try to avoid changes to the public
API but internal APIs may change quite often.
And then execute:
@@ -29,20 +32,20 @@
```ruby
class UserService < Acfs::Service
self.base_url = 'http://users.myapp.org'
- # You can configure middlewares you want use for the service here.
+ # You can configure middlewares you want to use for the service here.
# Each service has it own middleware stack.
#
use Acfs::Middleware::JsonDecoder
use Acfs::Middleware::MessagePackDecoder
end
```
-This specifies where the `UserService` can be reached. You can now create some
-models representing resources serviced by the `UserService`.
+This specifies where the `UserService` is located. You can now create some
+models representing resources served by the `UserService`.
```ruby
class User
include Acfs::Model
service UserService # Associate `User` model with `UserService`.
@@ -120,12 +123,33 @@
@user.name # => "John
@comments.size # => 25
@friends[0].name # => "Miraculix"
```
-## TODO
+Acfs has basic update support using `PUT` requests:
-* Create/Update operations
+```ruby
+@user = User.find 5
+@user.name = "Bob"
+
+@user.changed? # => true
+@user.persisted? # => false
+
+@user.save # Or .save!
+ # Will PUT new resource to service synchronously.
+
+@user.changed? # => false
+@user.persisted? # => true
+```
+
+## Roadmap
+
+* Create operations
+* Update
+ * Better new? detection eg. storing ETag from request resources.
+ * Use PATCH for with only changed attributes and `If-Unmodifed-Since`
+ and `If-Match` header fields if resource was surly loaded from service
+ and not created with an id (e.g `User.new id: 5, name: "john"`).
* High level features
* Pagination? Filtering? (If service API provides such features.)
* Messaging Queue support for services and models
* Documentation