xing-backend 0.0.12 → 0.0.13

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: 827d47919fcc3646787ebec8fd234016afbddb78
4
- data.tar.gz: 270b23ee03b4fcb2adfae0993069dd12f5c38bef
3
+ metadata.gz: c76a626fd1cf4876ee8d955fc9b2088f952bdba3
4
+ data.tar.gz: 8e74c68f3ccde5b83e25c094239eded4bd753361
5
5
  SHA512:
6
- metadata.gz: af3d2370c38452056e039a5e8409ed3602ef9f2ffc4633270695b551cdba582a9a48446f907bf9c5e17370907b950c75f0691208e9bafad957f3ae7a9d733cbb
7
- data.tar.gz: c4dcade49aeac1b828d90f2df37e6ef56e0734acdc44bcc37869a2fb0e7dec7d75c302cf7f369d728266514e7a0122a1f8b154318ec370d7ef6c4d123f7dc2a5
6
+ metadata.gz: cc8005d626f4fe7d8bc6c9113f558b87460d9762405f2a9dae5e7baca9946c97bfe37aa8f9145b0c1bafbb9d3ae460c9d4c2eabfe9aa6e665b69955fa58005be
7
+ data.tar.gz: eb55190a4af24c174c0b9241638a7040d621f27847e527775776787c0cfcfcf9325ae6b8517d03f736d0b265678d601b64cef7f4bc78e815ded1d723a6410fa4
@@ -0,0 +1,38 @@
1
+ require 'xing/serializers/base'
2
+
3
+ module Xing::Serializers
4
+ class List < Base
5
+
6
+ def item_serializer_class
7
+ raise NotImplementedError,
8
+ "subclasses of Xing::Serializers::List must override item_serializer_class to refer to the per-item serializer"
9
+ end
10
+
11
+ def item_serializer_options
12
+ {}
13
+ end
14
+
15
+ def template_link
16
+ return nil
17
+ end
18
+
19
+ def self_link
20
+ raise NotImplementedError,
21
+ "subclasses of Xing::Serializers::List must override self_link to return their own path"
22
+ end
23
+
24
+ def as_json_without_wrap(options={})
25
+ object.map do |item|
26
+ item_serializer_class.new(item, item_serializer_options).as_json
27
+ end
28
+ end
29
+
30
+ def links
31
+ links = {
32
+ :self => self_link
33
+ }
34
+ links[:template] = template_link unless template_link.nil?
35
+ return links
36
+ end
37
+ end
38
+ end
@@ -1,7 +1,7 @@
1
- require 'xing/serializers/base'
1
+ require 'xing/serializers/list'
2
2
 
3
3
  module Xing::Serializers
4
- class PagedList < Base
4
+ class PagedList < List
5
5
  def initialize(list, page_num, total_pages, options = {})
6
6
  @page_num = page_num.to_i
7
7
  @total_pages = total_pages
@@ -11,31 +11,11 @@ module Xing::Serializers
11
11
 
12
12
  attr_reader :page_num, :total_pages
13
13
 
14
- def item_serializer_class
15
- raise NotImplemented,
16
- "subclasses of Xing::Serializers::PagesData must override item_serializer_class to refer to the per-item serializer"
17
- end
18
-
19
- def item_serializer_options
20
- {}
21
- end
22
-
23
14
  def page_link(options)
24
- raise NotImplemented,
15
+ raise NotImplementedError,
25
16
  "subclasses of Xing::Serializers::PagesData must override page_link to return the URL of a page based on a :page => Integer() hash"
26
17
  end
27
18
 
28
- def self_link
29
- raise NotImplemented,
30
- "subclasses of Xing::Serializers::PagesData must override self_link to return their own path"
31
- end
32
-
33
- def as_json_without_wrap(options={})
34
- object.map do |item|
35
- item_serializer_class.new(item, item_serializer_options).as_json
36
- end
37
- end
38
-
39
19
  def next_link
40
20
  page_link({page: page_num + 1}) unless page_num == total_pages
41
21
  end
@@ -1,48 +1,26 @@
1
1
  Processing by Xing::RootResourcesController#index as HTML
2
- Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)
2
+ Completed 200 OK in 3ms (Views: 2.1ms | ActiveRecord: 0.0ms)
3
3
  Processing by Xing::RootResourcesController#index as HTML
4
- Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)
4
+ Completed 500 Internal Server Error in 2ms (ActiveRecord: 0.0ms)
5
5
  Processing by Xing::RootResourcesController#index as HTML
6
- Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)
6
+ Completed 500 Internal Server Error in 2ms (ActiveRecord: 0.0ms)
7
7
  Processing by Xing::RootResourcesController#index as HTML
8
- Completed 200 OK in 3ms (Views: 2.0ms | ActiveRecord: 0.0ms)
8
+ Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.0ms)
9
9
  Processing by Xing::RootResourcesController#index as HTML
10
- Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)
10
+ Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.0ms)
11
11
  Processing by Xing::RootResourcesController#index as HTML
12
- Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)
13
- Processing by Xing::RootResourcesController#index as HTML
14
- Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)
15
- Processing by Xing::RootResourcesController#index as HTML
16
- Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)
17
- Processing by Xing::RootResourcesController#index as HTML
18
- Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)
12
+ Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.0ms)
19
13
  Processing by Xing::RootResourcesController#index as HTML
20
- Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)
21
- Processing by Xing::RootResourcesController#index as HTML
22
- Completed 200 OK in 2ms (Views: 1.1ms | ActiveRecord: 0.0ms)
14
+ Completed 500 Internal Server Error in 1ms (ActiveRecord: 0.0ms)
23
15
  Processing by Xing::RootResourcesController#index as HTML
