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
@@ -4,6 +4,7 @@ class Card
4
4
  # class from which set patterns inherit
5
5
  class Base
6
6
  extend ClassMethods
7
+
7
8
  delegate :pattern_code, :pattern, :anchorless?, :assigns_type, to: :class
8
9
 
9
10
  def initialize card
@@ -45,7 +45,7 @@ class Card
45
45
  def field_test_name
46
46
  return unless event_test
47
47
 
48
- "_when_left_#{event_test}".to_sym
48
+ :"_when_left_#{event_test}"
49
49
  end
50
50
 
51
51
  def event_test
data/lib/card/subcards.rb CHANGED
@@ -58,10 +58,10 @@ class Card
58
58
  @keys.respond_to? method_name
59
59
  end
60
60
 
61
- def method_missing method, *args
61
+ def method_missing(method, *)
62
62
  return unless respond_to_missing?(method)
63
63
 
64
- @keys.send method, *args
64
+ @keys.send(method, *)
65
65
  end
66
66
 
67
67
  # fetch all cards first to avoid side effects
@@ -74,8 +74,8 @@ class Card
74
74
  end.compact
75
75
  end
76
76
 
77
- def each_card &block
78
- cards.each(&block)
77
+ def each_card(&)
78
+ cards.each(&)
79
79
  end
80
80
 
81
81
  alias_method :each, :each_card
@@ -6,6 +6,7 @@ class Card
6
6
  ACTIVE_CACHE_LEVEL =
7
7
  { always: :cache_yield,
8
8
  deep: :cache_yield,
9
+ force: :cache_yield,
9
10
  default: :yield,
10
11
  yes: :yield,
11
12
  never: :stub }.freeze
@@ -22,10 +23,10 @@ class Card
22
23
 
23
24
  def log_cache_action
24
25
  yield
25
- # TODO: make configurable
26
- # ...or better yet, integrate into performance logger...
27
- # Rails.logger.warn "VIEW CACHE #{cache_active? ? '-->' : ''}[#{action}] "\
28
- # "(#{card.name}##{requested_view})"
26
+ # .tap do |action|
27
+ # Rails.logger.warn "VIEW CACHE #{cache_active? ? '-->' : ''}[#{action}] "\
28
+ # "(#{card.name}##{requested_view})"
29
+ # end
29
30
  end
30
31
 
31
32
  # @return [Symbol] :off, :active, or :free
@@ -74,7 +75,15 @@ class Card
74
75
 
75
76
  # @return [Symbol]
76
77
  def active_cache_action
77
- active_cache_ok? ? active_cache_action_from_setting : :stub
78
+ if caching == :force
79
+ :yield
80
+ elsif deep_caching? && cache_setting != :never
81
+ :yield
82
+ elsif active_cache_ok?
83
+ active_cache_action_from_setting
84
+ else
85
+ :stub
86
+ end
78
87
  end
79
88
 
80
89
  # @return [True/False]
@@ -86,7 +95,7 @@ class Card
86
95
  end
87
96
 
88
97
  def cacheable_card?
89
- return true if caching == :deep || parent.present?
98
+ return true if deep_caching? || parent.present?
90
99
  # a parent voo means we're still in the same card
91
100
 
92
101
  return false unless (superformat_card = format.parent&.card)
@@ -119,8 +128,11 @@ class Card
119
128
 
120
129
  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
121
130
  # SHARED METHODS
131
+ def deep_caching?
132
+ caching.in? %i[deep force]
133
+ end
122
134
 
123
- # @return [Symbol] :standard, :always, or :never
135
+ # @return [Symbol] :default, :yes, :deep, :force, :always, or :never
124
136
  def cache_setting
125
137
  @cache_setting ||= format.view_cache_setting requested_view
126
138
  end
@@ -179,11 +179,11 @@ class Card
179
179
  # render or retrieve view (or stub) with current options
180
180
  # @param block [Block] code block to render
181
181
  # @return [rendered view or stub]
182
- def fetch &block
182
+ def fetch(&)
183
183
  case cache_action
