sinatra-active-model-serializers 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3eee1dfba4d6f3e8f8f560b5877e31c74f7d21a2
4
- data.tar.gz: d524672188df09d01cdfe9b0ead8114a6b83ca7a
3
+ metadata.gz: 1d72c0b7b8011b0fe2b7d87213cf9892986342e0
4
+ data.tar.gz: f91dd1b1e0e3037346c15dee162dc0228b4be884
5
5
  SHA512:
6
- metadata.gz: 0121b5801dee190060a47df5049f06056a61bcb8dc79bf4fa4002ed77811bb42bf47d3d21a9bac3a57e2e07c782528d4ada0e5a4284f2b3e520d2be54a4ef2ac
7
- data.tar.gz: 845b7be3d130fc90ea7cafb035451c9d2531a9c1890d420e1d4cab88d747307827849158f47842ddf78fc7fe72de7eeb93877822ccc6dc92f86608daa15af3d7
6
+ metadata.gz: 5a960482ea967942b4ee8648bcae8f16a888d2e74a6fa6010f28421763430e7cf1d1c82a986ebe8252c790a48e8d4590248b1e5196088512a81f048361a0d4b2
7
+ data.tar.gz: 13e5092220001d5206d498290a8685dbccc3e50204dcc87e4851476f7b4ec5e13c97a827b216a474ff3b0df2f450092584d2faed706b747d16fda5d20f37ad3e
data/.coveralls.yml ADDED
@@ -0,0 +1,2 @@
1
+ service_name: travis-pro
2
+ repo_token: 7YmAGkgvUC6HAOVuQBw61pGod1TZsUWNq
data/.gitignore CHANGED
@@ -1,4 +1,2 @@
1
- Gemfile.lock
2
- db/sinatra_active_model_serializers.sqlite3
3
- db/schema.rb
4
- pkg
1
+ pkg
2
+ coverage
data/.hound.yml ADDED
@@ -0,0 +1,2 @@
1
+ ruby:
2
+ config_file: .rubocop.yml
data/.rubocop.yml ADDED
@@ -0,0 +1,8 @@
1
+ Metrics/LineLength:
2
+ Max: 80
3
+
4
+ Style/StringLiterals:
5
+ EnforcedStyle: single_quotes
6
+
7
+ Style/TrailingBlankLines:
8
+ Enabled: false
data/CHANGELOG.md ADDED
@@ -0,0 +1,29 @@
1
+ ## [In git](https://github.com/SauloSilva/sinatra-active-model-serializers/compare/v0.0.2...HEAD)
2
+
3
+ ## [v0.2.0](https://github.com/SauloSilva/sinatra-active-model-serializers/tree/v0.2.0)
4
+
5
+ ### Features:
6
+ * [Adding each serializer](https://github.com/SauloSilva/sinatra-active-model-serializers/pull/15) (saulosantiago)
7
+
8
+ * [Adding sinatra, sinatra-contrib and sinatra-activerecord with dependencies](https://github.com/SauloSilva/sinatra-active-model-serializers/pull/16) (saulosantiago)
9
+
10
+ ## [v0.1.0](https://github.com/SauloSilva/sinatra-active-model-serializers/tree/v0.1.0)
11
+
12
+ ### Features:
13
+ * [Adding specify serializer](https://github.com/SauloSilva/sinatra-active-model-serializers/pull/8) (saulosantiago)
14
+
15
+ ## [v0.0.3](https://github.com/SauloSilva/sinatra-active-model-serializers/tree/v0.0.3)
16
+
17
+ ### Features:
18
+ * [Adding changelog](https://github.com/SauloSilva/sinatra-active-model-serializers/pull/3) (saulosantiago)
19
+
20
+ ### Bug Fixes
21
+ * [Fix with gem name](https://github.com/SauloSilva/sinatra-active-model-serializers/pull/1) (adrianotadao)
22
+
23
+ ## [v0.0.2](https://github.com/SauloSilva/sinatra-active-model-serializers/tree/v0.0.2)
24
+
25
+ ## First gem release
26
+
27
+ ### Features:
28
+ * [Adding rubygems_task](https://github.com/SauloSilva/sinatra-active-model-serializers/pull/2) (saulosantiago)
29
+ * Adapter from Active Model Serializers (saulosantiago)
data/Gemfile CHANGED
@@ -2,16 +2,12 @@ source 'http://rubygems.org'
2
2
  gemspec
3
3
 
4
4
  group :development do
5
+ gem 'rake', '10.4.2'
5
6
  gem 'rubygems-tasks', '0.2.4'
6
7
  end
7
8
 
8
9
  group :test do
9
- gem 'sinatra', '1.4.5'
10
- gem 'sinatra-contrib', '1.4.2'
11
- gem 'rake', '10.4.2'
12
- gem 'json-schema', '2.5.0'
13
10
  gem 'rspec', '3.1.0'
14
- gem 'sinatra-activerecord', '2.0.4'
15
- gem 'sqlite3', '1.3.10'
16
- gem 'database_cleaner', '1.4.0'
11
+ gem 'json-schema', '2.5.0'
12
+ gem 'coveralls', '0.8.2', require: false
17
13
  end
data/Gemfile.lock ADDED
@@ -0,0 +1,118 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ sinatra-active-model-serializers (0.2.0)
5
+ active_model_serializers (= 0.9.3)
6
+ sinatra (= 1.4.6)
7
+ sinatra-activerecord (= 2.0.4)
8
+ sinatra-contrib (= 1.4.6)
9
+
10
+ GEM
11
+ remote: http://rubygems.org/
12
+ specs:
13
+ active_model_serializers (0.9.3)
14
+ activemodel (>= 3.2)
15
+ activemodel (4.2.3)
16
+ activesupport (= 4.2.3)
17
+ builder (~> 3.1)
18
+ activerecord (4.2.3)
19
+ activemodel (= 4.2.3)
20
+ activesupport (= 4.2.3)
21
+ arel (~> 6.0)
22
+ activesupport (4.2.3)
23
+ i18n (~> 0.7)
24
+ json (~> 1.7, >= 1.7.7)
25
+ minitest (~> 5.1)
26
+ thread_safe (~> 0.3, >= 0.3.4)
27
+ tzinfo (~> 1.1)
28
+ addressable (2.3.8)
29
+ arel (6.0.2)
30
+ backports (3.6.5)
31
+ builder (3.2.2)
32
+ coveralls (0.8.2)
33
+ json (~> 1.8)
34
+ rest-client (>= 1.6.8, < 2)
35
+ simplecov (~> 0.10.0)
36
+ term-ansicolor (~> 1.3)
37
+ thor (~> 0.19.1)
38
+ diff-lcs (1.2.5)
39
+ docile (1.1.5)
40
+ domain_name (0.5.24)
41
+ unf (>= 0.0.5, < 1.0.0)
42
+ http-cookie (1.0.2)
43
+ domain_name (~> 0.5)
44
+ i18n (0.7.0)
45
+ json (1.8.3)
46
+ json-schema (2.5.0)
47
+ addressable (~> 2.3)
48
+ mime-types (2.6.1)
49
+ minitest (5.7.0)
50
+ multi_json (1.11.2)
51
+ netrc (0.10.3)
52
+ rack (1.6.4)
53
+ rack-protection (1.5.3)
54
+ rack
55
+ rack-test (0.6.3)
56
+ rack (>= 1.0)
57
+ rake (10.4.2)
58
+ rest-client (1.8.0)
59
+ http-cookie (>= 1.0.2, < 2.0)
60
+ mime-types (>= 1.16, < 3.0)
61
+ netrc (~> 0.7)
62
+ rspec (3.1.0)
63
+ rspec-core (~> 3.1.0)
64
+ rspec-expectations (~> 3.1.0)
65
+ rspec-mocks (~> 3.1.0)
66
+ rspec-core (3.1.7)
67
+ rspec-support (~> 3.1.0)
68
+ rspec-expectations (3.1.2)
69
+ diff-lcs (>= 1.2.0, < 2.0)
70
+ rspec-support (~> 3.1.0)
71
+ rspec-mocks (3.1.3)
72
+ rspec-support (~> 3.1.0)
73
+ rspec-support (3.1.2)
74
+ rubygems-tasks (0.2.4)
75
+ simplecov (0.10.0)
76
+ docile (~> 1.1.0)
77
+ json (~> 1.8)
78
+ simplecov-html (~> 0.10.0)
79
+ simplecov-html (0.10.0)
80
+ sinatra (1.4.6)
81
+ rack (~> 1.4)
82
+ rack-protection (~> 1.4)
83
+ tilt (>= 1.3, < 3)
84
+ sinatra-activerecord (2.0.4)
85
+ activerecord (>= 3.2)
86
+ sinatra (~> 1.0)
87
+ sinatra-contrib (1.4.6)
88
+ backports (>= 2.0)
89
+ multi_json
90
+ rack-protection
91
+ rack-test
92
+ sinatra (~> 1.4.0)
93
+ tilt (>= 1.3, < 3)
94
+ term-ansicolor (1.3.2)
95
+ tins (~> 1.0)
96
+ thor (0.19.1)
97
+ thread_safe (0.3.5)
98
+ tilt (2.0.1)
99
+ tins (1.5.4)
100
+ tzinfo (1.2.2)
101
+ thread_safe (~> 0.1)
102
+ unf (0.1.4)
103
+ unf_ext
104
+ unf_ext (0.0.7.1)
105
+
106
+ PLATFORMS
107
+ ruby
108
+
109
+ DEPENDENCIES
110
+ coveralls (= 0.8.2)
111
+ json-schema (= 2.5.0)
112
+ rake (= 10.4.2)
113
+ rspec (= 3.1.0)
114
+ rubygems-tasks (= 0.2.4)
115
+ sinatra-active-model-serializers!
116
+
117
+ BUNDLED WITH
118
+ 1.10.4
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  [ ![Codeship Status for SauloSilva/sinatra-active-model-serializers](https://codeship.com/projects/0be149a0-8d56-0132-3f2c-5691319bff63/status?branch=master)](https://codeship.com/projects/60665)
2
2
 
3
+ [![Coverage Status](https://coveralls.io/repos/SauloSilva/sinatra-active-model-serializers/badge.svg?branch=adding_each_serializer&service=github)](https://coveralls.io/github/SauloSilva/sinatra-active-model-serializers?branch=adding_each_serializer)
4
+
3
5
  # Sinatra::ActiveModelSerializers
4
6
 
5
7
  [![Gem Version](https://badge.fury.io/rb/sinatra-active-model-serializers.png)](http://badge.fury.io/rb/sinatra-active-model-serializers)
@@ -17,14 +19,14 @@ Ruby 1.9.2 or greater, Sinatra 1.4.5 or greater and Sinatra Contrib 1.4.2 or gre
17
19
 
18
20
  or with bundler
19
21
 
20
- ```
22
+ ```ruby
21
23
  # Gemfile
22
- source :rubygems
24
+ source 'http://rubygems.org'
23
25
 
24
- gem 'sinatra'
25
- gem 'sinatra-contrib'
26
- gem 'sinatra-active-record'
27
- gem 'sinatra-active-model-serializers'
26
+ gem 'sinatra', '1.4.6'
27
+ gem 'sinatra-contrib', '1.4.6'
28
+ gem 'sinatra-active-record', '2.0.4'
29
+ gem 'sinatra-active-model-serializers', '0.2.0'
28
30
  ```
29
31
 
30
32
  ## Configure
@@ -38,6 +40,8 @@ require 'bundler'
38
40
  Bundler.require :default
39
41
 
40
42
  class App < Sinatra::Base
43
+ register Sinatra::ActiveRecordExtension
44
+
41
45
  get '/' do
42
46
  json Test.first
43
47
  end
@@ -50,7 +54,7 @@ end
50
54
 
51
55
  This attribute is an object, all inserted configuration this object it will be passed on to Active Model Serializers, eg.
52
56
 
53
- ```
57
+ ```ruby
54
58
  set :active_model_serializers, { root: false }
55
59
  ```
56
60
 
@@ -58,13 +62,13 @@ set :active_model_serializers, { root: false }
58
62
 
59
63
  By default this attribute is set up to look for the serializers from your project in "* app / serializers *". Whether you have a different environment you can set up by inserting the path of the string, eg.
60
64
 
61
- ```
65
+ ```ruby
62
66
  set :serializers_path, './whatever_path/serializers'
63
67
  ```
64
68
 
65
69
  or not to automatically requires
66
70
 
67
- ```
71
+ ```ruby
68
72
  set :serializers_path, false
69
73
  ```
70
74
 
@@ -75,7 +79,7 @@ This the second parameter is an object. This object may contain new configuratio
75
79
 
76
80
  #### root
77
81
 
78
- ```
82
+ ```ruby
79
83
  get '/' do
80
84
  json Resource.first, { root: false }
81
85
  end
@@ -83,13 +87,13 @@ end
83
87
 
84
88
  #### scope
85
89
 
86
- ```
90
+ ```ruby
87
91
  get '/' do
88
92
  json Resource.first, { scope: self }
89
93
  end
90
94
  ```
91
95
 
92
- #### serializer
96
+ ## Specify a serializer
93
97
 
94
98
  If you wish to use an another serializer than the default, you can explicitly pass it through the renderer
95
99
 
@@ -99,6 +103,15 @@ If you wish to use an another serializer than the default, you can explicitly pa
99
103
  json Resource.first, { serializer: ResourcePreviewSerializer }
100
104
  ```
101
105
 
106
+ 2. For an array resource:
107
+
108
+ Use the default `ArraySerializer`, which will use `each_serializer` to
109
+ serialize each element.
110
+
111
+ ```ruby
112
+ json @resources, { each_serializer: ResourcePreviewSerializer }
113
+ ```
114
+
102
115
  ## License
103
116
 
104
117
  [MIT](https://github.com/SauloSilva/sinatra-active-model-serializers/blob/master/LICENSE)
@@ -7,16 +7,27 @@ module Sinatra
7
7
  super
8
8
  end
9
9
 
10
- def json(object, options={})
11
- options = options.merge(settings.active_model_serializers)
10
+ def json(resource, options = {})
11
+ @_options = settings.active_model_serializers.merge(options)
12
12
 
13
- if serializer = options.fetch(:serializer, ActiveModel::Serializer.serializer_for(object, options))
14
- serializer.new(object, options).to_json
13
+ if serializer = get_serializer(resource)
14
+ serializer.new(resource, @_options).to_json
15
15
  else
16
- object.to_json(options)
16
+ resource.to_json(@_options)
17
17
  end
18
18
  end
19
19
 
20
+ def get_serializer(resource)
21
+ _serializer ||= @_options.delete(:serializer)
22
+ _serializer ||= ActiveModel::Serializer.serializer_for(resource)
23
+
24
+ if @_options.key?(:each_serializer)
25
+ @_options[:serializer] = @_options.fetch(:each_serializer)
26
+ end
27
+
28
+ _serializer
29
+ end
30
+
20
31
  def files_required
21
32
  return unless settings.serializers_path
22
33
  Dir["#{ settings.serializers_path }/**/*.rb"].flatten.sort.each do |file|
@@ -25,6 +36,6 @@ module Sinatra
25
36
  end
26
37
  end
27
38
 
28
- Base.set :active_model_serializers, {}
39
+ Base.set :active_model_serializers, root: true
29
40
  Base.set :serializers_path, SERIALIZERS_DEFAULT_PATH
30
41
  end
@@ -1,6 +1,6 @@
1
1
  module SinatraActiveModelSerializers
2
2
  PATCH = 0
3
- MINOR = 1
3
+ MINOR = 2
4
4
  MAJOR = 0
5
5
  VERSION = "#{ MAJOR }.#{ MINOR }.#{ PATCH }".freeze
6
6
  end
@@ -13,33 +13,43 @@ Gem::Specification.new do |s|
13
13
  s.license = 'MIT'
14
14
 
15
15
  # generated from git shortlog -sn
16
- s.authors = ['saulosantiago']
16
+ s.authors = ['Saulo Santiago', 'Adriano Tadao']
17
17
 
18
18
  # generated from git shortlog -sne
19
- s.email = ['saulodasilvasantiago@gmail.com']
19
+ s.email = ['saulodasilvasantiago@gmail.com', 'drianotadao@gmail.com']
20
20
 
21
21
  # generated from git ls-files
22
22
  s.files = [
23
+ '.coveralls.yml',
23
24
  '.gitignore',
25
+ '.hound.yml',
26
+ '.rubocop.yml',
27
+ 'CHANGELOG.md',
24
28
  'Gemfile',
29
+ 'Gemfile.lock',
25
30
  'LICENSE',
26
31
  'README.md',
27
32
  'Rakefile',
28
- 'db/migrate/00_create_tests.rb',
29
- 'db/schema.rb',
30
33
  'lib/sinatra-active-model-serializers.rb',
31
34
  'lib/sinatra-active-model-serializers/json.rb',
32
35
  'lib/sinatra-active-model-serializers/version.rb',
33
36
  'sinatra-active-model-serializers.gemspec',
34
37
  'spec/app/application.rb',
35
38
  'spec/app/models/test.rb',
39
+ 'spec/app/serializers/foo_serializer.rb',
36
40
  'spec/app/serializers/test_serializer.rb',
41
+ 'spec/app/serializers/unitary_serializer.rb',
37
42
  'spec/json_spec.rb',
43
+ 'spec/schemas/test_with_each_serializer.json',
38
44
  'spec/schemas/test_with_root.json',
45
+ 'spec/schemas/test_with_specific_serializer.json',
39
46
  'spec/schemas/test_without_root.json',
40
47
  'spec/spec_helper.rb',
41
48
  'spec/support/request_support.rb'
42
49
  ]
43
50
 
51
+ s.add_runtime_dependency 'sinatra', '1.4.6'
52
+ s.add_runtime_dependency 'sinatra-contrib', '1.4.6'
53
+ s.add_runtime_dependency 'sinatra-activerecord', '2.0.4'
44
54
  s.add_runtime_dependency 'active_model_serializers', '0.9.3'
45
55
  end
@@ -2,6 +2,7 @@ require 'rubygems'
2
2
  require 'bundler'
3
3
  Bundler.require(:defaut, :test)
4
4
 
5
+ require 'sinatra/activerecord'
5
6
  require './lib/sinatra-active-model-serializers/'
6
7
  Dir['./spec/app/models/**/*.rb'].flatten.sort.each { |file| require file}
7
8
 
@@ -15,24 +16,25 @@ module App
15
16
  ActiveRecord::Base.logger = nil
16
17
  end
17
18
 
18
- set :database, {
19
- adapter: 'sqlite3',
20
- database: 'db/sinatra_active_model_serializers.sqlite3'
21
- }
19
+ before do
20
+ @test ||= Test.new(foo: 'foo')
21
+ end
22
22
 
23
23
  get '/with-root/' do
24
- json Test.create(foo: 'bar'), { root: true }
24
+ json @test, root: true
25
25
  end
26
26
 
27
27
  get '/without-root/' do
28
- json Test.create(foo: 'bar'), { root: false }
28
+ json @test, root: false
29
29
  end
30
30
 
31
31
  get '/with-specific-serializer/' do
32
- json Test.create(foo: 'bar'), {
33
- root: false,
34
- serializer: FooSerializer
35
- }
32
+ json @test, root: false, serializer: FooSerializer
33
+ end
34
+
35
+ get '/with-each-serializer/' do
36
+ tests = [@test, @test]
37
+ json tests, root: 'units', each_serializer: UnitarySerializer
36
38
  end
37
39
  end
38
40
  end
@@ -1,2 +1,8 @@
1
- class Test < ActiveRecord::Base
1
+ class Test
2
+ include ActiveModel::Serialization
3
+ attr_accessor :foo
4
+
5
+ def initialize(options)
6
+ @foo = options[:foo]
7
+ end
2
8
  end
@@ -0,0 +1,7 @@
1
+ class FooSerializer < ActiveModel::Serializer
2
+ attributes :bar
3
+
4
+ def bar
5
+ "This is a custom serializer - #{ object.class.name }"
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ class UnitarySerializer < ActiveModel::Serializer
2
+ attributes :foo, :extra
3
+
4
+ def extra
5
+ 'extra'
6
+ end
7
+ end
data/spec/json_spec.rb CHANGED
@@ -14,5 +14,13 @@ describe App::Base do
14
14
  it 'should response with specific serializer' do
15
15
  get '/with-specific-serializer/'
16
16
  match_response_schema(:test_with_specific_serializer)
17
+
18
+ json = JSON.parse last_response.body
19
+ expect(json['bar']).to eq('This is a custom serializer - Test')
20
+ end
21
+
22
+ it 'should response with each serializer' do
23
+ get '/with-each-serializer/'
24
+ match_response_schema(:test_with_each_serializer)
17
25
  end
18
26
  end
@@ -0,0 +1,22 @@
1
+ {
2
+ "type": "object",
3
+ "required": [
4
+ "units"
5
+ ],
6
+ "properties": {
7
+ "units": {
8
+ "type": "array",
9
+ "items": {
10
+ "type" : "object",
11
+ "required": [
12
+ "foo",
13
+ "extra"
14
+ ],
15
+ "properties" : {
16
+ "foo" : { "type" : "string" },
17
+ "extra" : { "type" : "string" }
18
+ }
19
+ }
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "type": "object",
3
+ "required": [
4
+ "bar"
5
+ ],
6
+ "properties": {
7
+ "bar": { "type": "string" }
8
+ }
9
+ }
data/spec/spec_helper.rb CHANGED
@@ -5,22 +5,15 @@ require 'sinatra/contrib'
5
5
  require 'app/application'
6
6
  require 'rspec'
7
7
  require 'rack/test'
8
+ require 'coveralls'
9
+
10
+ Coveralls.wear!
8
11
  Dir[File.expand_path '../support/**/*.rb', __FILE__].each { |file| require file }
9
12
 
10
13
  RSpec.configure do |config|
11
14
  config.expect_with :rspec
12
15
  include Rack::Test::Methods
13
16
  include RequestSupport
14
- DatabaseCleaner.clean_with :truncation
15
- DatabaseCleaner.strategy = :transaction
16
-
17
- before :all do
18
- DatabaseCleaner.start
19
- end
20
-
21
- after :all do
22
- DatabaseCleaner.clean
23
- end
24
17
 
25
18
  def app
26
19
  App::Base
metadata CHANGED
@@ -1,15 +1,58 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-active-model-serializers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
- - saulosantiago
7
+ - Saulo Santiago
8
+ - Adriano Tadao
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2015-05-21 00:00:00.000000000 Z
12
+ date: 2015-07-30 00:00:00.000000000 Z
12
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: sinatra
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - '='
19
+ - !ruby/object:Gem::Version
20
+ version: 1.4.6
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - '='
26
+ - !ruby/object:Gem::Version
27
+ version: 1.4.6
28
+ - !ruby/object:Gem::Dependency
29
+ name: sinatra-contrib
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - '='
33
+ - !ruby/object:Gem::Version
34
+ version: 1.4.6
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - '='
40
+ - !ruby/object:Gem::Version
41
+ version: 1.4.6
42
+ - !ruby/object:Gem::Dependency
43
+ name: sinatra-activerecord
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - '='
47
+ - !ruby/object:Gem::Version
48
+ version: 2.0.4
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - '='
54
+ - !ruby/object:Gem::Version
55
+ version: 2.0.4
13
56
  - !ruby/object:Gem::Dependency
14
57
  name: active_model_serializers
15
58
  requirement: !ruby/object:Gem::Requirement
@@ -28,26 +71,34 @@ description: Adapter from Active Model Serializers, to work in Sinatra from a mo
28
71
  practical way with models
29
72
  email:
30
73
  - saulodasilvasantiago@gmail.com
74
+ - drianotadao@gmail.com
31
75
  executables: []
32
76
  extensions: []
33
77
  extra_rdoc_files: []
34
78
  files:
79
+ - ".coveralls.yml"
35
80
  - ".gitignore"
81
+ - ".hound.yml"
82
+ - ".rubocop.yml"
83
+ - CHANGELOG.md
36
84
  - Gemfile
85
+ - Gemfile.lock
37
86
  - LICENSE
38
87
  - README.md
39
88
  - Rakefile
40
- - db/migrate/00_create_tests.rb
41
- - db/schema.rb
42
89
  - lib/sinatra-active-model-serializers.rb
43
90
  - lib/sinatra-active-model-serializers/json.rb
44
91
  - lib/sinatra-active-model-serializers/version.rb
45
92
  - sinatra-active-model-serializers.gemspec
46
93
  - spec/app/application.rb
47
94
  - spec/app/models/test.rb
95
+ - spec/app/serializers/foo_serializer.rb
48
96
  - spec/app/serializers/test_serializer.rb
97
+ - spec/app/serializers/unitary_serializer.rb
49
98
  - spec/json_spec.rb
99
+ - spec/schemas/test_with_each_serializer.json
50
100
  - spec/schemas/test_with_root.json
101
+ - spec/schemas/test_with_specific_serializer.json
51
102
  - spec/schemas/test_without_root.json
52
103
  - spec/spec_helper.rb
53
104
  - spec/support/request_support.rb
@@ -71,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
122
  version: '0'
72
123
  requirements: []
73
124
  rubyforge_project:
74
- rubygems_version: 2.2.2
125
+ rubygems_version: 2.4.6
75
126
  signing_key:
76
127
  specification_version: 4
77
128
  summary: Adapter from Active Model Serializers
@@ -1,7 +0,0 @@
1
- class CreateTests < ActiveRecord::Migration
2
- def change
3
- create_table :tests do |t|
4
- t.string :foo
5
- end
6
- end
7
- end