24
16
  Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)
25
17
  Processing by Xing::RootResourcesController#index as HTML
26
- Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)
27
- Processing by Xing::RootResourcesController#index as HTML
28
18
  Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms)
29
19
  Processing by Xing::RootResourcesController#index as HTML
30
- Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)
31
- Processing by Xing::RootResourcesController#index as HTML
32
- Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)
33
- Processing by Xing::RootResourcesController#index as HTML
34
- Completed 200 OK in 2ms (Views: 1.3ms | ActiveRecord: 0.0ms)
35
- Processing by Xing::RootResourcesController#index as HTML
36
- Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)
37
- Processing by Xing::RootResourcesController#index as HTML
38
- Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)
39
- Processing by Xing::RootResourcesController#index as HTML
40
- Completed 200 OK in 4ms (Views: 2.8ms | ActiveRecord: 0.0ms)
20
+ Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms)
41
21
  Processing by Xing::RootResourcesController#index as HTML
42
22
  Completed 200 OK in 2ms (Views: 1.5ms | ActiveRecord: 0.0ms)
43
23
  Processing by Xing::RootResourcesController#index as HTML
44
- Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)
24
+ Completed 200 OK in 3ms (Views: 1.9ms | ActiveRecord: 0.0ms)
45
25
  Processing by Xing::RootResourcesController#index as HTML
46
26
  Completed 200 OK in 2ms (Views: 1.4ms | ActiveRecord: 0.0ms)
47
- Processing by Xing::RootResourcesController#index as HTML
48
- Completed 200 OK in 2ms (Views: 1.2ms | ActiveRecord: 0.0ms)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xing-backend
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Dorn
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-06-18 00:00:00.000000000 Z
14
+ date: 2015-06-19 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
@@ -124,21 +124,22 @@ extensions: []
124
124
  extra_rdoc_files: []
125
125
  files:
126
126
  - lib/deprecated_classes.rb
127
- - lib/xing-backend.rb
128
127
  - lib/xing/controllers/base.rb
129
128
  - lib/xing/controllers/root_resources_controller.rb
130
129
  - lib/xing/engine.rb
131
- - lib/xing/mappers.rb
132
130
  - lib/xing/mappers/base.rb
133
- - lib/xing/serializers.rb
131
+ - lib/xing/mappers.rb
134
132
  - lib/xing/serializers/base.rb
133
+ - lib/xing/serializers/list.rb
135
134
  - lib/xing/serializers/paged_list.rb
136
135
  - lib/xing/serializers/root_resources.rb
137
- - lib/xing/services.rb
136
+ - lib/xing/serializers.rb
138
137
  - lib/xing/services/error_converter.rb
139
138
  - lib/xing/services/json_tree_lister.rb
140
139
  - lib/xing/services/snapshot_fetcher.rb
141
140
  - lib/xing/services/snapshot_writer.rb
141
+ - lib/xing/services.rb
142
+ - lib/xing-backend.rb
142
143
  - spec/deprecated_classes/active_model_error_converter_spec.rb
143
144
  - spec/deprecated_classes/base_serializer_spec.rb
144
145
  - spec/deprecated_classes/hypermedia_json_mapper_spec.rb
@@ -155,8 +156,6 @@ files:
155
156
  - spec/xing/services/json_tree_lister_spec.rb
156
157
  - spec/xing/services/snapshot_fetcher_spec.rb
157
158
  - spec/xing_spec.rb
158
- - spec_help/dummy/README.rdoc
159
- - spec_help/dummy/Rakefile
160
159
  - spec_help/dummy/app/assets/javascripts/application.js
161
160
  - spec_help/dummy/app/assets/stylesheets/application.css
162
161
  - spec_help/dummy/app/controllers/application_controller.rb
@@ -166,7 +165,6 @@ files:
166
165
  - spec_help/dummy/bin/rails
167
166
  - spec_help/dummy/bin/rake
168
167
  - spec_help/dummy/bin/setup
169
- - spec_help/dummy/config.ru
170
168
  - spec_help/dummy/config/application.rb
171
169
  - spec_help/dummy/config/boot.rb
172
170
  - spec_help/dummy/config/database.yml
@@ -185,12 +183,15 @@ files:
185
183
  - spec_help/dummy/config/locales/en.yml
186
184
  - spec_help/dummy/config/routes.rb
187
185
  - spec_help/dummy/config/secrets.yml
186
+ - spec_help/dummy/config.ru
188
187
  - spec_help/dummy/db/test.sqlite3
189
188
  - spec_help/dummy/log/test.log
190
189
  - spec_help/dummy/public/404.html
191
190
  - spec_help/dummy/public/422.html
192
191
  - spec_help/dummy/public/500.html
193
192
  - spec_help/dummy/public/favicon.ico
193
+ - spec_help/dummy/Rakefile
194
+ - spec_help/dummy/README.rdoc
194
195
  - spec_help/spec_helper.rb
195
196
  homepage: http://github.com/xing-backend
196
197
  licenses:
@@ -202,7 +203,7 @@ rdoc_options:
202
203
  - "--main"
203
204
  - doc/README
204
205
  - "--title"
205
- - xing-backend-0.0.12 Documentation
206
+ - xing-backend-0.0.13 Documentation
206
207
  require_paths:
207
208
  - lib/
208
209
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -217,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
217
218
  version: '0'
218
219
  requirements: []
219
220
  rubyforge_project:
220
- rubygems_version: 2.4.6
221
+ rubygems_version: 2.0.14
221
222
  signing_key:
222
223
  specification_version: 4
223
224
  summary: Rails backend classes for the Xing web development framework.