184
- when :yield then yield # simple render
185
- when :cache_yield then cache_render(&block) # render to/from cache
186
- when :stub then stub # render stub
184
+ when :yield then yield # simple render
185
+ when :cache_yield then cache_render(&) # render to/from cache
186
+ when :stub then stub # render stub
187
187
  end
188
188
  end
189
189
 
@@ -196,8 +196,8 @@ class Card
196
196
  # those stubs.
197
197
  #
198
198
  # @return [String (usually)] rendered view
199
- def cache_render &block
200
- cached_view = cache_fetch(&block)
199
+ def cache_render(&)
200
+ cached_view = cache_fetch(&)
201
201
  cache_active? ? cached_view : format.stub_render(cached_view)
202
202
  end
203
203
 
@@ -212,18 +212,27 @@ class Card
212
212
  deep_root? ? false : self.class.caching?
213
213
  end
214
214
 
215
+ # def cache_render?
216
+ # cache_active? && !deep_caching?
217
+ # end
218
+
215
219
  # If view is cached, retrieve it. Otherwise render and store it.
216
220
  # Uses the primary cache API.
217
221
  def cache_fetch &block
218
- caching do
222
+ with_caching do
219
223
  ensure_cache_key
224
+ # Rails.logger.debug "Fetching::: #{cache_key}"
220
225
  self.class.cache.fetch cache_key, &block
221
226
  end
222
227
  end
223
228
 
224
229
  # keep track of nested cache fetching
225
- def caching &block
226
- self.class.caching(cache_setting, &block)
230
+ def with_caching(&)
231
+ self.class.with_caching(cache_setting, &)
232
+ end
233
+
234
+ def caching
235
+ self.class.caching
227
236
  end
228
237
 
229
238
  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -293,29 +302,23 @@ class Card
293
302
  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
294
303
  # cache-related Card::View class methods
295
304
  module ClassMethods
305
+ def caching
306
+ @caching
307
+ end
308
+
296
309
  def cache
297
310
  Card::Cache[Card::View]
298
311
  end
299
312
 
300
313
  def caching?
301
- !@caching.nil?
314
+ !caching.nil?
302
315
  end
303
316
 
304
- def caching setting, &block
305
- return @caching unless block_given?
306
-
307
- caching_mode setting, &block
308
- end
309
-
310
- private
311
-
312
- def caching_mode setting
313
- old_caching = @caching
314
- # puts "OPEN CACHING from #{old_caching} to #{setting}" unless @caching == :deep
315
- @caching = setting unless @caching == :deep
317
+ def with_caching setting
318
+ old_caching = caching
319
+ @caching = setting unless @caching.in? %i[deep force]
316
320
  yield
317
321
  ensure
318
- # puts "CLOSE CACHING from #{@caching} to #{old_caching}"
319
322
  @caching = old_caching
320
323
  end
321
324
  end
@@ -165,7 +165,7 @@ class Card
165
165
 
166
166
  # adds the wrappers assigned to ok_view in view definition
167
167
  def process_view_wrappers
168
- view_wrappers = format.view_setting(:wrap, ok_view)
168
+ view_wrappers = format.view_setting(:wrap, ok_view) if requested_view
169
169
  return unless view_wrappers.present?
170
170
 
171
171
  @live_options[:wrap] = Array.wrap(@live_options[:wrap])
@@ -52,6 +52,7 @@ class Card
52
52
  :structure, # overrides the content of the card
53
53
  :title, # overrides the name of the card
54
54
  :variant, # override the standard name with a different variant
55
+ :joint, # what joins the parts of a compound name ("+" by default)
55
56
  :input_type, # inline_nests makes a form within standard content (Symbol)
56
57
  :type, # set the default type of new cards
57
58
  :size, # set an image size
data/lib/card/view.rb CHANGED
@@ -76,7 +76,7 @@ class Card
76
76
  # be overridden, eg for the main view (top view of the main card on a page)
77
77
  # @return [Symbol] view name
78
78
  def requested_view
