gris 0.3.1 → 0.3.2

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: 9398a641e8b25a8a652554f5a9dc4c66e9cec95b
4
- data.tar.gz: c097c6cecd2aff77382017bb7e86620c23d2aba3
3
+ metadata.gz: 4d50fcf6320a9f8ee73425753a68da703d05fdaa
4
+ data.tar.gz: a7d4341c0e0842a4ef1e73587a595dc23655b503
5
5
  SHA512:
6
- metadata.gz: a41f32c5432ba04b1d6384316c68b6348b175f919b2c44df924730e0a365dc51f6a9170e4e9c9df93cfa3d46e40da942c214afe6c742ecdbd6342f07e969a5bc
7
- data.tar.gz: 677f57c05f1b6fb598e3c5e129816a29f23802d470ffd6fa00b172cbf6dddf69f249714b57cc7118f7a1092affdb81645d64555a9c178b447d827745210af726
6
+ metadata.gz: e0878faa30d4f25de452fce6ec87f62a376b7ba672990b5a9a1a110eeb44fccd0df6824f0253ce8dc275bb2830ba4be2299ab44b8f2c628f5c0bb94b973a9979
7
+ data.tar.gz: 1e798df67ebbddd30e9b70a6af2a9356e00d1990bb1241c466b8ba427099cd4a57d9a88d39cafd6dc807baf4ef964501c8060c0b21475b618d9084b3279894e8
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gris (0.3.1)
4
+ gris (0.3.2)
5
5
  activesupport (~> 4.2, >= 4.2.0)
6
6
  chronic (~> 0.10.0)
7
7
  dalli (~> 2.7)
@@ -1,51 +1,48 @@
1
1
  class <%= name.classify.pluralize %>Endpoint < Grape::API
2
2
  namespace :<%= name.underscore.tableize %> do
3
- desc 'Get a list of <%= name.underscore.tableize %>'
3
+ desc 'List existing <%= name.underscore.tableize %>'
4
4
  params do
5
- optional :ids, type: Array, desc: 'Array of <%= name.underscore %> ids'
6
5
  optional :page, type: Integer, default: 1, desc: 'Current page.'
7
6
  optional :size, type: Integer, default: 10, desc: 'Number of <%= name.underscore.tableize %> to return per page.'
8
7
  end
9
8
  get do
10
- <%= name.underscore.tableize %> = params[:ids] ? <%= name.classify %>.where(id: params[:ids]) : <%= name.classify %>.all
9
+ conditions = {}
10
+ <%= name.underscore.tableize %> = <%= name.classify %>.where(conditions)
11
11
  present Kaminari.paginate_array(<%= name.underscore.tableize %>).page(params[:page]).per(params[:size]), with: <%= name.classify.pluralize %>Presenter
12
12
  end
13
13
 
14
- desc 'Create a new <%= name.underscore %>.'
14
+ desc 'Create new <%= name.underscore %>.'
15
15
  params do
16
16
  requires :<%= name.underscore %>, type: Hash do
17
17
  # Use this requires block to whitelist params which
18
18
  # may be updated via mass assignment at this endpoint.
19
19
  #
20
- # requires :name, type: String, default: false
21
- # optional :category, type: String, default: false
20
+ # requires :name, type: String
21
+ # optional :category, type: String
22
22
  end
23
23
  end
24
24
  post do
25
25
  create <%= name.classify %>, with: <%= name.classify %>Presenter, from: permitted_params[:<%= name.underscore %>]
26
26
  end
27
27
 
28
- desc 'Get an existing <%= name.underscore %>.'
28
+ desc 'Retrieve existing <%= name.underscore %>.'
29
29
  params do
30
30
  requires :id, desc: 'ID of the <%= name.underscore %>'
31
31
  end
32
- route_param :id do
33
- desc 'Get an <%= name.underscore %>'
34
- get do
35
- <%= name.underscore %> = <%= name.classify %>.find params[:id]
36
- present <%= name.underscore %>, with: <%= name.classify %>Presenter
37
- end
32
+ get ':id' do
33
+ <%= name.underscore %> = <%= name.classify %>.find params[:id]
34
+ present <%= name.underscore %>, with: <%= name.classify %>Presenter
38
35
  end
39
36
 
40
- desc 'Update an existing <%= name.underscore %>.'
37
+ desc 'Update existing <%= name.underscore %>.'
41
38
  params do
42
39
  requires :id, type: String, desc: '<%= name.classify %> id.'
43
40
  requires :<%= name.underscore %>, type: Hash do
44
41
  # Use this requires block to whitelist params which
45
42
  # may be updated via mass assignment at this endpoint.
46
43
  #
47
- # requires :name, type: String, default: false
48
- # optional :category, type: String, default: false
44
+ # requires :name, type: String
45
+ # optional :category, type: String
49
46
  end
50
47
  end
51
48
  patch ':id' do
@@ -53,7 +50,7 @@ class <%= name.classify.pluralize %>Endpoint < Grape::API
53
50
  update <%= name.underscore %>, with: <%= name.classify %>Presenter, from: permitted_params[:<%= name.underscore %>]
54
51
  end
55
52
 
56
- desc 'Delete an existing <%= name.underscore %>.'
53
+ desc 'Delete existing <%= name.underscore %>.'
57
54
  params do
58
55
  requires :id, type: String, desc: '<%= name.classify %> id.'
59
56
  end
@@ -1 +1 @@
1
- 2.1.5
1
+ 2.2.2
@@ -1,5 +1,5 @@
1
1
  module Gris
2
- VERSION = '0.3.1'
2
+ VERSION = '0.3.2'
3
3
 
4
4
  class Version
5
5
  class << self
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gris
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dylan Fareed
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-05 00:00:00.000000000 Z
11
+ date: 2015-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor