Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

back to green build

  • Loading branch information...
commit e893016530f1062fe94011ec88e68d0cb909b699 1 parent 9c99247
@markburns markburns authored
Showing with 16 additions and 59 deletions.
  1. +15 −54 README.md
  2. +0 −2  lib/shutl_resource.rb
  3. +1 −3 shutl_resource.gemspec
View
69 README.md
@@ -14,65 +14,16 @@ the request is fine, but we couldn't generate any quotes. It doesn't feel
like a 4xx or a 5xx, but not quite like a 2xx either. Comments/thoughts
more than welcome.
-#Config
-
-`config/initializers/shutl_resource.rb`
-
-```ruby
-Shutl::Resource.configure do |c|
- c.logger = Rails.logger
-end
-```
-
-```ruby
-class ApplicationController
- include Shutl::Resource::ApplicationControllerMethods
-end
-```
-
#Usage
```ruby
-#app/resources/spider_cow.rb
-class SpiderCow
+#app/models/shutl/quote.rb
+class Shutl::QuoteCollection
include Shutl::Resource::Rest
- base_uri "http://localhost:3001"
-end
-
-#app/controllers/spider_cows_controller.rb
-class SpiderCowsController < Shutl::Resource::BackendResourcesController
-end
-
-#/app/converters/boolean_converter.rb
-module BooleanConverter
- extend self
-
- def to_front_end b; b end
- def to_back_end b; b == 'true' end
-end
-
-#/app/converters/spider_cow_converter.rb
-module SpiderCowConverter
- extend Shutl::Resource::Converter
-
- convert :enabled,
- with: BooleanConverter,
- only: :to_back_end
+ base_uri "http://shutl-api-url"
end
-```
-
-
-
-# OAuth2
-It uses OAuth2 Bearer tokens for API calls.
-
-e.g. the following header is attached to requests
-
-`
-Authorization: Bearer some/big/long/base64/thing/goes/here==
-`
-
+The following exceptions may be raised
```
200..399 no problem
299 Shutl::NoQuotesGenerated
@@ -82,7 +33,7 @@ Authorization: Bearer some/big/long/base64/thing/goes/here==
404 Shutl::ResourceNotFound
409 Shutl::ResourceConflict
410 Shutl::ResourceGone
- 422 Shutl::ServerError
+ 422 Shutl::ResourceInvalid
500 Shutl::ServiceUnavailable
```
@@ -92,6 +43,16 @@ Add this line to your rails app's Gemfile:
gem 'shutl_resource'
+# OAuth2
+It uses OAuth2 Bearer tokens for API calls using the shutl_auth gem
+
+e.g. the following header is attached to requests
+
+`
+Authorization: Bearer some/big/long/base64/thing/goes/here==
+`
+
+
## Contributing
View
2  lib/shutl_resource.rb
@@ -1,5 +1,3 @@
-require 'rails/engine'
-
module Shutl
end
View
4 shutl_resource.gemspec
@@ -17,9 +17,7 @@ Gem::Specification.new do |gem|
gem.add_dependency 'httparty', '~> 0.8.3'
gem.add_dependency 'shutl_auth'
- gem.add_dependency 'activesupport', '~> 3.2.3'
- gem.add_dependency 'activemodel', '~> 3.2.3'
- gem.add_dependency 'railties', '~> 3.2.8'
+ gem.add_dependency 'activemodel'
gem.add_development_dependency 'rspec', '~> 2.11.0'
gem.add_development_dependency 'debugger'
Please sign in to comment.
Something went wrong with that request. Please try again.