api-responder 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e644c487abf917a2b09605522d5a6eea22ba00a3
4
+ data.tar.gz: fff540efb9ff3b85a5d8d1aa702a924e503b06c2
5
+ SHA512:
6
+ metadata.gz: 1f273be385811064816361f5b8c5fb72187d7517f5a4bb64fc3be28eb68cf21cc1358df4c4697f639c7dfa3115d9a16f32f4aedd8dd6e1300ff9b202987fc05f
7
+ data.tar.gz: b06b74ef949fb87e5544574a8528677b92d12c330735f2c24819e53a5ff55cb6ec71017e393245d350596e106c53aacd6677cdb73fa6a05f4783f4ba8ec887ba
data/.gitignore CHANGED
@@ -1,8 +1,12 @@
1
1
  *.gem
2
2
  *.rbc
3
+ *.iml
3
4
  .bundle
4
5
  .config
5
6
  .yardoc
7
+ .idea
8
+ .rvmrc
9
+ .rbx
6
10
  Gemfile.lock
7
11
  InstalledFiles
8
12
  _yardoc
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
5
+ - jruby
data/Gemfile CHANGED
@@ -5,11 +5,11 @@ gemspec
5
5
 
6
6
  group :development, :test do
7
7
  gem 'rake'
8
- gem 'minitest'
9
- gem 'minitest-ansi'
8
+ gem 'minitest', :require => false
9
+ gem 'minitest-ansi', :require => false
10
10
  gem 'mocha', '>= 0.13', :require => false
11
11
  end
12
12
 
13
13
  group :test do
14
- gem 'actionpack'
14
+ gem 'actionpack', :require => false
15
15
  end
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Responders::ApiResponder
1
+ # Responders::ApiResponder [![Build Status](https://travis-ci.org/jgraichen/api-responder.png?branch=master)](https://travis-ci.org/jgraichen/api-responder)
2
2
 
3
3
  `ApiResponder` simplifies version dependent rendering of API resources using a custom responder and a mixin for decorators or models (decorators are recommended).
4
4
 
@@ -26,7 +26,7 @@ class AppResponder < Responder
26
26
  end
27
27
 
28
28
  class MyController < ApplicationController
29
- self.responder = ApiResponder
29
+ self.responder = AppResponder
30
30
  end
31
31
  ```
32
32
 
@@ -74,7 +74,7 @@ class MyController < ApplicationController
74
74
  end
75
75
  ```
76
76
 
