card 1.109.0 → 1.110.0

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.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/config/locales/es.yml +2 -3
  4. data/db/seeds.rb +0 -1
  5. data/lib/card/auth/current.rb +2 -2
  6. data/lib/card/auth/permissions.rb +1 -1
  7. data/lib/card/auth/proxy.rb +3 -3
  8. data/lib/card/auth/setup.rb +2 -2
  9. data/lib/card/cache/all.rb +1 -1
  10. data/lib/card/cache/class_methods.rb +1 -1
  11. data/lib/card/cache/shared.rb +3 -2
  12. data/lib/card/codename.rb +1 -0
  13. data/lib/card/content/chunk.rb +2 -2
  14. data/lib/card/content/parser.rb +4 -4
  15. data/lib/card/content.rb +7 -9
  16. data/lib/card/director/all.rb +4 -4
  17. data/lib/card/director/card_class.rb +3 -3
  18. data/lib/card/director/event_delay.rb +2 -2
  19. data/lib/card/director/phases.rb +2 -2
  20. data/lib/card/director/store.rb +2 -2
  21. data/lib/card/env/location_history.rb +15 -16
  22. data/lib/card/env/support.rb +6 -5
  23. data/lib/card/error.rb +2 -2
  24. data/lib/card/fetch/card_class.rb +2 -2
  25. data/lib/card/format/card_action_view.rb +1 -1
  26. data/lib/card/format/content.rb +4 -4
  27. data/lib/card/format/error.rb +12 -2
  28. data/lib/card/format/method_delegation.rb +4 -4
  29. data/lib/card/format/nesting/mode.rb +2 -2
  30. data/lib/card/format/render.rb +59 -54
  31. data/lib/card/format/wrapper.rb +2 -2
  32. data/lib/card/lexicon.rb +5 -2
  33. data/lib/card/model/save_helper/save_helper_helper.rb +2 -2
  34. data/lib/card/model/save_helper.rb +2 -2
  35. data/lib/card/name/all/parts.rb +10 -10
  36. data/lib/card/name/all.rb +4 -2
  37. data/lib/card/name.rb +3 -3
  38. data/lib/card/query/card_class.rb +2 -2
  39. data/lib/card/query/card_query/interpretation.rb +1 -1
  40. data/lib/card/query/card_query/normalization.rb +1 -1
  41. data/lib/card/query/card_query/relational_attributes.rb +1 -1
  42. data/lib/card/query/card_query/run.rb +5 -1
  43. data/lib/card/query/card_query.rb +2 -1
  44. data/lib/card/query/sql_statement/where.rb +1 -1
  45. data/lib/card/query/sql_statement.rb +7 -1
  46. data/lib/card/query.rb +1 -1
  47. data/lib/card/reference/all.rb +2 -2
  48. data/lib/card/set/advanced_api.rb +4 -3
  49. data/lib/card/set/event/all.rb +1 -1
  50. data/lib/card/set/event.rb +6 -8
  51. data/lib/card/set/format/abstract_format/haml_views.rb +2 -2
  52. data/lib/card/set/format/abstract_format/view_definition.rb +6 -6
  53. data/lib/card/set/format/abstract_format/wrapper.rb +5 -5
  54. data/lib/card/set/format/abstract_format.rb +7 -5
  55. data/lib/card/set/format/haml_paths.rb +2 -2
  56. data/lib/card/set/format.rb +2 -2
  57. data/lib/card/set/inheritance.rb +1 -1
  58. data/lib/card/set/pattern/base.rb +1 -0
  59. data/lib/card/set/required_field.rb +1 -1
  60. data/lib/card/subcards.rb +4 -4
  61. data/lib/card/view/cache/cache_action.rb +19 -7
  62. data/lib/card/view/cache.rb +26 -23
  63. data/lib/card/view/options/voo_api.rb +1 -1
  64. data/lib/card/view/options.rb +1 -0
  65. data/lib/card/view.rb +1 -1
  66. data/lib/cardio/command/rspec_command/parser.rb +1 -1
  67. data/lib/cardio/generators/deck_helper.rb +1 -1
  68. data/lib/cardio/job.rb +0 -1
  69. data/lib/cardio/mod/dirs.rb +2 -2
  70. data/lib/cardio/mod/eat.rb +5 -8
  71. data/lib/cardio/mod/load_strategy/set_binding_magic.rb +2 -2
  72. data/lib/cardio/mod/loader/set_loader.rb +1 -1
  73. data/lib/cardio/mod/loader.rb +2 -2
  74. data/lib/cardio/mod/sow.rb +1 -1
  75. data/lib/cardio/seed.rb +2 -2
  76. data/lib/generators/deck/deck_generator.rb +1 -1
  77. data/lib/generators/migration/migration_generator.rb +1 -0
  78. data/mod/core/config/locales/de.yml +1 -1
  79. data/mod/core/config/locales/en.yml +1 -1
  80. data/mod/core/data/fixtures/real/cards.yml +1 -1
  81. data/mod/core/data/real.yml +1 -1
  82. data/mod/core/data/recode.yml +1 -0
  83. data/mod/core/lib/tasks/card/mod.rake +1 -1
  84. data/mod/core/lib/tasks/card/trash.rake +8 -0
  85. data/mod/core/lib/tasks/card.rake +19 -18
  86. data/mod/core/set/all/assign_attributes.rb +3 -3
  87. data/mod/core/set/all/codename.rb +0 -1
  88. data/mod/core/set/all/initialize.rb +2 -2
  89. data/mod/core/set/all/states.rb +6 -10
  90. data/mod/core/set/all/type.rb +1 -1
  91. data/mod/core/set/self/mod.rb +2 -2
  92. data/mod/core/spec/set/all/admin_spec.rb +1 -1
  93. data/mod/core/spec/set/all/trash_spec.rb +2 -2
  94. metadata +5 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ae89c5e6253fdbcea6b9ea9e1a5ca94b8f22f0c13c47186d8a2d66d6bfb525b