79
- @requested_view ||= View.normalize live_options[:view]
79
+ @requested_view ||= View.normalize(live_options[:view] || @raw_view)
80
80
  end
81
81
 
82
82
  # the final view. can be different from @requested_view when there are
@@ -21,7 +21,7 @@ module Cardio
21
21
 
22
22
  RSPEC ARGS
23
23
 
24
- See https://rspec.info/features/3-12/rspec-core/command-line/ or
24
+ See https://rspec.info/features/3-12/rspec-core/command-line/ or
25
25
  run card rspec -- -hb
26
26
  BANNER
27
27
 
@@ -32,7 +32,7 @@ module Cardio
32
32
  def determine_repo_path
33
33
  @repo_path_determined ? (return nil) : (@repo_path_determined = true)
34
34
  path = options["repo-path"]
35
- path = ENV["DECKO_REPO_PATH"] if path.blank?
35
+ path = ENV.fetch("DECKO_REPO_PATH", nil) if path.blank?
36
36
  path = prompt_for_repo_path if path.blank? && platypus?
37
37
  path.to_s
38
38
  end
data/lib/cardio/job.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  module Cardio
2
2
  class Job < ActiveJob::Base
3
-
4
3
  end
5
4
  end
@@ -129,8 +129,8 @@ module Cardio
129
129
  end
130
130
  end
131
131
 
132
- def each_subpath *subdirs, &block
133
- subpaths(*subdirs).each(&block)
132
+ def each_subpath(*subdirs, &)
133
+ subpaths(*subdirs).each(&)
134
134
  end
135
135
 
136
136
  private
@@ -35,10 +35,10 @@ module Cardio
35
35
  private
36
36
 
37
37
  # if output mod given,
38
- def handle_up &block
38
+ def handle_up(&)
39
39
  Card::Cache.reset_all
40
40
  Card::Mailer.perform_deliveries = false
41
- Card::Auth.as_bot(&block)
41
+ Card::Auth.as_bot(&)
42
42
  :success
43
43
  rescue StandardError => e
44
44
  e.message
@@ -46,9 +46,6 @@ module Cardio
46
46
 
47
47
  def track edible
48
48
  rescuing edible do
49
- # n = edible[:name]
50
- # binding.pry if (n.is_a? Array) && n.first.to_s == "main_menu"
51
- # puts "eating: #{edible}" if @verbose
52
49
  card = yield
53
50
  puts "eaten: #{card.name}".cyan if @verbose
54
51
  end
@@ -63,13 +60,13 @@ module Cardio
63
60
  end
64
61
 
65
62
  def current_user item_user
66
- Card::Auth.current_id = item_user&.card_id || @user_id || Card::WagnBotID
63
+ Card::Auth.current_id = item_user&.card_id || @user_id || Card::DeckoBotID
67
64
  end
68
65
 
69
- def time_machine value, &block
66
+ def time_machine(value, &)
70
67
  return yield unless value.present?
71
68
 
72
- Timecop.freeze Time.at(time_integer(value)), &block
69
+ Timecop.freeze(Time.at(time_integer(value)), &)
73
70
  end
74
71
 
75
72
  def time_integer value
@@ -21,7 +21,7 @@ module Cardio
21
21
  # Since module_eval doesn't take a binding argument, we have to
22
22
  # execute module_eval with eval.
23
23
  eval "#{set_module}.module_eval ::File.read('#{abs_path}'), '#{abs_path}'",
24
- module_path_binding(set_module)
24
+ module_path_binding(set_module), __FILE__, __LINE__ - 1
25
25
  end
26
26
  end
27
27
 
@@ -40,7 +40,7 @@ module Cardio
40
40
  m, b =
41
41
  eval(
42
42
  "[ #{part} , #{part}.module_eval('binding') ]", # [ History , History.module_eval('binding') ]
43
- b
43
+ b, __FILE__, __LINE__ - 1
44
44
  )
45
45
  end
46
46
  raise "Module found at name path not same as specified module" unless m == mod
@@ -7,7 +7,7 @@ module Cardio
7
7
  class SetLoader < Loader
