decko 0.8.1 → 0.8.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 +4 -4
- data/lib/decko/response.rb +2 -2
- data/lib/decko/swagger/input_yml/layout.yml +13 -10
- data/rails/controllers/card_controller.rb +4 -4
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 642815d92ad953b7592dce3a40979bbfeca2c165
|
4
|
+
data.tar.gz: 659af51030b921c81935f537e36a814dab19de02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2021baf4e67d92765bf9dae7f962f013827aebaa1410bfa9c82e43670e6ae8cbca7ec5f8cf7ae68c547a4fd92f68105982bfd0a9427f7fa7effb5a56e4018277
|
7
|
+
data.tar.gz: 7f4b764d3170f489fb1a938d45f9d168af473d003fcb813ac3b060eaf72ade8391a2b1ddef631a30997f7f6b20b8aba73761ada4b420889a9bef880ea542079d
|
data/lib/decko/response.rb
CHANGED
@@ -17,7 +17,7 @@ module Decko
|
|
17
17
|
end
|
18
18
|
|
19
19
|
# return a redirect response
|
20
|
-
def hard_redirect url
|
20
|
+
def hard_redirect url, status=302
|
21
21
|
url = card_url url # make sure we have absolute url
|
22
22
|
if Card::Env.ajax?
|
23
23
|
# lets client reset window location
|
@@ -25,7 +25,7 @@ module Decko
|
|
25
25
|
# formerly used 303 response, but that gave IE the fits
|
26
26
|
render json: { redirect: url }
|
27
27
|
else
|
28
|
-
redirect_to url
|
28
|
+
redirect_to url, status: status
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
@@ -55,8 +55,8 @@ paths:
|
|
55
55
|
- $ref: '#/components/parameters/card'
|
56
56
|
- $ref: '#/components/parameters/success'
|
57
57
|
responses:
|
58
|
-
|
59
|
-
$ref: '#/components/responses/
|
58
|
+
302:
|
59
|
+
$ref: '#/components/responses/302'
|
60
60
|
404:
|
61
61
|
$ref: '#/components/responses/404'
|
62
62
|
# TODO: add patch
|
@@ -68,8 +68,8 @@ paths:
|
|
68
68
|
- $ref: '#/components/parameters/cardmark'
|
69
69
|
- $ref: '#/components/parameters/success'
|
70
70
|
responses:
|
71
|
-
|
72
|
-
$ref: '#/components/responses/
|
71
|
+
302:
|
72
|
+
$ref: '#/components/responses/302'
|
73
73
|
404:
|
74
74
|
$ref: '#/components/responses/404'
|
75
75
|
/:
|
@@ -85,10 +85,8 @@ paths:
|
|
85
85
|
- $ref: '#/components/parameters/card'
|
86
86
|
- $ref: '#/components/parameters/success'
|
87
87
|
responses:
|
88
|
-
|
89
|
-
$ref: '#/components/responses/
|
90
|
-
404:
|
91
|
-
$ref: '#/components/responses/404'
|
88
|
+
302:
|
89
|
+
$ref: '#/components/responses/302'
|
92
90
|
|
93
91
|
externalDocs:
|
94
92
|
description: Find out more about Decko
|
@@ -248,7 +246,8 @@ components:
|
|
248
246
|
|
249
247
|
responses:
|
250
248
|
200:
|
251
|
-
description:
|
249
|
+
description: |-
|
250
|
+
Card data. Defaults to molecule view.
|
252
251
|
content:
|
253
252
|
application/json:
|
254
253
|
schema:
|
@@ -258,4 +257,8 @@ components:
|
|
258
257
|
content:
|
259
258
|
application/json:
|
260
259
|
schema:
|
261
|
-
$ref: '#/components/schemas/errors%20view'
|
260
|
+
$ref: '#/components/schemas/errors%20view'
|
261
|
+
302:
|
262
|
+
description: |-
|
263
|
+
Successful non-idempotent requests redirect to idempotent GET
|
264
|
+
requests.
|
@@ -93,19 +93,19 @@ class CardController < ActionController::Base
|
|
93
93
|
def handle
|
94
94
|
card.act do
|
95
95
|
Card::Env.success card.name
|
96
|
-
yield ?
|
96
|
+
yield ? cud_success : raise(Card::Error::UserError)
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
100
|
-
# successful create, update, or delete
|
101
|
-
def
|
100
|
+
# successful create, update, or delete act
|
101
|
+
def cud_success
|
102
102
|
success = Card::Env.success.in_context card.name
|
103
103
|
if success.reload?
|
104
104
|
reload
|
105
105
|
elsif Card::Env.ajax? && !success.hard_redirect?
|
106
106
|
soft_redirect success
|
107
107
|
else
|
108
|
-
hard_redirect success.to_url
|
108
|
+
hard_redirect success.to_url, 303
|
109
109
|
end
|
110
110
|
end
|
111
111
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decko
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ethan McCutchen
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2019-08-
|
14
|
+
date: 2019-08-16 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: card
|
@@ -19,14 +19,14 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - '='
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 1.98.
|
22
|
+
version: 1.98.2
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - '='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 1.98.
|
29
|
+
version: 1.98.2
|
30
30
|
description: a wiki approach to stuctured data, dynamic interaction, and web design
|
31
31
|
email:
|
32
32
|
- info@decko.org
|