4
- data.tar.gz: babc949cb5a33a9385369e62136b60591e96ac03b09a06660bce43d30165cfce
3
+ metadata.gz: abe5aee55e82a21646046cd81ce981f95e68ec7a5c013d065e4a49202a268e22
4
+ data.tar.gz: 35909d80d33bd11bc6084c52adab226d655f1052df391b6e4da86c3a2275a525
5
5
  SHA512:
6
- metadata.gz: f70439a264188fa2f734ddf9ce6cbd8f7ca790bfcddde0c0accf8a2ffa9d2c575c90220d848678c7f1ac965e734ecf4a4d30e33aaed5b41345958210cd24db84
7
- data.tar.gz: 6ff17cfaf5b5a7af5fcca9f95693b083b81aa781de06c244356c8b7e397e4621e7784995613252dae2c2d78406f0347f0977212cf91c79cd77c1b9917813e6ee
6
+ metadata.gz: 7e270754fe2e275c495bb908e9d2e6a4d0f955babc02b9368c28d6ab4a07198f63453d431b7b0cd6a5900c9e1a885447c78f74c3428848efd80c73097eb8fc76
7
+ data.tar.gz: de120f96396a0b25f6f49f4154c936b497a94e806b02b6634af4db31fb478348ddd4a8dee610085fc38d0dba2baef428df6b6998b7f71a25d4f7b16f05b92824
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.19.0
1
+ 0.20.0
@@ -133,7 +133,7 @@ es:
133
133
  type:
134
134
  error_cant_change_errors: "de %{name} no se puede cambiar; creando nuevos errores %{type_id}: %{error_messages}"
135
135
  error_no_such_type: No hay tal tipo
136
- error_hard_templated: no se puede cambiar porque %{name} es una plantilla dificil de %{type_name}
136
+ error_structured: no se puede cambiar porque %{name} es una plantilla dificil de %{type_name}
137
137
  utils:
138
138
  exception_almost_deleted: Se evitó de forma muy estrecha eliminar el archivo actual
139
139
  set_pattern:
@@ -302,8 +302,7 @@ es:
302
302
  unsupported_view: vista (%{view}) no soportado para %{cardname}
303
303
  not_found_named: No pudo encontrar %{cardname}.
304
304
  not_found_no_name: la tarjeta solicitada
305
- server_error: "\nWagn Hitch! Error del Servidor. Yuck, perdon por eso.\nPara decirnos más y seguir la solución,\nagregue un ticket de soporte en %{ticket_link}\n"
306
- se_hitch: 'Wagn Hitch :('
305
+ server_error: "\nError del Servidor. Yuck, perdon por eso.\nPara decirnos más y seguir la solución,\nagregue un ticket de soporte en %{ticket_link}\n"
307
306
  se_sorry: Error del Servidor. Yuck, perdón por eso.
308
307
  se_ticket: <a href="%{ticket_link}">Agregue un ticket de soporte</a> para decirnos más y seguir la solución.
