decko 0.16.0 → 0.17.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
  SHA256:
3
- metadata.gz: cb2ef3c75e49f6ec50882c377983937ab0abc26bae51fff8485e6f4596e17165
4
- data.tar.gz: 2824c5962c35521bffb04f7cbec13f749197ec785e5a17cdcc7e681a316982b3
3
+ metadata.gz: 9ea71b1cc1515858d9ffca6f800a37d57f0d97f62a5f765c9b630f82d0d166f0
4
+ data.tar.gz: 7e54f37f6cb47516b726b9e1a9506b89314459610507d602b40fde8fb30e7186
5
5
  SHA512:
6
- metadata.gz: a8816b93e93a81c5612101fd5a8e70f29ea19bd2372b3dbb1b1f07948b3b3ce9c0297e2a008709608edf84d4869292783ce5a81a2edad729d09f896d8542529d
7
- data.tar.gz: c4541b11102aefcc3877af7b3f90e1948034333d7654ed552625ce3fc0011271c726b71dd02b383f3f7472b00816a4c3d358e06692be852fc384bb4b0829fa3d
6
+ metadata.gz: 2e298bd3bf6ed694c36787c6609ecfafd82d81a91906d1c9426f7f022e3623eb23a361a8209d04cbea9e9dc9a691aae87663af219a127d549de78118b4b56f3b
7
+ data.tar.gz: f5340a1f1a8cd7132f5b00bbdd3c94466102aadfd22633c1cbc1bf434708fba2a90f8b497616e4253e7929e74cbf5d19c943f74cafd3d91b03f9b8387e506a63
@@ -37,7 +37,6 @@ Decko.application.class.configure do
37
37
 
38
38
  config.use_transactional_fixtures = false
39
39
 
40
- config.rescue_all_in_controller = false
41
40
  config.raise_all_rendering_errors = true
42
41
 
43
42
  config.paging_limit = 10
@@ -0,0 +1,3 @@
1
+ Decko.application.class.configure do
2
+ config.rescue_all_in_controller = true
3
+ end
@@ -1,2 +1,8 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  # Be sure to restart your server when you modify this file.
3
+
4
+ # Uncomment this if we can show that cookies are not secure in production
5
+ #
6
+ # Rails.application.config.session_store :cookie_store,
7
+ # key: "_my_app_session",
8
+ # secure: Rails.env.production?
@@ -60,10 +60,6 @@ class CardController
60
60
  show
61
61
  end
62
62
 
63
- def reload
64
- render json: { reload: true }
65
- end
66
-
67
63
  def soft_redirect_params
68
64
  new_params = params.clone
69
65
  new_params.delete :card
@@ -71,6 +67,18 @@ class CardController
71
67
  new_params.merge Card::Env.success.params
72
68
  end
73
69
 
70
+ def reload
71
+ render json: { reload: true }
72
+ end
73
+
74
+ def slotter_magic_response
75
+ render json: { magic: true }
76
+ end
77
+
78
+ def slotter_magic?
79
+ params["slotter_mode"]&.in? %w[silent-success update-modal-origin update-origin]
80
+ end
81
+
74
82
  def require_card_for_soft_redirect!
75
83
  return if card.is_a? Card
76
84
 
@@ -29,8 +29,8 @@ class CardController
29
29
  private
30
30
 
31
31
  def setup
32
- Card::Assets.refresh unless params[:explicit_file]
33
32
  Card::Cache.renew
33
+ Card::Assets.refresh unless params[:explicit_file]
34
34
  Card::Env.reset self
35
35
  end
36
36
 
@@ -83,6 +83,8 @@ class CardController
83
83
  success = Card::Env.success.in_context card.name
84
84
  if success.reload?
85
85
  reload # instruct JSON to reload
86
+ elsif slotter_magic?
87
+ slotter_magic_response
86
88
  else
87
89
  redirect_cud_success success
88
90
  end
data/lib/decko/railtie.rb CHANGED
@@ -4,6 +4,10 @@ module Decko
4
4
  config.assets.enabled = false
5
5
  # config.assets.version = "1.0" # does the version matter if not enabled??
6
6
 
7
+ # if false, errors that reach the controller make the app fail loudly
8
+ # if true, errors are rescued and then error messages are rendered
9
+ config.rescue_all_in_controller = false
10
+
7
11
  config.before_configuration do |app|
8
12
  gem_root = Decko.gem_root
9
13
  app.config.tap do |c|
@@ -1,7 +1,7 @@
1
1
  require "decko/application"
2
2
 
3
3
  CARD_TASKS = (
4
- %i[eat migrate reset_cache reset_tmp seed setup sow update] +
4
+ %i[eat migrate reset seed setup sow update] +
5
5
  # { assets: %i[refresh code wipe] },
6
6
  # above caused loading problem because of .sort is rails' #run_tasks_blocks
7
7
  [{ migrate: %i[schema transform redo stamp port recode] },
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.16.0
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-11-18 00:00:00.000000000 Z
13
+ date: 2024-06-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: actionpack
@@ -32,28 +32,28 @@ dependencies:
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 1.106.0
35
+ version: 1.107.0
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 1.106.0
42
+ version: 1.107.0
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: card-mod-defaults
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - '='
48
48
  - !ruby/object:Gem::Version
49
- version: 0.16.0
49
+ version: 0.17.0
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - '='
55
55
  - !ruby/object:Gem::Version
56
- version: 0.16.0
56
+ version: 0.17.0
57
57
  description: a wiki approach to structured data, dynamic interaction, and web design
58
58
  email:
59
59
  - info@decko.org
@@ -85,6 +85,7 @@ files:
85
85
  - config/environments/cucumber.rb
86
86
  - config/environments/cypress.rb
87
87
  - config/environments/development.rb
88
+ - config/environments/production.rb
88
89
  - config/initializers/cypress.rb
89
90
  - config/initializers/secret_token.rb
90
91
  - config/initializers/sedate_parser.rb
@@ -131,14 +132,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
131
132
  requirements:
132
133
  - - ">="
133
134
  - !ruby/object:Gem::Version
134
- version: '2.5'
135
+ version: '3.0'
135
136
  required_rubygems_version: !ruby/object:Gem::Requirement
136
137
  requirements:
137
138
  - - ">="
138
139
  - !ruby/object:Gem::Version
139
140
  version: '0'
140
141
  requirements: []
141
- rubygems_version: 3.4.10
142
+ rubygems_version: 3.5.10
142
143
  signing_key:
143
144
  specification_version: 4
144
145
  summary: structured wiki web platform