8
8
  def initialize args={}
9
9
  @no_all = args.delete :no_all
10
- super load_strategy: args[:load_strategy], mod_dirs: args[:mod_dirs]
10
+ super(load_strategy: args[:load_strategy], mod_dirs: args[:mod_dirs])
11
11
  end
12
12
 
13
13
  def load_strategy_class strategy
@@ -66,8 +66,8 @@ module Cardio
66
66
 
67
67
  private
68
68
 
69
- def each_mod_dir module_type, &block
70
- @mod_dirs.each module_type, &block
69
+ def each_mod_dir(module_type, &)
70
+ @mod_dirs.each(module_type, &)
71
71
  end
72
72
 
73
73
  def each_file_in_dir base_dir, subdir=nil
@@ -60,7 +60,7 @@ module Cardio
60
60
  end
61
61
 
62
62
  def target
63
- @target ||= (old_data || nil)
63
+ @target ||= old_data || nil
64
64
  end
65
65
 
66
66
  def target_index new_item
data/lib/cardio/seed.rb CHANGED
@@ -46,7 +46,7 @@ module Cardio
46
46
  private
47
47
 
48
48
  def update_seed?
49
- ENV["CARD_UPDATE_SEED"]
49
+ ENV.fetch("CARD_UPDATE_SEED", nil)
50
50
  end
51
51
 
52
52
  # TODO: make this more robust. only handles simple case of extra seed tables
@@ -104,7 +104,7 @@ module Cardio
104
104
  end
105
105
 
106
106
  def author_id
107
- Card::WagnBotID
107
+ Card::DeckoBotID
108
108
  end
109
109
  end
110
110
  end
@@ -123,7 +123,7 @@ module Cardio
123
123
 
124
124
  def seed_data
125
125
  if options["interactive"]
126
- Interactive.new(destination_root, (monkey? || platypus?)).run
126
+ Interactive.new(destination_root, monkey? || platypus?).run
127
127
  else
128
128
  prefix = "bundle exec " if options["platypus"]
129
129
  puts "Now:
@@ -5,6 +5,7 @@ module Cardio
5
5
  # generate structure and card migrations
6
6
  class MigrationGenerator < ActiveRecord::Generators::Base
7
7
  extend ClassMethods
8
+
8
9
  source_root File.expand_path("templates", __dir__)
9
10
 
10
11
  argument :name, required: true
@@ -8,7 +8,7 @@ de:
8
8
  core_error_cant_alter: Typ kann nicht geändert werden; es gibt noch %{name} Karten
9
9
  core_error_cant_change_errors: "von %{name} kann nicht geändert werden; Fehler beim Erstellen von neuen %{type_id}: %{error_messages}"
10
10
  core_error_code_in_use: Codename %{codename} ist bereits vergeben
11
- core_error_hard_templated: kann nicht geändert werden, weil %{name} ist eine Vorlage für %{type_name}
11
+ core_error_structured: kann nicht geändert werden, weil %{name} ist eine Vorlage für %{type_name}
12
12
  core_error_indestructible: "%{name} ist eine unzerstörbare Regel"
13
13
  core_error_invalid_character_in_cardtype: "folgende Zeichen sind nicht erlaubt: %{banned}"
14
14
  core_error_name_exists: muss eindeutig sein; '%{name}' gibt es bereits.
@@ -9,7 +9,7 @@ en:
9
9
  core_error_cant_change_errors: "of %{name} can't be changed; errors creating new %{type_id}: %{error_messages}"
10
10
  core_error_code_in_use: codename %{codename} already in use
11
11
  core_codename_must_be_simple: only simple cards can have codenames
12
- core_error_hard_templated: can't be changed because %{name} is hard templated to %{type_name}
12
+ core_error_structured: can't be changed because %{name} is structured as a %{type_name}
13
13
  core_error_indestructible: "%{name} is an indestructible rule"
14
14
  core_error_invalid_character_in_cardtype: "may not contain any of the following characters: %{banned}"
15
15
  core_error_name_exists: must be unique; '%{name}' already exists.