309
308
  denial: Permiso denegado
data/db/seeds.rb CHANGED
@@ -7,7 +7,6 @@ Card::Cache.reset_all
7
7
 
8
8
  # get rid of bad constants
9
9
  Card::Codename.reset_cache
10
- Card::Codename.generate_id_constants
11
10
 
12
11
  # TODO: explain why this is necessary
13
12
  # (card:seed:build breaks without it)
@@ -36,7 +36,7 @@ class Card
36
36
  def signin cardish
37
37
  user_id = Card.id(cardish) || AnonymousID
38
38
  (session[session_user_key] = self.current_id = user_id).tap do
39
- Env.update_cookie_setting !signed_in?
39
+ Env.update_session_options
40
40
  end
41
41
  end
42
42
 
@@ -80,7 +80,7 @@ class Card
80
80
  end
81
81
 
82
82
  def session_user_key
83
- "user_#{Cardio.database.underscore}".to_sym
83
+ :"user_#{Cardio.database.underscore}"
84
84
  end
85
85
 
86
86
  private
@@ -6,7 +6,7 @@ class Card
6
6
  # @return [true/false]
7
7
  def always_ok?
8
8
  case as_id
9
- when WagnBotID then true # cannot disable
9
+ when DeckoBotID then true # cannot disable
10
10
  when nil then false
11
11
  else
12
12
  always_ok_cached?
@@ -23,9 +23,9 @@ class Card
23
23
  end
24
24
  end
25
25
 
26
- # operate with the permissions of WagnBot (administrator)
27
- def as_bot &block
28
- as Card::WagnBotID, &block
26
+ # operate with the permissions of DeckoBot (administrator)
27
+ def as_bot(&)
28
+ as(Card::DeckoBotID, &)
29
29
  end
30
30
 
31
31
  # id of proxy user
@@ -41,8 +41,8 @@ class Card
41
41
  end
42
42
 
43
43
  def user_account_cql
44
- # every deck starts with two accounts: WagnBot and Anonymous
45
- { right: :account, creator_id: ["ne", Card::WagnBotID] }
44
+ # every deck starts with two accounts: DeckoBot and Anonymous
45
+ { right: :account, creator_id: ["ne", Card::DeckoBotID] }
46
46
  end
47
47
 
48
48
  def user_account_count
@@ -92,7 +92,7 @@ class Card
92
92
  def expire_id cache
93
93
  return unless id.present?
94
94
 
95
- cache.delete "~#{id}"
95
+ cache.delete id_string
96
96
  end
97
97
 
98
98
  def expire_view_cache_keys view_keys
@@ -12,7 +12,7 @@ class Card
12
12
  def [] klass
13
13
  raise "nil klass" if klass.nil?
14
14
 
15
- cache_by_class[klass] ||= new class: klass, store: (shared_cache || nil)
15
+ cache_by_class[klass] ||= new class: klass, store: shared_cache || nil
16
16
  end
17
17
 
18
18
  # clear the temporary caches and ensure we're using the latest stamp
@@ -16,6 +16,7 @@ class Card
16
16
  #
17
17
  class Shared
18
18
  extend SharedClass
19
+
19
20
  # @param opts [Hash]
20
21
  # @option opts [Rails::Cache] :store
21
22
  # @option opts [ruby Class] :class, typically ActiveRecord descendant
@@ -116,8 +117,8 @@ class Card
116
117
  @store.write full_key(key), value
117
118
  end
118
119
 
119
- def fetch key, &block
120
- @store.fetch full_key(key), &block
120
+ def fetch(key, &)
121
+ @store.fetch(full_key(key), &)
121
122
  end
122
123
 
123
124
  def delete key
data/lib/card/codename.rb CHANGED
@@ -81,6 +81,7 @@ class Card
81
81
  def reset_cache
82
82
  @codehash = nil
83
83
  ::Card.cache.delete "CODENAMES"
84
+ generate_id_constants
84
85
  end
85
86
 
86
87
  # @param codename [Symbol, String]
@@ -72,9 +72,9 @@ class Card
72
72
  end
73
73
 
74
74
  def validate_chunk_list_key chunk_list_key
75
- unless raw_list.key? chunk_list_key
75
+ return if raw_list.key? chunk_list_key
76
+
76
77
  raise ArgumentError, "invalid chunk list key: #{chunk_list_key}"
77
- end
78
78
  end
79
79
  end
80
80
 
@@ -60,7 +60,8 @@ class Card
60
60
 
