card 1.108.0 → 1.109.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.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/config/environments/development.rb +1 -1
- data/config/environments/production.rb +5 -2
- data/config/environments/test.rb +2 -2
- data/config/initializers/01_core_extensions/array.rb +1 -0
- data/config/initializers/01_core_extensions/hash.rb +4 -0
- data/config/initializers/02_patches/active_record.rb +1 -1
- data/config/initializers/core_extensions.rb +0 -1
- data/config/initializers/deck_config.rb +3 -3
- data/config/initializers/patches.rb +6 -6
- data/db/schema.rb +1 -1
- data/lib/card/auth/current.rb +8 -6
- data/lib/card/auth.rb +7 -6
- data/lib/card/cache/class_methods.rb +2 -4
- data/lib/card/cache/shared.rb +1 -1
- data/lib/card/cache/temporary.rb +2 -2
- data/lib/card/codename.rb +0 -1
- data/lib/card/content/chunk/abstract.rb +1 -0
- data/lib/card/content/chunk.rb +0 -1
- data/lib/card/content/clean.rb +4 -2
- data/lib/card/content/diff/l_c_s.rb +1 -2
- data/lib/card/content/diff/result.rb +2 -1
- data/lib/card/content/diff.rb +2 -1
- data/lib/card/content/parser.rb +8 -7
- data/lib/card/content.rb +1 -1
- data/lib/card/director/subdirector_array.rb +1 -0
- data/lib/card/director.rb +1 -1
- data/lib/card/dirty/method_factory.rb +1 -0
- data/lib/card/env/location.rb +3 -3
- data/lib/card/env/location_history.rb +12 -11
- data/lib/card/env/success/target.rb +4 -4
- data/lib/card/env/support.rb +24 -2
- data/lib/card/error.rb +1 -0
- data/lib/card/fetch/store.rb +1 -1
- data/lib/card/format/error.rb +1 -0
- data/lib/card/format/method_delegation.rb +6 -4
- data/lib/card/format/registration.rb +5 -3
- data/lib/card/format/wrapper.rb +1 -0
- data/lib/card/mailer.rb +1 -14
- data/lib/card/name/all/parts.rb +1 -1
- data/lib/card/name/all.rb +1 -0
- data/lib/card/name/name_variants.rb +1 -0
- data/lib/card/query/abstract_query/query_helper.rb +1 -2
- data/lib/card/query/abstract_query/tie.rb +1 -1
- data/lib/card/query/abstract_query.rb +3 -3
- data/lib/card/query/card_class.rb +1 -0
- data/lib/card/query/clause.rb +1 -0
- data/lib/card/query/join.rb +3 -3
- data/lib/card/reference/all.rb +6 -7
- data/lib/card/rule/cache.rb +1 -0
- data/lib/card/rule/preference_cache.rb +2 -0
- data/lib/card/rule/read_rule_cache.rb +3 -0
- data/lib/card/set/event/all.rb +6 -4
- data/lib/card/set/event/callbacks.rb +1 -0
- data/lib/card/set/event/options.rb +3 -2
- data/lib/card/set/event/skip_and_trigger.rb +1 -1
- data/lib/card/set/event.rb +2 -2
- data/lib/card/set/format/abstract_format/view_definition.rb +1 -1
- data/lib/card/set/format/haml_paths.rb +1 -1
- data/lib/card/set/format.rb +4 -4
- data/lib/card/set/helpers.rb +4 -4
- data/lib/card/set/i18n_scanner.rb +23 -22
- data/lib/card/set/i18n_scope.rb +4 -3
- data/lib/card/set/pattern/all.rb +1 -1
- data/lib/card/set/pattern/base.rb +6 -3
- data/lib/card/set/pattern/class_methods.rb +1 -1
- data/lib/card/set/pattern.rb +1 -1
- data/lib/card/set/required_field.rb +3 -0
- data/lib/card/set/trait.rb +6 -1
- data/lib/card/subcards/all.rb +12 -4
- data/lib/card/view/cache/cache_action.rb +1 -1
- data/lib/card/view/cache.rb +1 -1
- data/lib/card/view/classy.rb +5 -5
- data/lib/card/view/options/key_lists.rb +1 -0
- data/lib/card/view/options/voo_api.rb +1 -1
- data/lib/cardio/command/application.rb +1 -1
- data/lib/cardio/command/custom.rb +7 -6
- data/lib/cardio/command/rake_command.rb +3 -2
- data/lib/cardio/command/rspec_command.rb +1 -0
- data/lib/cardio/generators/deck_generator_loader.rb +1 -1
- data/lib/cardio/generators.rb +4 -3
- data/lib/cardio/migration/port.rb +2 -0
- data/lib/cardio/migration/stamp.rb +1 -0
- data/lib/cardio/migration/transform.rb +1 -0
- data/lib/cardio/migration.rb +2 -0
- data/lib/cardio/mod/class_methods.rb +1 -2
- data/lib/cardio/mod/dirs.rb +2 -4
- data/lib/cardio/mod/eat/edibles.rb +8 -6
- data/lib/cardio/mod/eat.rb +6 -5
- data/lib/cardio/mod/load_strategy/set_binding_magic.rb +1 -1
- data/lib/cardio/mod/load_strategy/tmp_files.rb +3 -2
- data/lib/cardio/mod/load_strategy.rb +1 -0
- data/lib/cardio/mod/loader/set_pattern_loader.rb +4 -0
- data/lib/cardio/mod/loader/set_template.rb +14 -4
- data/lib/cardio/mod/loader.rb +2 -2
- data/lib/cardio/mod/sow/card_source.rb +1 -1
- data/lib/cardio/mod/sow/remote_source.rb +32 -0
- data/lib/cardio/mod/sow.rb +10 -10
- data/lib/cardio/railtie.rb +1 -0
- data/lib/cardio/script_loader.rb +1 -1
- data/lib/cardio/seed.rb +1 -1
- data/lib/cardio/utils.rb +1 -1
- data/lib/cardio/version.rb +2 -1
- data/lib/cardio.rb +3 -0
- data/lib/generators/deck/templates/config.ru.erb +1 -1
- data/mod/core/config/locales/en.yml +1 -0
- data/mod/core/data/schema/20141001105348_move_revisions_to_actions.rb +2 -2
- data/mod/core/data/schema/20241017160402_unique_codename.rb +8 -0
- data/mod/core/data/transform/20150724123438_update_file_and_image_cards.rb +1 -1
- data/mod/core/lib/tasks/card/export.rake +28 -0
- data/mod/core/lib/tasks/card/migrate.rake +3 -3
- data/mod/core/lib/tasks/card/seed.rake +3 -1
- data/mod/core/lib/tasks/card.rake +47 -16
- data/mod/core/set/all/admin.rb +1 -2
- data/mod/core/set/all/assign_attributes.rb +3 -2
- data/mod/core/set/all/codename.rb +7 -0
- data/mod/core/set/all/debug.rb +3 -3
- data/mod/core/set/all/initialize.rb +1 -0
- data/mod/core/set/all/states.rb +7 -6
- data/mod/core/set/all/type.rb +2 -0
- data/mod/core/set/all/utils.rb +0 -1
- data/mod/core/set/self/admin.rb +2 -1
- data/mod/core/set/self/autoname.rb +1 -1
- data/mod/core/set/self/mod.rb +4 -4
- data/mod/core/set/self/trash.rb +1 -1
- data/mod/core/set/type/mod.rb +18 -15
- data/mod/core/set_pattern/09_self.rb +4 -0
- data/mod/core/spec/set/all/trash_spec.rb +7 -7
- metadata +42 -29
@@ -17,6 +17,7 @@ namespace :card do
|
|
17
17
|
|
18
18
|
# desc "finalize seed data with migrations, installations, asset coding, and cleaning"
|
19
19
|
task polish: :environment do
|
20
|
+
ENV["DECKO_DUMP_SCHEMA"] = "true"
|
20
21
|
ENV["STAMP_MIGRATIONS"] = "true"
|
21
22
|
|
22
23
|
invoke_card_tasks %w[update assets:code]
|
@@ -33,6 +34,7 @@ namespace :card do
|
|
33
34
|
|
34
35
|
# desc "dump db to fixtures"
|
35
36
|
task dump: :environment do
|
37
|
+
puts "dumping".green
|
36
38
|
Card::Cache.reset_all
|
37
39
|
Cardio::Seed.dump
|
38
40
|
end
|
@@ -53,7 +55,7 @@ namespace :card do
|
|
53
55
|
end
|
54
56
|
|
55
57
|
def invoke_card_task task
|
56
|
-
puts "invoking: #{task}"
|
58
|
+
puts "invoking: #{task}"
|
57
59
|
Rake::Task["card:#{task}"].invoke
|
58
60
|
end
|
59
61
|
end
|
@@ -11,9 +11,24 @@ namespace :card do
|
|
11
11
|
task :update do
|
12
12
|
failing_loudly "decko update" do
|
13
13
|
ENV["NO_RAILS_CACHE"] = "true"
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
run_tasks ["migrate:port", "migrate:schema", "migrate:recode",
|
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|
|
17
32
|
Rake::Task["card:#{task}"].invoke
|
18
33
|
end
|
19
34
|
end
|
@@ -21,8 +36,7 @@ namespace :card do
|
|
21
36
|
|
22
37
|
desc "Ingests card data from mod yaml"
|
23
38
|
task eat: :environment do
|
24
|
-
|
25
|
-
parse_options :eat do
|
39
|
+
run_with_options :eat, Cardio::Mod::Eat, "eating" do
|
26
40
|
add_opt :m, :mod, "only eat cards in given mod"
|
27
41
|
add_opt :n, :name, "only eat card with name (handles : for codenames)"
|
28
42
|
add_opt :u, :user, "user to credit unless specified (default is Decko Bot)"
|
@@ -31,26 +45,46 @@ namespace :card do
|
|
31
45
|
add_opt :e, :env, "environment (test, production, etc)"
|
32
46
|
flag_opt :v, :verbose, "output progress info and error backtraces"
|
33
47
|
end
|
48
|
+
end
|
34
49
|
|
35
|
-
|
36
|
-
|
37
|
-
|
50
|
+
def args_without_env_arg
|
51
|
+
env_index = ARGV.find_index { |entry| %w[-e --env].include?(entry) }
|
52
|
+
args =
|
53
|
+
if env_index
|
54
|
+
ARGV[1..].select.with_index do |_, index|
|
55
|
+
(index != env_index - 1) && (index != env_index)
|
56
|
+
end
|
57
|
+
else
|
58
|
+
ARGV[1..]
|
59
|
+
end
|
60
|
+
args&.join " "
|
38
61
|
end
|
39
62
|
|
40
|
-
def adjust_environment options, task
|
63
|
+
def adjust_environment options, args_without_env, task, task_message
|
41
64
|
if (env = options.delete(:env))
|
42
|
-
|
43
|
-
|
65
|
+
command = "env RAILS_ENV=#{env} bundle exec rake card:#{task} #{args_without_env}"
|
66
|
+
puts command.yellow
|
67
|
+
success = system command
|
68
|
+
exit success # to avoid that rake tries to run the arguments as rake tasks
|
44
69
|
else
|
70
|
+
puts task_message
|
45
71
|
yield
|
46
72
|
end
|
47
73
|
end
|
48
74
|
|
75
|
+
def run_with_options task_name, task_class, start_message, &block
|
76
|
+
args_without_env = args_without_env_arg
|
77
|
+
parse_options task_name, &block
|
78
|
+
adjust_environment options, args_without_env, task_name, start_message do
|
79
|
+
rake_result(task_name) { task_class.new(**options).run }
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
49
83
|
desc "Exports card data to mod yaml"
|
50
84
|
task sow: :environment do
|
51
|
-
|
52
|
-
parse_options :sow do
|
85
|
+
run_with_options :sow, Cardio::Mod::Sow, "sowing" do
|
53
86
|
add_opt :n, :name, "export card with name/mark (handles : and ~ prefixes)"
|
87
|
+
add_opt :r, :remote, "export card from remote deck (with -n)"
|
54
88
|
flag_opt :i, :items, "also export card items (with -n)"
|
55
89
|
flag_opt :o, :only_items, "only export card items (with -n)", items: :only
|
56
90
|
add_opt :c, :cql, "export cards found by CQL (in JSON format)"
|
@@ -60,9 +94,6 @@ namespace :card do
|
|
60
94
|
add_opt :t, :field_tags, "comma-separated list of field tag marks"
|
61
95
|
add_opt :e, :env, "environment (test, production, etc)"
|
62
96
|
end
|
63
|
-
adjust_environment options, :sow do
|
64
|
-
rake_result(:sow) { Cardio::Mod::Sow.new(**options).out }
|
65
|
-
end
|
66
97
|
end
|
67
98
|
|
68
99
|
desc "Clears both cache and tmpfiles"
|
data/mod/core/set/all/admin.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
basket[:tasks] = {}
|
3
2
|
basket[:config_title] = {
|
4
3
|
basic: "Basic configuration",
|
@@ -59,7 +58,7 @@ def all_admin_configs_of_category category
|
|
59
58
|
end
|
60
59
|
|
61
60
|
def config_codenames_grouped_by_title configs
|
62
|
-
configs&.group_by
|
61
|
+
configs&.group_by(&:title)&.map do |title, grouped_configs|
|
63
62
|
[title, grouped_configs.map { |config| config.codename.to_sym }]
|
64
63
|
end
|
65
64
|
end
|
@@ -18,6 +18,7 @@ end
|
|
18
18
|
|
19
19
|
protected
|
20
20
|
|
21
|
+
# extends Card Class
|
21
22
|
module ClassMethods
|
22
23
|
def assign_or_newish name, attributes, fetch_opts={}
|
23
24
|
if (known_card = Card.fetch(name, fetch_opts))
|
@@ -47,10 +48,10 @@ def prepare_assignment_args args
|
|
47
48
|
args
|
48
49
|
end
|
49
50
|
|
50
|
-
def assign_with_set_modules args
|
51
|
+
def assign_with_set_modules args, &block
|
51
52
|
return yield unless args[:name] || args[:type_id]
|
52
53
|
|
53
|
-
refresh_set_modules
|
54
|
+
refresh_set_modules(&block)
|
54
55
|
end
|
55
56
|
|
56
57
|
def assign_with_subcards args
|
@@ -1,6 +1,7 @@
|
|
1
1
|
event :validate_codename, :validate, on: :update, changed: :codename do
|
2
2
|
validate_codename_permission
|
3
3
|
validate_codename_uniqueness
|
4
|
+
validate_codename_simplicity
|
4
5
|
end
|
5
6
|
|
6
7
|
event :reset_codename_cache, :integrate, changed: :codename do
|
@@ -30,3 +31,9 @@ def validate_codename_uniqueness
|
|
30
31
|
|
31
32
|
errors.add :codename, t(:core_error_code_in_use, codename: codename)
|
32
33
|
end
|
34
|
+
|
35
|
+
def validate_codename_simplicity
|
36
|
+
return if name.simple?
|
37
|
+
|
38
|
+
errors.add :codename, t(:core_codename_must_be_simple)
|
39
|
+
end
|
data/mod/core/set/all/debug.rb
CHANGED
@@ -10,9 +10,9 @@ end
|
|
10
10
|
private
|
11
11
|
|
12
12
|
def inspect_tags
|
13
|
-
%w[trash new frozen readonly virtual set_mods_loaded].
|
14
|
-
|
15
|
-
end
|
13
|
+
%w[trash new frozen readonly virtual set_mods_loaded].select do |tag|
|
14
|
+
send "#{tag}?"
|
15
|
+
end
|
16
16
|
end
|
17
17
|
|
18
18
|
def debug_type
|
data/mod/core/set/all/states.rb
CHANGED
@@ -13,6 +13,7 @@
|
|
13
13
|
# - *known* cards are either _real_ or _virtual_
|
14
14
|
# - *new* (or *unreal*) cards are either _unknown_ or _virtual_
|
15
15
|
|
16
|
+
# extends Card Class
|
16
17
|
module ClassMethods
|
17
18
|
def real? mark
|
18
19
|
quick_fetch(mark).present?
|
@@ -28,10 +29,9 @@ end
|
|
28
29
|
# @return [Symbol] :real, :virtual, or :unknown
|
29
30
|
def state anti_fishing=true
|
30
31
|
case
|
31
|
-
when !known?
|
32
|
-
when
|
33
|
-
when
|
34
|
-
when virtual? then :virtual
|
32
|
+
when !known? || (anti_fishing && !ok?(:read)) then :unknown
|
33
|
+
when real? then :real
|
34
|
+
when virtual? then :virtual
|
35
35
|
else :wtf
|
36
36
|
end
|
37
37
|
end
|
@@ -68,8 +68,9 @@ end
|
|
68
68
|
|
69
69
|
# @return [True/False]
|
70
70
|
def new?
|
71
|
-
new_record? ||
|
72
|
-
!@from_trash.nil?
|
71
|
+
(new_record? || # not yet in db (from ActiveRecord) or
|
72
|
+
!@from_trash.nil?) && # in process of restoration from trash, but
|
73
|
+
!trash? # not in trash
|
73
74
|
end
|
74
75
|
alias_method :new_card?, :new?
|
75
76
|
alias_method :unreal?, :new?
|
data/mod/core/set/all/type.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# extends Card Class
|
1
2
|
module ClassMethods
|
2
3
|
def default_type_id
|
3
4
|
@default_type_id ||= Card.fetch_type_id %i[all default]
|
@@ -66,6 +67,7 @@ end
|
|
66
67
|
|
67
68
|
def type_id_from_code
|
68
69
|
return if simple?
|
70
|
+
|
69
71
|
each_type_assigning_module_key do |module_key|
|
70
72
|
type_id = Card::Set::Type.assignment[module_key]&.card_id
|
71
73
|
return type_id if type_id
|
data/mod/core/set/all/utils.rb
CHANGED
data/mod/core/set/self/admin.rb
CHANGED
@@ -23,6 +23,7 @@ end
|
|
23
23
|
|
24
24
|
event :admin_tasks, :initialize, on: :update do
|
25
25
|
return unless (task = Env.params[:task]&.to_sym) && (task_config = basket[:tasks][task])
|
26
|
+
|
26
27
|
raise Card::Error::PermissionDenied, self unless Auth.always_ok?
|
27
28
|
|
28
29
|
# when :repair_references then Card::Reference.repair_all
|
@@ -46,7 +47,7 @@ end
|
|
46
47
|
|
47
48
|
def not_allowed task
|
48
49
|
raise Card::Error::PermissionDenied,
|
49
|
-
"The admin task '#{task}' is disabled for security reasons.<br>"\
|
50
|
+
"The admin task '#{task}' is disabled for security reasons.<br>" \
|
50
51
|
"You can enable it with the config option 'allow_irreversible_admin_tasks'"
|
51
52
|
end
|
52
53
|
|
data/mod/core/set/self/mod.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
include_set Abstract::List
|
2
2
|
|
3
|
-
def
|
3
|
+
def item_codes
|
4
4
|
Cardio.mods.map do |mod|
|
5
5
|
"#{mod}_mod"
|
6
6
|
end
|
7
7
|
end
|
8
8
|
|
9
9
|
def content
|
10
|
-
|
10
|
+
item_codes.map(&:cardname).compact.to_pointer_content
|
11
11
|
end
|
12
12
|
|
13
13
|
format :html do
|
@@ -18,7 +18,7 @@ format :html do
|
|
18
18
|
card.all_admin_configs_grouped_by(:category, :mod)[view_name.to_s]
|
19
19
|
.map do |(mod, configs)|
|
20
20
|
list_section(mod.name, configs.map { |c| c.codename.to_sym })
|
21
|
-
end.join("<br
|
21
|
+
end.join("<br/>")
|
22
22
|
]
|
23
23
|
end
|
24
24
|
end
|
@@ -33,7 +33,7 @@ format :html do
|
|
33
33
|
list_section cat, configs.map(&:codename)
|
34
34
|
end)
|
35
35
|
]
|
36
|
-
end.join("<br
|
36
|
+
end.join("<br/>")
|
37
37
|
]
|
38
38
|
end
|
39
39
|
end
|
data/mod/core/set/self/trash.rb
CHANGED
@@ -37,7 +37,7 @@ format :html do
|
|
37
37
|
btn_type: :default,
|
38
38
|
path: { mark: :admin, action: :update, task: :empty_trash,
|
39
39
|
success: { mark: "~#{card.id}" } },
|
40
|
-
"data-confirm" => "Are you sure you want to delete "\
|
40
|
+
"data-confirm" => "Are you sure you want to delete " \
|
41
41
|
"all cards in the trash?")
|
42
42
|
)
|
43
43
|
end
|
data/mod/core/set/type/mod.rb
CHANGED
@@ -53,17 +53,20 @@ format :html do
|
|
53
53
|
view :styles do
|
54
54
|
style = card.fetch :style
|
55
55
|
return unless style
|
56
|
+
|
56
57
|
section "Styles", nest(style, view: :core)
|
57
58
|
end
|
58
59
|
|
59
60
|
view :scripts do
|
60
61
|
style = card.fetch :script
|
61
62
|
return unless style
|
63
|
+
|
62
64
|
section "Scripts", nest(style, view: :core)
|
63
65
|
end
|
64
66
|
|
65
67
|
view :gem_info do
|
66
68
|
return unless card.mod&.spec
|
69
|
+
|
67
70
|
properties =
|
68
71
|
%w[name summary version authors description email homepage].map do |property|
|
69
72
|
"#{property}: #{card.mod.spec.send(property)}"
|
@@ -113,7 +116,7 @@ def scripts?
|
|
113
116
|
end
|
114
117
|
|
115
118
|
def depends_on?
|
116
|
-
|
119
|
+
depends_on.present?
|
117
120
|
end
|
118
121
|
|
119
122
|
def description?
|
@@ -125,10 +128,7 @@ def views?
|
|
125
128
|
end
|
126
129
|
|
127
130
|
def depends_on
|
128
|
-
mod&.spec&.dependencies
|
129
|
-
&.map { |dep| dep.name }
|
130
|
-
&.select { |name| name.starts_with? "card-mod" }
|
131
|
-
&.map { |name| "mod_#{name[8..-1]}" }
|
131
|
+
@depends_on ||= card_mods { mod&.spec&.dependencies }
|
132
132
|
end
|
133
133
|
|
134
134
|
def tasks
|
@@ -138,9 +138,7 @@ end
|
|
138
138
|
def settings
|
139
139
|
return unless admin_config
|
140
140
|
|
141
|
-
admin_config["settings"]&.map
|
142
|
-
setting.to_sym
|
143
|
-
end
|
141
|
+
admin_config["settings"]&.map(&:to_sym)
|
144
142
|
end
|
145
143
|
|
146
144
|
def configurations
|
@@ -162,12 +160,9 @@ def views
|
|
162
160
|
end
|
163
161
|
|
164
162
|
def description
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
mod&.spec&.summary
|
169
|
-
end
|
170
|
-
t("#{modname}_mod_description", default: default)
|
163
|
+
spec = mod&.spec
|
164
|
+
default = spec&.description.present? ? spec&.description : spec&.summary
|
165
|
+
t "#{modname}_mod_description", default: default
|
171
166
|
end
|
172
167
|
|
173
168
|
def modname
|
@@ -205,8 +200,10 @@ end
|
|
205
200
|
|
206
201
|
def load_admin_config
|
207
202
|
return unless admin_config_exists?
|
203
|
+
|
208
204
|
admin_config = YAML.load_file admin_config_path
|
209
205
|
return {} unless admin_config # blank manifest
|
206
|
+
|
210
207
|
# validate_manifest manifest
|
211
208
|
admin_config
|
212
209
|
end
|
@@ -222,6 +219,12 @@ end
|
|
222
219
|
|
223
220
|
private
|
224
221
|
|
222
|
+
def card_mods
|
223
|
+
yield&.map(&:name)
|
224
|
+
&.select { |name| name.starts_with? "card-mod" }
|
225
|
+
&.map { |name| "mod_#{name[8..]}" }
|
226
|
+
end
|
227
|
+
|
225
228
|
def read_admin_yml
|
226
|
-
YAML.
|
229
|
+
YAML.safe_load_file filename, permitted_classes: [Symbol] if File.exist? filename
|
227
230
|
end
|
@@ -12,7 +12,7 @@ RSpec.describe Card::Set::All::Trash do
|
|
12
12
|
it "deletes account of user", as_bot: true do
|
13
13
|
expect(Card["Sample User", :account]).to be_a Card
|
14
14
|
Card["Sample User"].delete!
|
15
|
-
expect(Card["Sample User", :account]).
|
15
|
+
expect(Card["Sample User", :account]).to be_nil
|
16
16
|
end
|
17
17
|
|
18
18
|
describe "event: validate_delete" do
|
@@ -98,15 +98,15 @@ RSpec.describe Card::Set::All::Trash do
|
|
98
98
|
create! "#{book1}+value"
|
99
99
|
create! "#{book2}+value"
|
100
100
|
|
101
|
-
expect(Card["CA"]).to
|
101
|
+
expect(Card["CA"]).to be_truthy
|
102
102
|
|
103
103
|
Card["CA"].delete!
|
104
104
|
|
105
|
-
expect(Card["CA"]).
|
106
|
-
expect(Card[book1]).
|
107
|
-
expect(Card["#{book1}+value"]).
|
108
|
-
expect(Card[book2]).
|
109
|
-
expect(Card["#{book2}+value"]).
|
105
|
+
expect(Card["CA"]).to be_nil
|
106
|
+
expect(Card[book1]).to be_nil
|
107
|
+
expect(Card["#{book1}+value"]).to be_nil
|
108
|
+
expect(Card[book2]).to be_nil
|
109
|
+
expect(Card["#{book2}+value"]).to be_nil
|
110
110
|
end
|
111
111
|
|
112
112
|
it "handles compound cards", as_bot: true do
|