decko 0.15.6 → 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: f0778f5fabbe476a77bf6d4e0b0c871245e8b6211db410716b009c40282293eb
4
- data.tar.gz: bc1c4eebf425c846ba5b65f746d4a6bb1672558cb741b0ef63bf05b457d0f243
3
+ metadata.gz: 9ea71b1cc1515858d9ffca6f800a37d57f0d97f62a5f765c9b630f82d0d166f0
4
+ data.tar.gz: 7e54f37f6cb47516b726b9e1a9506b89314459610507d602b40fde8fb30e7186
5
5
  SHA512:
6
- metadata.gz: bd0d07093d4e4204f52d0e630a02a62eff61fcdd1149505eefe9fd319c0b18c725a049d8624a63d0b1adc793a4a0682e712e9e49f20b5c800d89875036f3dd0b
7
- data.tar.gz: 8cbbfe3c55add733e4e84e18c0c573f2c7487f6341cd877c8046e84a08617018ff2e1b22b3c1aae7f0564ad96b1b15e30aad09e43201dbb7a33dd06c96d0a1ed
6
+ metadata.gz: 2e298bd3bf6ed694c36787c6609ecfafd82d81a91906d1c9426f7f022e3623eb23a361a8209d04cbea9e9dc9a691aae87663af219a127d549de78118b4b56f3b
7
+ data.tar.gz: f5340a1f1a8cd7132f5b00bbdd3c94466102aadfd22633c1cbc1bf434708fba2a90f8b497616e4253e7929e74cbf5d19c943f74cafd3d91b03f9b8387e506a63
@@ -30,6 +30,8 @@ Decko::Engine.routes.draw do
30
30
  patch "/" => "card#update"
31
31
  delete "/" => "card#delete"
32
32
 
33
+ post "/type/:type" => "card#create"
34
+
33
35
  # RESTful (with mark)
34
36
  match ":mark(.:format)" => "card#create", via: :post
35
37
  match ":mark(.:format)" => "card#update", via: %i[put patch]
@@ -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,11 +1,10 @@
1
1
  require "decko/application"
2
- require_relative "alias"
3
2
 
4
3
  CARD_TASKS = (
5
- %i[eat migrate reset_cache reset_tmp seed setup sow update] +
4
+ %i[eat migrate reset seed setup sow update] +
6
5
  # { assets: %i[refresh code wipe] },
7
6
  # above caused loading problem because of .sort is rails' #run_tasks_blocks
8
- [{ migrate: %i[cards structure core_cards deck_cards redo stamp] },
7
+ [{ migrate: %i[schema transform redo stamp port recode] },
9
8
  { mod: %i[list symlink leftover uninstall install] },
10
9
  { seed: %i[build clean dump plow polish replant update] }]
11
10
  ).freeze
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.15.6
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-05-02 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.105.6
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.105.6
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.15.6
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.15.6
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
@@ -111,7 +112,6 @@ files:
111
112
  - lib/decko/swagger/input_yml/layout.yml
112
113
  - lib/decko/swagger/output.yml
113
114
  - lib/generators/deck/deck_generator.rb
114
- - lib/rake_tasks/alias.rb
115
115
  - lib/rake_tasks/cucumber.rake
116
116
  - lib/rake_tasks/decko.rake
117
117
  - lib/rake_tasks/decko/docs.rake
@@ -132,14 +132,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
132
132
  requirements:
133
133
  - - ">="
134
134
  - !ruby/object:Gem::Version
135
- version: '2.5'
135
+ version: '3.0'
136
136
  required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  requirements:
138
138
  - - ">="
139
139
  - !ruby/object:Gem::Version
140
140
  version: '0'
141
141
  requirements: []
142
- rubygems_version: 3.2.33
142
+ rubygems_version: 3.5.10
143
143
  signing_key:
144
144
  specification_version: 4
145
145
  summary: structured wiki web platform
File without changes