61
61
  def match_prefix prefix_regexp
62
62
  prefix_match = @content[@position..].match(prefix_regexp)
63
- if prefix_match
63
+ return unless prefix_match
64
+
64
65
  @prefix = prefix_match[0]
65
66
  # prefix of matched chunk
66
67
  @chunk_start = prefix_match.begin(0) + @position
@@ -73,7 +74,6 @@ class Card
73
74
  @position = @chunk_start
74
75
  # move scanning position up to beginning of chunk
75
76
  true
76
- end
77
77
  end
78
78
 
79
79
  def record_chunk
@@ -98,10 +98,10 @@ class Card
98
98
  end
99
99
 
100
100
  def handle_remainder
101
- if @chunks.any? && @last_position < @content.size
101
+ return unless @chunks.any? && @last_position < @content.size
102
+
102
103
  # handle any leftover nonchunk string at the end of content
103
104
  @chunks << @content[@last_position..]
104
- end
105
105
  end
106
106
  end
107
107
  end
data/lib/card/content.rb CHANGED
@@ -7,9 +7,7 @@ class Card
7
7
  # Each chunk has an object whose class inherits from {Card::Content::Chunk::Abstract}
8
8
  #
9
9
  class Content < SimpleDelegator
10
- extend Clean
11
-
12
- Chunk # trigger autoload
10
+ extend Clean # trigger autoload
13
11
 
14
12
  attr_reader :revision, :format, :chunks, :opts
15
13
 
@@ -47,8 +45,8 @@ class Card
47
45
  end
48
46
 
49
47
  # sends &block to #process_chunk on each Chunk object
50
- def process_chunks &block
51
- return custom_process_chunks(&block) if block_given?
48
+ def process_chunks(&)
49
+ return custom_process_chunks(&) if block_given?
52
50
 
53
51
  each_chunk(&:process_chunk)
54
52
  end
@@ -98,12 +96,12 @@ class Card
98
96
  "<#{__getobj__.class}:#{card}:#{self}>"
99
97
  end
100
98
 
101
- def without_nests &block
102
- without_chunks Chunk::Nest, &block
99
+ def without_nests(&)
100
+ without_chunks(Chunk::Nest, &)
103
101
  end
104
102
 
105
- def without_references &block
106
- without_chunks Chunk::Nest, Chunk::Link, Chunk::EscapedLiteral, &block
103
+ def without_references(&)
104
+ without_chunks(Chunk::Nest, Chunk::Link, Chunk::EscapedLiteral, &)
107
105
  end
108
106
 
109
107
  def without_chunks *chunk_classes
@@ -27,11 +27,11 @@ class Card
27
27
  end
28
28
  end
29
29
 
30
- def act options={}, &block
30
+ def act(options={}, &)
31
31
  if act_card
32
- add_to_act options, &block
32
+ add_to_act(options, &)
33
33
  else
34
- start_new_act(&block)
34
+ start_new_act(&)
35
35
  end
36
36
  end
37
37
 
@@ -45,7 +45,7 @@ class Card
45
45
 
46
46
  def save! **args
47
47
  as_subcard = args.delete :as_subcard
48
- act(as_subcard: as_subcard) { super **args }
48
+ act(as_subcard: as_subcard) { super(**args) }
49
49
  end
50
50
 
51
51
  def save *_args
@@ -107,11 +107,11 @@ class Card
107
107
  end
108
108
  end
109
109
 
110
- def ensuring_purity card, other, opts, &block
110
+ def ensuring_purity(card, other, opts, &)
111
111
  if opts[:codename] && other
112
- ensure_purity_advanced card, other, opts, &block
112
+ ensure_purity_advanced(card, other, opts, &)
113
113
  else
114
- ensure_purity_simple card, &block
114
+ ensure_purity_simple(card, &)
115
115
  end
116
116
  end
117
117
 
@@ -20,10 +20,10 @@ class Card
20
20
  Cardio.config.delaying == true
21
21
  end
22
22
 
23
- def with_delay_act act_id, card, &block
23
+ def with_delay_act(act_id, card, &)
24
24
  return yield unless act_id && (self.act = Act.find act_id)
25
25
 
26
- run_job_with_act act, card, &block
26
+ run_job_with_act(act, card, &)
27
27
  end
28
28
 
29
29
  def run_job_with_act act, card, &block
@@ -31,10 +31,10 @@ class Card
31
31
 
32
32
  # Unlike other phases, the storage phase takes a block,
33
33
  # because it is called by an "around" callback
