gris 0.3.1 → 0.3.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d50fcf6320a9f8ee73425753a68da703d05fdaa
|
4
|
+
data.tar.gz: a7d4341c0e0842a4ef1e73587a595dc23655b503
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0878faa30d4f25de452fce6ec87f62a376b7ba672990b5a9a1a110eeb44fccd0df6824f0253ce8dc275bb2830ba4be2299ab44b8f2c628f5c0bb94b973a9979
|
7
|
+
data.tar.gz: 1e798df67ebbddd30e9b70a6af2a9356e00d1990bb1241c466b8ba427099cd4a57d9a88d39cafd6dc807baf4ef964501c8060c0b21475b618d9084b3279894e8
|
data/Gemfile.lock
CHANGED
@@ -1,51 +1,48 @@
|
|
1
1
|
class <%= name.classify.pluralize %>Endpoint < Grape::API
|
2
2
|
namespace :<%= name.underscore.tableize %> do
|
3
|
-
desc '
|
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
|
-
|
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
|
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
|
21
|
-
# optional :category, type: String
|
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 '
|
28
|
+
desc 'Retrieve existing <%= name.underscore %>.'
|
29
29
|
params do
|
30
30
|
requires :id, desc: 'ID of the <%= name.underscore %>'
|
31
31
|
end
|
32
|
-
|
33
|
-
|
34
|
-
|
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
|
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
|
48
|
-
# optional :category, type: String
|
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
|
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
|
+
2.2.2
|
data/lib/gris/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2015-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|