@@ -3,7 +3,7 @@ cards_001:
3
3
  id: 1
4
4
  name: Decko Bot
5
5
  key: decko_bot
6
- codename: wagn_bot
6
+ codename: decko_bot
7
7
  creator_id: 1
8
8
  updater_id: 1
9
9
  read_rule_class: "*all"
@@ -16,7 +16,7 @@
16
16
  [[http://decko.org/card_types|more]]
17
17
  </p>
18
18
  - :name: Decko Bot
19
- :codename: wagn_bot
19
+ :codename: decko_bot
20
20
  :content: |-
21
21
  <p>
22
22
  This is the account that makes any automated updates &mdash; cards
@@ -5,3 +5,4 @@ input: input_type
5
5
  options: content_options
6
6
  options_label: content_option_view
7
7
  token: api_key
8
+ wagn_bot: decko_bot
@@ -30,7 +30,7 @@ namespace :card do
30
30
  desc "install all mods"
31
31
  task install: :environment do
32
32
  puts "installing mods"
33
- Card::Auth.signin :wagn_bot.card
33
+ Card::Auth.signin :decko_bot.card
34
34
  # Cardio.config.compress_assets = true # should not be here, imo #efm
35
35
  Cardio::Mod.ensure_installed
36
36
  end
@@ -0,0 +1,8 @@
1
+ namespace :card do
2
+ namespace :trash do
3
+ desc "empty trash"
4
+ task :empty do
5
+ Cardio::Utils.empty_trash
6
+ end
7
+ end
8
+ end
@@ -13,24 +13,8 @@ namespace :card do
13
13
  ENV["NO_RAILS_CACHE"] = "true"
14
14
  run_tasks ["migrate:port", "migrate:schema", "migrate:recode",
15
15
  :eat, "migrate:transform",
16
- "mod:uninstall", "mod:install", "mod:symlink", :reset] # , true
17
- end
18
- end
19
-
20
- def run_tasks tasks, with_benchmark: false
21
- if with_benchmark
22
- require "benchmark"
23
- Benchmark.bm do |x|
24
- x.report("total") do
25
- tasks.each do |task|
26
- x.report(task) { Rake::Task["card:#{task}"].invoke }
27
- end
28
- end
29
- end
30
- else
31
- tasks.each do |task|
32
- Rake::Task["card:#{task}"].invoke
33
- end
16
+ "mod:uninstall", "mod:install", "mod:symlink", :reset]
17
+ # , with_benchmark: true
34
18
  end
35
19
  end
36
20
 
@@ -116,6 +100,23 @@ namespace :card do
116
100
  @options ||= {}
117
101
  end
118
102
 
103
+ def run_tasks tasks, with_benchmark: false
104
+ if with_benchmark
105
+ require "benchmark"
106
+ Benchmark.bm do |x|
107
+ x.report("total") do
108
+ tasks.each do |task|
109
+ x.report(task) { Rake::Task["card:#{task}"].invoke }
110
+ end
111
+ end
112
+ end
113
+ else
114
+ tasks.each do |task|
115
+ Rake::Task["card:#{task}"].invoke
116
+ end
117
+ end
118
+ end
119
+
119
120
  def rake_result task
120
121
  result = yield
121
122
  if result == :success
@@ -5,7 +5,7 @@ def assign_attributes args={}
5
5
 
6
6
  assign_with_subcards args do
7
7
  assign_with_set_modules args do
8
- super prepare_assignment_params(args)
8
+ super(prepare_assignment_params(args))
9
9
  end
10
10
  end
11
11
  end
@@ -48,10 +48,10 @@ def prepare_assignment_args args
48
48
  args
49
49
  end
50
50
 
51
- def assign_with_set_modules args, &block
51
+ def assign_with_set_modules(args, &)
52
52
  return yield unless args[:name] || args[:type_id]
53
53
 
54
- refresh_set_modules(&block)
54
+ refresh_set_modules(&)
55
55
  end
56
56
 
57
57
  def assign_with_subcards args
@@ -8,7 +8,6 @@ event :reset_codename_cache, :integrate, changed: :codename do
8
8
  return if action == :create && codename.nil?
9
9
 
10
10
  Card::Codename.reset_cache
11
- Card::Codename.generate_id_constants
12
11
  end
13
12
 
14
13
  private
@@ -4,7 +4,7 @@ JUNK_INIT_ARGS = %i[missing skip_virtual id].freeze
4
4
  module ClassMethods
5
5
  def new args={}, _options={}
6
6
  with_normalized_new_args args do |normalized_args|
7
- super normalized_args
7
+ super(normalized_args)
8
8
  end
9
9
  end
10
10
 
@@ -37,7 +37,7 @@ def initialize args={}
37
37
 
38
38
  handle_set_modules args do
39
39
  handle_type args do
40
- super args # ActiveRecord #initialize
40
+ super(args) # ActiveRecord #initialize
41
41
  end
42
42
  end
43
43
  end
@@ -85,15 +85,11 @@ end
85
85
 
86
86
  # has not been edited directly by human users. bleep blorp.
87
87
  def pristine?
88
- if new_card?
89
- true
90
- elsif subcards? && subcards.cards.find(&:altered?)
91
- false
92
- elsif (created_at == updated_at) && (creator_id == WagnBotID)
93
- true
94
- else
95
- !user_changes?
96
- end
88
+ return true if new_card?
89
+ return false if subcards? && subcards.cards.find(&:altered?)
90
+ return true if (created_at == updated_at) && (creator_id == DeckoBotID)
91
+
92
+ !user_changes?
97
93
  end
98
94
 
99
95
  def altered?
@@ -101,5 +97,5 @@ def altered?
101
97
  end
102
98
 
103
99
  def user_changes?
104
- actions.joins(:act).where("card_acts.actor_id != ?", WagnBotID).exists?
100
+ actions.joins(:act).where("card_acts.actor_id != ?", DeckoBotID).exists?
105
101
  end
@@ -19,7 +19,7 @@ event :validate_type, :validate, changed: :type_id, on: :save do
19
19
 
20
20
  if structure&.assigns_type? && type_id != structure.type_id
21
21
  errors.add :type,
22
- t(:core_error_hard_templated, name: name, type_name: structure.type_name)
22
+ t(:core_error_structured, name: name, type_name: structure.type_name)
23
23
  end
24
24
  end
25
25
 
@@ -29,9 +29,9 @@ format :html do
29
29
  card.all_admin_configs_grouped_by(:roles, :category).map do |(role, configs_by_cat)|
30
30
  output [
31
31
  content_tag(:h2, role.to_sym.cardname),
32
- (configs_by_cat.map do |(cat, configs)|
32
+ configs_by_cat.map do |(cat, configs)|
33
33
  list_section cat, configs.map(&:codename)
34
- end)
34
+ end
35
35
  ]
36
36
  end.join("<br/>")
37
37
  ]
@@ -26,7 +26,7 @@ RSpec.describe Card::Set::All::Admin do
26
26
  "link_list",
27
27
  "local_script_folder_group", "local_script_manifest_group",
28
28
  "local_style_folder_group",
29
- "nest_list", "remote_manifest_group", "role",
29
+ "nest_list", "role",
30
30
  "local_style_manifest_group", "bootswatch_skin",
31
31
  "date", "notification_template", "session", "basic",
32
32
  "search_type", "signup")
@@ -178,9 +178,9 @@ end
178
178
  # NOT WORKING, BUT IT SHOULD
179
179
  # describe Card, "a part of an unremovable card" do
180
180
  # before do
181
- # Card::Auth.as(Card::WagnBotID)
181
+ # Card::Auth.as(Card::DeckoBotID)
182
182
  # # this ugly setup makes it so A+Admin is the actual user with edits..
183
- # Card["Wagn Bot"].update! name: "A+Wagn Bot"
183
+ # Card["Decko Bot"].update! name: "A+Decko Bot"
184
184
  # end
185
185
  # it "does not be removable" do
186
186
  # @a = Card['A']