34
- def storage_phase &block
34
+ def storage_phase(&)
35
35
  catch_up_to_stage :prepare_to_store # unless @abort
36
36
  # puts "before store #{@card.name}: abort:#{@abort}"
37
- run_stage :store, &block # unless @abort
37
+ run_stage(:store, &) # unless @abort
38
38
  run_stage :finalize # unless @abort
39
39
  raise ActiveRecord::RecordInvalid, @card if @card.errors.any?
40
40
  ensure
@@ -21,14 +21,14 @@ class Card
21
21
  # the subcards as we do in the other phases.
22
22
  # Instead we have to call `save` on the subcards and use the ActiveRecord
23
23
  # :around_save callback.
24
- def store &save_block
24
+ def store(&)
25
25
  raise Card::Error, "need block to store main card" if main? && !block_given?
26
26
 
27
27
  # the block is the ActiveRecord block from the around save callback that
28
28
  # saves the card
29
29
  if block_given?
30
30
  run_stage_callbacks :store
31
- store_with_subcards(&save_block)
31
+ store_with_subcards(&)
32
32
  else
33
33
  trigger_storage_phase_callback
34
34
  end
@@ -10,10 +10,10 @@ class Card
10
10
  end
11
11
 
12
12
  def save_location card
13
- return unless save_location?(card)
13
+ return unless save_location? card
14
14
 
15
- discard_locations_for card
16
- location_history.push location_for_history(card)
15
+ location = request ? request.original_url : location_for_history(card)
16
+ location_history.push(location).uniq!
17
17
  end
18
18
 
19
19
  def previous_location
@@ -21,21 +21,18 @@ class Card
21
21
  end
22
22
 
23
23
  def discard_locations_for card
24
- # quoting necessary because cards have things like "+*" in the names..
25
- session[:history] = location_history.reject do |loc|
26
- if (url_key = url_key_for_location(loc))
27
- url_key.to_name.key == card.key
28
- end
24
+ session[:history] = location_history.reject do |l|
25
+ location_cardname(l) == card.name
29
26
  end.compact
30
27
  end
31
28
 
32
- def save_interrupted_action uri
33
- session[:interrupted_action] = uri
34
- end
29
+ # def save_interrupted_action uri
30
+ # session[:interrupted_action] = uri
31
+ # end
35
32
 
36
- def interrupted_action
37
- session.delete :interrupted_action
38
- end
33
+ # def interrupted_action
34
+ # session.delete :interrupted_action
35
+ # end
39
36
 
40
37
  private
41
38
 
@@ -43,11 +40,13 @@ class Card
43
40
  Env::Location.card_path card.name.url_key
44
41
  end
45
42
 
46
- def url_key_for_location location
47
- %r{/([^/]*$)} =~ location ? Regexp.last_match[1] : nil
43
+ def location_cardname location
44
+ URI.parse(location).path.sub(%r{^/}, "").sub(%r{/.*$}, "")&.cardname
48
45
  end
49
46
 
50
47
  def save_location? card
48
+ # return false unless Auth.signed_in? || Cardio.config.allow_anonymous_cookies
49
+
51
50
  !Env.ajax? && Env.html? && card.known? && (card.codename != :signin)
52
51
  end
53
52
  end
@@ -22,16 +22,17 @@ class Card
22
22
  if session.is_a? Hash
23
23
  @session = {}
24
24
  elsif request
25
- update_cookie_setting false
25
+ update_session_options drop: false
26
26
  controller.reset_session
27
- # destroy_cookie unless Cardio.config.anonymous_cookies
27
+ # destroy_cookie unless Cardio.config.allow_anonymous_cookies
28
28
  end
29
29
  end
30
30
 
31
- def update_cookie_setting is_anonymous=true
32
- return unless request && !Cardio.config.anonymous_cookies
31
+ def update_session_options drop: nil
32
+ return unless request
33
+ return if Cardio.config.allow_anonymous_cookies
33
34
 
34
- request.session_options[:drop] = is_anonymous
35
+ request.session_options[:drop] = drop.nil? ? !Auth.signed_in? : drop
35
36
  end
36
37
 
37
38
  # private
data/lib/card/error.rb CHANGED
@@ -27,7 +27,7 @@ class Card
27
27
  self.card = message
28
28
  message = message_from_card
29
29
  end
30
- super message
30
+ super
31
31
  end
32
32
 
33
33
  def message_from_card
@@ -119,7 +119,7 @@ class Card
119
119
 
