sinatra-active-model-serializers 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e5db54882223f0cd77727398cb439b1e9eceab05
4
- data.tar.gz: 6b9df93dc80fda25e125bd157d1ff0c430cec3bc
3
+ metadata.gz: 0c2ae926c56684fc5a7a97ccda5a0c38d18512f0
4
+ data.tar.gz: 470e945a5236ea0a29e3b10f7c74af850a598347
5
5
  SHA512:
6
- metadata.gz: 5859220bbde592d3955c01f4fa1c9ab3149544abb7ae1e18c218933c4bfb5006046dd17d8242c85612c880a7e65993b836872c136b2ba27d2d5c18504ba5dd30
7
- data.tar.gz: 2f229f5ba26ca164138bf5690d33b8d40a3df6b901e989fa86ba5e6714ab4541a1930e774de99bb246135ef4cd73851a33dcece10a813c16db2b92397fafb915
6
+ metadata.gz: 48e798962e963569942d096e1a4d72eeb33b2ec2851c4fb0107f43a5aafb2dcb25f3fd8e81266189a6a47aa613e495159171029fcb6c8a469d095d3992236d34
7
+ data.tar.gz: 87cbc5f1a1ed3eca360afd0d297f59acb639e3c7963bbd975ee8d25b17bd5b412a8eeb3983765cfb44788451caa094a521526d58d1a0fe2ca2037733205a3c91
@@ -1,5 +1,11 @@
1
1
  ## [In git](https://github.com/SauloSilva/sinatra-active-model-serializers/compare/v0.0.2...HEAD)
2
2
 
3
+ ## [v0.3.0](https://github.com/SauloSilva/sinatra-active-model-serializers/tree/v0.3.0)
4
+
5
+ ### Minor:
6
+
7
+ * [Remove ActiveRecord dependency and add ActiveModel with dependency](https://github.com/SauloSilva/sinatra-active-model-serializers/pull/20) (bf4)
8
+
3
9
  ## [v0.2.2](https://github.com/SauloSilva/sinatra-active-model-serializers/tree/v0.2.2)
4
10
 
5
11
  ### Patch:
@@ -1,33 +1,28 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sinatra-active-model-serializers (0.2.2)
4
+ sinatra-active-model-serializers (0.3.0)
5
5
  active_model_serializers (~> 0.9.0)
6
+ activemodel (~> 4.2.0)
6
7
  sinatra (~> 1.4)
7
- sinatra-activerecord (>= 2.0.0)
8
8
  sinatra-contrib (>= 1.4.1)
9
9
 
10
10
  GEM
11
11
  remote: http://rubygems.org/
12
12
  specs:
13
- active_model_serializers (0.9.3)
13
+ active_model_serializers (0.9.4)
14
14
  activemodel (>= 3.2)
15
- activemodel (4.2.3)
16
- activesupport (= 4.2.3)
15
+ activemodel (4.2.6)
16
+ activesupport (= 4.2.6)
17
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)
18
+ activesupport (4.2.6)
23
19
  i18n (~> 0.7)
24
20
  json (~> 1.7, >= 1.7.7)
25
21
  minitest (~> 5.1)
26
22
  thread_safe (~> 0.3, >= 0.3.4)
27
23
  tzinfo (~> 1.1)
28
- addressable (2.3.8)
29
- arel (6.0.2)
30
- backports (3.6.6)
24
+ addressable (2.4.0)
25
+ backports (3.6.8)
31
26
  builder (3.2.2)
32
27
  coveralls (0.8.2)
33
28
  json (~> 1.8)
@@ -37,7 +32,7 @@ GEM
37
32
  thor (~> 0.19.1)
38
33
  diff-lcs (1.2.5)
39
34
  docile (1.1.5)
40
- domain_name (0.5.24)
35
+ domain_name (0.5.20160216)
41
36
  unf (>= 0.0.5, < 1.0.0)
42
37
  http-cookie (1.0.2)
43
38
  domain_name (~> 0.5)
@@ -45,10 +40,10 @@ GEM
45
40
  json (1.8.3)
46
41
  json-schema (2.5.0)
47
42
  addressable (~> 2.3)
48
- mime-types (2.6.1)
49
- minitest (5.8.1)
43
+ mime-types (2.99.1)
44
+ minitest (5.8.4)
50
45
  multi_json (1.11.2)
51
- netrc (0.10.3)
46
+ netrc (0.11.0)
52
47
  rack (1.6.4)
53
48
  rack-protection (1.5.3)
54
49
  rack
@@ -77,13 +72,10 @@ GEM
77
72
  json (~> 1.8)
78
73
  simplecov-html (~> 0.10.0)
79
74
  simplecov-html (0.10.0)
80
- sinatra (1.4.6)
81
- rack (~> 1.4)
75
+ sinatra (1.4.7)
76
+ rack (~> 1.5)
82
77
  rack-protection (~> 1.4)
83
78
  tilt (>= 1.3, < 3)
84
- sinatra-activerecord (2.0.6)
85
- activerecord (>= 3.2)
86
- sinatra (~> 1.0)
87
79
  sinatra-contrib (1.4.6)
88
80
  backports (>= 2.0)
89
81
  multi_json
@@ -95,13 +87,13 @@ GEM
95
87
  tins (~> 1.0)
96
88
  thor (0.19.1)
97
89
  thread_safe (0.3.5)
98
- tilt (2.0.1)
99
- tins (1.5.4)
90
+ tilt (2.0.2)
91
+ tins (1.8.2)
100
92
  tzinfo (1.2.2)
101
93
  thread_safe (~> 0.1)
102
94
  unf (0.1.4)
103
95
  unf_ext
104
- unf_ext (0.0.7.1)
96
+ unf_ext (0.0.7.2)
105
97
 
106
98
  PLATFORMS
107
99
  ruby
@@ -115,4 +107,4 @@ DEPENDENCIES
115
107
  sinatra-active-model-serializers!
116
108
 
117
109
  BUNDLED WITH
118
- 1.10.4
110
+ 1.11.2
data/README.md CHANGED
@@ -27,23 +27,21 @@ source 'http://rubygems.org'
27
27
 
28
28
  gem 'sinatra', '1.4.6'
29
29
  gem 'sinatra-contrib', '1.4.6'
30
- gem 'sinatra-active-record', '2.0.4'
31
30
  gem 'sinatra-active-model-serializers', '0.2.0'
32
31
  ```
33
32
 
34
33
  ## Configure
35
34
 
36
- First you have to being with the active record configured in your system environment correctly. If the environment is not set up, see their [documentation](https://github.com/janko-m/sinatra-activerecord#sinatra-activerecord-extension).
37
- After is simply do require from our library on your `application.rb`, eg.
35
+ It's very easy. Look at the example:
38
36
 
39
37
  ```ruby
40
38
  require 'rubygems'
41
39
  require 'bundler'
42
40
  Bundler.require :default
43
41
 
44
- class App < Sinatra::Base
45
- register Sinatra::ActiveRecordExtension
42
+ Dir['./app/models/**/*.rb'].each { |file| require file }
46
43
 
44
+ class App < Sinatra::Base
47
45
  get '/' do
48
46
  json Test.first
49
47
  end
@@ -62,13 +60,13 @@ set :active_model_serializers, { root: false }
62
60
 
63
61
  #### serializers_path
64
62
 
65
- 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.
63
+ By default, path is `app/serializers`. If you need a different path you can set your path, eg.
66
64
 
67
65
  ```ruby
68
66
  set :serializers_path, './whatever_path/serializers'
69
67
  ```
70
68
 
71
- or not to automatically requires
69
+ or you can disable auto require
72
70
 
73
71
  ```ruby
74
72
  set :serializers_path, false
data/Rakefile CHANGED
@@ -1,8 +1,6 @@
1
1
  require 'rubygems/tasks'
2
2
  Gem::Tasks.new
3
3
 
4
- require "sinatra/activerecord/rake"
5
-
6
4
  namespace :db do
7
5
  task :load_config do
8
6
  require "./spec/app/application"
@@ -1,6 +1,6 @@
1
1
  module SinatraActiveModelSerializers
2
- PATCH = 2
3
- MINOR = 2
2
+ PATCH = 0
3
+ MINOR = 3
4
4
  MAJOR = 0
5
5
  VERSION = "#{ MAJOR }.#{ MINOR }.#{ PATCH }".freeze
6
6
  end
@@ -50,6 +50,6 @@ Gem::Specification.new do |s|
50
50
 
51
51
  s.add_runtime_dependency 'sinatra', '~> 1.4'
52
52
  s.add_runtime_dependency 'sinatra-contrib', '>= 1.4.1'
53
- s.add_runtime_dependency 'sinatra-activerecord', '>= 2.0.0'
53
+ s.add_runtime_dependency 'activemodel', '~> 4.2.0'
54
54
  s.add_runtime_dependency 'active_model_serializers', '~> 0.9.0'
55
- end
55
+ end
@@ -2,20 +2,13 @@ require 'rubygems'
2
2
  require 'bundler'
3
3
  Bundler.require(:defaut, :test)
4
4
 
5
- require 'sinatra/activerecord'
6
5
  require './lib/sinatra-active-model-serializers/'
7
6
  Dir['./spec/app/models/**/*.rb'].flatten.sort.each { |file| require file}
8
7
 
9
8
  module App
10
9
  class Base < Sinatra::Base
11
- register Sinatra::ActiveRecordExtension
12
-
13
10
  set :serializers_path, './spec/app/serializers'
14
11
 
15
- configure :test do
16
- ActiveRecord::Base.logger = nil
17
- end
18
-
19
12
  before do
20
13
  @test ||= Test.new(foo: 'foo')
21
14
  end
@@ -1,5 +1,6 @@
1
1
  class Test
2
- include ActiveModel::Serialization
2
+ include ActiveModel::Serializers::JSON
3
+
3
4
  attr_accessor :foo
4
5
 
5
6
  def initialize(options)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-active-model-serializers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saulo Santiago
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-11-28 00:00:00.000000000 Z
12
+ date: 2016-03-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra
@@ -40,19 +40,19 @@ dependencies:
40
40
  - !ruby/object:Gem::Version
41
41
  version: 1.4.1
42
42
  - !ruby/object:Gem::Dependency
43
- name: sinatra-activerecord
43
+ name: activemodel
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ">="
46
+ - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: 2.0.0
48
+ version: 4.2.0
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - ">="
53
+ - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: 2.0.0
55
+ version: 4.2.0
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: active_model_serializers
58
58
  requirement: !ruby/object:Gem::Requirement