77
- I recommend using `ApiResponder` in combination with [jgraichen/decorate-responder](/jgraichen/decorate-responder) and the decorator pattern (like [draper](/drapergem/draper)):
77
+ I recommend using `ApiResponder` in combination with [jgraichen/decorate-responder](https://github.com/jgraichen/decorate-responder) and the decorator pattern (like [draper](https://github.com/drapergem/draper)):
78
78
 
79
79
  ```ruby
80
80
  class User < ActiveRecord::Base
@@ -127,7 +127,7 @@ rescue_from ApiResponder::Formattable::UnsupportedVersion do
127
127
  end
128
128
  ```
129
129
 
130
- Check out [jgraichen/paginate-responder](/jgraichen/paginate-responder) for automagic pagination support including HTTP Link headers.
130
+ Check out [jgraichen/paginate-responder](https://github.com/jgraichen/paginate-responder) for automagic pagination support including HTTP Link headers.
131
131
 
132
132
  ## Contributing
133
133
 
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'api-responder'
4
+ require 'api-responder/version'
5
5
 
6
6
  Gem::Specification.new do |gem|
7
7
  gem.name = "api-responder"
@@ -11,6 +11,7 @@ Gem::Specification.new do |gem|
11
11
  gem.description = %q{ApiResponder simplifies version dependent rendering of API resources.}
12
12
  gem.summary = %q{ApiResponder simplifies version dependent rendering of API resources.}
13
13
  gem.homepage = ""
14
+ gem.license = 'MIT'
14
15
 
15
16
  gem.files = `git ls-files`.split($/)
16
17
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
@@ -2,7 +2,7 @@ module ApiResponder
2
2
  module VERSION
3
3
  MAJOR = 1
4
4
  MINOR = 0
5
- PATCH = 0
5
+ PATCH = 1
6
6
  STAGE = nil
7
7
 
8
8
  def self.to_s
@@ -6,16 +6,17 @@ Bundler.setup
6
6
  # Configure Rails
7
7
  ENV["RAILS_ENV"] = "test"
8
8
 
9
- require 'mocha'
9
+ require 'mocha/setup'
10
10
  require 'minitest/ansi'
11
11
  MiniTest::ANSI.use!
12
12
 
13
13
  require 'active_support'
14
14
  require 'action_controller'
15
+ require 'action_controller/test_case'
16
+ require 'api-responder'
15
17
 
16
-
17
- Responders::Routes = ActionDispatch::Routing::RouteSet.new
18
- Responders::Routes.draw do
18
+ Routes = ActionDispatch::Routing::RouteSet.new
19
+ Routes.draw do
19
20
  match '/' => 'app#index'
20
21
  match '/api/v1/index' => 'app#v1'
21
22
  match '/api/v2/index' => 'app#v2'
@@ -23,7 +24,7 @@ Responders::Routes.draw do
23
24
  end
24
25
 
25
26
  class ActiveSupport::TestCase
26
- setup do @routes = Responders::Routes end
27
+ setup do @routes = Routes end
27
28
  end
28
29
 
29
30
  class AppResponder < ActionController::Responder
@@ -31,7 +32,7 @@ class AppResponder < ActionController::Responder
31
32
  end
32
33
 
33
34
  class AppController < ActionController::Base
34
- include Responders::Routes.url_helpers
35
+ include Routes.url_helpers
35
36
  self.responder = AppResponder
36
37
  respond_to :json
37
38
  rescue_from ApiResponder::Formattable::UnsupportedVersion do head :not_acceptable end
@@ -41,7 +42,7 @@ class AppController < ActionController::Base
41
42
  end
42
43
 
43
44
  class CustomController < ActionController::Base
44
- include Responders::Routes.url_helpers
45
+ include Routes.url_helpers
45
46
  self.responder = AppResponder
46
47
  respond_to :json
47
48
  rescue_from ApiResponder::Formattable::UnsupportedVersion do head :not_acceptable end
metadata CHANGED
@@ -1,30 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api-responder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
5
- prerelease:
4
+ version: 1.0.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Jan Graichen
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-02-11 00:00:00.000000000 Z
11
+ date: 2013-07-24 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: activesupport
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ">="
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ">="
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  description: ApiResponder simplifies version dependent rendering of API resources.
@@ -34,7 +31,8 @@ executables: []
34
31
  extensions: []
35
32
  extra_rdoc_files: []
36
33
  files:
37
- - ".gitignore"
34
+ - .gitignore
35
+ - .travis.yml
38
36
  - Gemfile
39
37
  - LICENSE.txt
40
38
  - README.md
@@ -48,34 +46,28 @@ files:
48
46
  - test/formattable_test.rb
49
47
  - test/test_helper.rb
50
48
  homepage: ''
51
- licenses: []
49
+ licenses:
50
+ - MIT
51
+ metadata: {}
52
52
  post_install_message:
53
53
  rdoc_options: []
54
54
  require_paths:
55
55
  - lib
56
56
  required_ruby_version: !ruby/object:Gem::Requirement
57
- none: false
58
57
  requirements:
59
- - - ">="
58
+ - - '>='
60
59
  - !ruby/object:Gem::Version
61
60
  version: '0'
62
- segments:
63
- - 0
64
- hash: -1741048395832599252
65
61
  required_rubygems_version: !ruby/object:Gem::Requirement
66
- none: false
67
62
  requirements:
68
- - - ">="
63
+ - - '>='
69
64
  - !ruby/object:Gem::Version
70
65
  version: '0'
71
- segments:
72
- - 0
73
- hash: -1741048395832599252
74
66
  requirements: []
75
67
  rubyforge_project:
76
- rubygems_version: 1.8.25
68
+ rubygems_version: 2.0.3
77
69
  signing_key:
78
- specification_version: 3
70
+ specification_version: 4
79
71
  summary: ApiResponder simplifies version dependent rendering of API resources.
80
72
  test_files:
81
73
  - test/api_responder_test.rb