120
120
  def initialize status, msg=""
121
121
  @status = status
122
- super msg
122
+ super(msg)
123
123
  end
124
124
  end
125
125
 
@@ -28,8 +28,8 @@ class Card
28
28
  # new: { opts for Card#new } Return a new card when not found
29
29
  #
30
30
  # @return [Card]
31
- def fetch *args
32
- f = Fetch.new(*args)
31
+ def fetch(*)
32
+ f = Fetch.new(*)
33
33
  f.retrieve_or_new
34
34
  rescue ActiveModel::RangeError => _e
35
35
  Card.new name: "card id out of range: #{f.mark}"
@@ -4,7 +4,7 @@ class Card
4
4
  class CardActionView < ActionView::Base
5
5
  class << self
6
6
  def new controller
7
- super lookup_context, { _routes: nil }, controller
7
+ super(lookup_context, { _routes: nil }, controller)
8
8
  end
9
9
 
10
10
  def lookup_context
@@ -1,18 +1,18 @@
1
1
  class Card
2
2
  class Format
3
3
  module Content
4
- def process_content override_content=nil, content_opts=nil, &block
4
+ def process_content(override_content=nil, content_opts=nil, &)
5
5
  content_obj = content_object override_content, content_opts
6
- content_obj.process_chunks(&block)
6
+ content_obj.process_chunks(&)
7
7
  content_obj.to_s
8
8
  end
9
9
 
10
10
  # 1. Break out references (nests / links) into separate chunks
11
11
  # 2. yields the other (non-ref) content
12
12
  # 3. processes references
13
- def safe_process_content override_content=nil, content_opts=nil, &block
13
+ def safe_process_content(override_content=nil, content_opts=nil, &)
14
14
  content_obj = content_object override_content, chunk_list: :references
15
- process_content content_obj.without_references(&block), content_opts
15
+ process_content content_obj.without_references(&), content_opts
16
16
  end
17
17
 
18
18
  # nested by another card's content
@@ -17,8 +17,8 @@ class Card
17
17
 
18
18
  def view_for_unknown setting_view
19
19
  if main? && voo.root?
20
- root.error_status = 404
21
- :not_found
20
+ root.error_status = page_status_for_unknown
21
+ page_view_for_unknown
22
22
  else
23
23
  setting_view || :unknown
24
24
  end
@@ -39,11 +39,21 @@ class Card
39
39
  yield
40
40
  end
41
41
 
42
+ private
43
+
42
44
  def rescue_view e, view
43
45
  method = loud_error? ? :loud_error : :quiet_error
44
46
  send method, e, view
45
47
  end
46
48
 
49
+ def page_status_for_unknown
50
+ 404
51
+ end
52
+
53
+ def page_view_for_unknown
54
+ :not_found
55
+ end
56
+
47
57
  def error_cardname _exception
48
58
  if card&.name.present?
49
59
  safe_name
@@ -38,11 +38,11 @@ class Card
38
38
  # TODO: make it so we fall back to super if action_view can't handle method.
39
39
  # It's not as easy as `elsif api_render? method`, because respond_to gives
40
40
  # false for many methods action view can actually handle, like `h`
41
- def method_missing method, *opts, &proc
41
+ def method_missing(method, *opts, &)
42
42
  if (match = api_render? method)
43
43
  api_render match, opts
44
44
  else
45
- delegate_to_action_view method, opts, &proc
45
+ delegate_to_action_view(method, opts, &)
46
46
  end
47
47
  end
48
48
 
@@ -54,8 +54,8 @@ class Card
54
54
  end
55
55
  end
56
56
 
57
- def interpret_render_opts opts, &block
58
- (opts[0] ? opts.shift.clone : {}).tap(&block)
57
+ def interpret_render_opts(opts, &)
58
+ (opts[0] ? opts.shift.clone : {}).tap(&)
59
59
  end
60
60
 
61
61
  def optional_render_opt opts, args
@@ -21,11 +21,11 @@ class Card
21
21
  # run block with new_mode as nest_mode, then return to prior mode
22
22
  # @param new_mode [Symbol] :normal, :compact, :edit, or :template
23
23
  # @return block result
24
- def with_nest_mode new_mode, &block
24
+ def with_nest_mode(new_mode, &)
25
25
  if new_mode == @nest_mode
26
26
  yield
27
27
  else
28
- with_altered_nest_mode new_mode, &block
28
+ with_altered_nest_mode(new_mode, &)
29
29
  end
30
30
  end
31
31