card 1.107.0 → 1.108.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/config/environments/development.rb +1 -9
- data/config/environments/test.rb +4 -4
- data/config/initializers/01_core_extensions/integer.rb +13 -0
- data/config/initializers/01_core_extensions/{persistent_identifiers.rb → persistent_identifier.rb} +0 -5
- data/config/initializers/01_core_extensions/symbol.rb +11 -0
- data/config/initializers/core_extensions.rb +2 -2
- data/db/schema.rb +9 -5
- data/lib/card/auth/token.rb +1 -1
- data/lib/card/cache/all.rb +30 -7
- data/lib/card/cache/card_class.rb +12 -6
- data/lib/card/cache/class_methods.rb +122 -0
- data/lib/card/cache/populate.rb +64 -0
- data/lib/card/cache/{persistent.rb → shared.rb} +22 -16
- data/lib/card/cache/{persistent_class.rb → shared_class.rb} +2 -2
- data/lib/card/cache/temporary.rb +40 -8
- data/lib/card/cache.rb +65 -130
- data/lib/card/codename.rb +66 -54
- data/lib/card/director/class_methods.rb +13 -13
- data/lib/card/director/stages.rb +1 -1
- data/lib/card/error.rb +8 -0
- data/lib/card/fetch/card_class.rb +5 -24
- data/lib/card/fetch/retrieve.rb +1 -1
- data/lib/card/fetch/store.rb +4 -18
- data/lib/card/format/nesting.rb +1 -1
- data/lib/card/format/registration.rb +15 -7
- data/lib/card/format/render.rb +16 -15
- data/lib/card/format.rb +11 -4
- data/lib/card/lexicon.rb +37 -23
- data/lib/card/mark.rb +2 -34
- data/lib/card/name/all.rb +3 -7
- data/lib/card/name/card_class.rb +2 -2
- data/lib/card/name/name_variants.rb +7 -1
- data/lib/card/name.rb +60 -12
- data/lib/card/query/card_class.rb +1 -1
- data/lib/card/query/card_query/match_attributes.rb +14 -4
- data/lib/card/query/card_query/relational_attributes.rb +2 -0
- data/lib/card/query/card_query/run.rb +9 -3
- data/lib/card/query/sql_statement.rb +1 -1
- data/lib/card/reference/all.rb +8 -3
- data/lib/card/reference.rb +4 -9
- data/lib/card/rule/cache.rb +2 -0
- data/lib/card/rule/read_rule_cache.rb +2 -0
- data/lib/card/set/event.rb +1 -4
- data/lib/card/set/format/abstract_format/view_opts.rb +1 -1
- data/lib/card/set/format/abstract_format.rb +20 -3
- data/lib/card/set/inheritance.rb +2 -3
- data/lib/card/set/pattern/all.rb +12 -0
- data/lib/card/subcards/add.rb +1 -1
- data/lib/card/subcards/remove.rb +1 -1
- data/lib/card/view/cache/cache_action.rb +24 -7
- data/lib/card/view/cache.rb +34 -6
- data/lib/card/view/options/voo_api.rb +1 -1
- data/lib/card/view.rb +1 -0
- data/lib/cardio/cli.rb +1 -1
- data/lib/cardio/command/rake_command.rb +10 -2
- data/lib/cardio/command/rspec_command/parser.rb +9 -11
- data/lib/cardio/command/rspec_command.rb +7 -3
- data/lib/cardio/generators/deck_helper.rb +7 -7
- data/lib/cardio/migration/port.rb +37 -0
- data/lib/cardio/migration.rb +5 -36
- data/lib/cardio/mod/class_methods.rb +1 -0
- data/lib/cardio/mod.rb +1 -1
- data/lib/cardio/railtie.rb +5 -4
- data/lib/cardio/utils.rb +1 -1
- data/lib/generators/deck/deck_generator.rb +5 -11
- data/lib/generators/deck/templates/Gemfile.erb +2 -2
- data/lib/generators/deck/templates/config/puma.rb +0 -6
- data/lib/generators/mod/mod_generator.rb +7 -0
- data/lib/generators/set/set_generator.rb +2 -1
- data/mod/core/config/locales/en.yml +1 -0
- data/mod/core/data/schema/20200805200729_add_unique_pair_indices.rb +1 -1
- data/mod/core/data/schema/20240628212556_add_trash_index.rb +11 -0
- data/mod/core/data/schema/20241017160402_unique_codename.rb +13 -0
- data/mod/core/data/transform/20140317035504_account_requests_to_signups.rb +4 -6
- data/mod/core/data/transform/20150724123438_update_file_and_image_cards.rb +1 -1
- data/mod/core/data/transform/20190320091257_upgrade_recaptcha_to_v3.rb +3 -3
- data/mod/core/data/transform/20190502130029_add_shark_and_help_desk_role.rb +1 -1
- data/mod/core/data/transform/20190822093633_move_help_text_to_code.rb +2 -2
- data/mod/core/data/transform/20190829205148_remove_add_help.rb +1 -1
- data/mod/core/lib/tasks/card/migrate.rake +6 -5
- data/mod/core/lib/tasks/card/mod.rake +3 -0
- data/mod/core/lib/tasks/card/seed.rake +1 -0
- data/mod/core/lib/tasks/card.rake +6 -2
- data/mod/core/set/all/autoname.rb +1 -1
- data/mod/core/set/all/codename.rb +6 -8
- data/mod/core/set/all/name_events.rb +7 -5
- data/mod/core/set/all/result.rb +1 -1
- data/mod/core/set/all/trash.rb +2 -4
- data/mod/core/set/all/type.rb +1 -1
- data/mod/core/set/self/mod.rb +1 -1
- data/mod/core/set/self/trash.rb +1 -1
- data/mod/core/spec/set/all/trash_spec.rb +3 -3
- metadata +29 -23
- data/lib/card/cache/prepopulate.rb +0 -48
@@ -3,7 +3,7 @@
|
|
3
3
|
class AccountRequestsToSignups < Cardio::Migration::Transform
|
4
4
|
def up
|
5
5
|
newname = "Sign up"
|
6
|
-
newname = "*signup" if Card.
|
6
|
+
newname = "*signup" if Card.exist? newname
|
7
7
|
|
8
8
|
# get old codename and name out of the way
|
9
9
|
old_signup = Card[:signup]
|
@@ -18,9 +18,8 @@ class AccountRequestsToSignups < Cardio::Migration::Transform
|
|
18
18
|
new_signup.save!
|
19
19
|
|
20
20
|
# move old "*signup+*thanks" to "Sign up+*type+*thanks"
|
21
|
-
|
22
|
-
|
23
|
-
signup_thanks.name = "#{new_signup.name}+#{Card[:type].name}+#{thanks.name}"
|
21
|
+
if (signup_thanks = [old_signup, :thanks].card)
|
22
|
+
signup_thanks.name = [new_signup, :type, :thanks].cardname
|
24
23
|
signup_thanks.save!
|
25
24
|
end
|
26
25
|
|
@@ -28,8 +27,7 @@ class AccountRequestsToSignups < Cardio::Migration::Transform
|
|
28
27
|
old_signup.delete! unless Card.search(return: :id, left_id: old_signup.id).first
|
29
28
|
|
30
29
|
# turn captcha off by default on signup
|
31
|
-
|
32
|
-
captcha_rule = Card.fetch rulename, new: {}
|
30
|
+
captcha_rule = Card.fetch %i[signup type captcha].cardname, new: {}
|
33
31
|
captcha_rule.content = "0"
|
34
32
|
captcha_rule.save!
|
35
33
|
end
|
@@ -76,7 +76,7 @@ class UpdateFileAndImageCards < Cardio::Migration::Transform
|
|
76
76
|
journal_skin lumen_skin paper_skin readable_skin sandstone_skin
|
77
77
|
simplex_skin slate_skin spacelab_skin superhero_skin united_skin
|
78
78
|
yeti_skin].each do |name|
|
79
|
-
next unless (Card::Codename.
|
79
|
+
next unless (Card::Codename.exist?(name) && (card = name.to_sym.card))
|
80
80
|
|
81
81
|
card.update! codename: nil
|
82
82
|
if (card = Card.fetch name, :image)
|
@@ -15,12 +15,12 @@ class UpgradeRecaptchaToV3 < Cardio::Migration::Transform
|
|
15
15
|
next unless Card::Codename[codename]
|
16
16
|
|
17
17
|
update_card! codename,
|
18
|
-
name:
|
18
|
+
name: [:recaptcha_settings, "#{new_name} key"].cardname,
|
19
19
|
codename: "recaptcha_#{new_name}_key"
|
20
20
|
end
|
21
21
|
|
22
|
-
Card.ensure name: [
|
22
|
+
Card.ensure name: [:recaptcha_settings, "minimum score"].cardname,
|
23
23
|
codename: "recaptcha_minimum_score",
|
24
|
-
|
24
|
+
type: :number
|
25
25
|
end
|
26
26
|
end
|
@@ -28,7 +28,7 @@ class AddSharkAndHelpDeskRole < Cardio::Migration::Transform
|
|
28
28
|
|
29
29
|
def delete_right_read_permissions
|
30
30
|
%i[machine_output head script style solid_cache].each do |n|
|
31
|
-
next unless Card::Codename.
|
31
|
+
next unless Card::Codename.exist? n
|
32
32
|
delete_card [n, :right, :read]
|
33
33
|
end
|
34
34
|
end
|
@@ -17,7 +17,7 @@ class MoveHelpTextToCode < Cardio::Migration::Transform
|
|
17
17
|
def remove_search_help_rules
|
18
18
|
%i[created edited children includes refers_to links_to included_by linked_to_by
|
19
19
|
referred_to_by mates editors follow].each do |trait|
|
20
|
-
next unless Card::Codename.
|
20
|
+
next unless Card::Codename.exist? trait
|
21
21
|
delete_card [trait, :right, :help]
|
22
22
|
end
|
23
23
|
end
|
@@ -32,7 +32,7 @@ class MoveHelpTextToCode < Cardio::Migration::Transform
|
|
32
32
|
|
33
33
|
def remove_self_help_rules *anchors
|
34
34
|
anchors.each do |a|
|
35
|
-
next unless Card::Codename.
|
35
|
+
next unless Card::Codename.exist? a
|
36
36
|
delete_card [a, :self, :help]
|
37
37
|
end
|
38
38
|
end
|
@@ -4,7 +4,7 @@ class RemoveAddHelp < Cardio::Migration::Transform
|
|
4
4
|
def up
|
5
5
|
Card.search(right: { codename: "add_help" },
|
6
6
|
left: { type_id: Card::SetID }).each do |card|
|
7
|
-
next if Card.
|
7
|
+
next if Card.exist? [card.left, :help]
|
8
8
|
|
9
9
|
Card.ensure name: [card.left, :help], content: card.content
|
10
10
|
end
|
@@ -15,10 +15,7 @@ namespace :card do
|
|
15
15
|
puts "running schema migrations"
|
16
16
|
|
17
17
|
interpret_env_schema
|
18
|
-
without_dumping
|
19
|
-
run_migration :schema
|
20
|
-
end
|
21
|
-
Rake::Task["db:_dump"].invoke # write schema.rb
|
18
|
+
without_dumping { run_migration :schema }
|
22
19
|
reset_column_information true
|
23
20
|
end
|
24
21
|
|
@@ -49,10 +46,12 @@ namespace :card do
|
|
49
46
|
end
|
50
47
|
|
51
48
|
task port: :environment do
|
49
|
+
puts "porting"
|
52
50
|
Cardio::Migration.port_all
|
53
51
|
end
|
54
52
|
|
55
53
|
task recode: :environment do
|
54
|
+
puts "recoding"
|
56
55
|
Cardio::Mod.dirs.subpaths("data", "recode.yml").each_value do |path|
|
57
56
|
YAML.load_file(path).each do |oldcode, newcode|
|
58
57
|
Card::Codename.recode oldcode, newcode
|
@@ -114,6 +113,8 @@ def load_mod_lib
|
|
114
113
|
end
|
115
114
|
|
116
115
|
def without_dumping
|
117
|
-
|
116
|
+
unless ENV["DECKO_DUMP_SCHEMA"] == "true"
|
117
|
+
ActiveRecord.dump_schema_after_migration = false
|
118
|
+
end
|
118
119
|
yield
|
119
120
|
end
|
@@ -23,11 +23,14 @@ namespace :card do
|
|
23
23
|
|
24
24
|
desc "uninstall leftover mods"
|
25
25
|
task uninstall: :environment do
|
26
|
+
puts "uninstalling unconfigured mods"
|
26
27
|
Cardio::Mod.ensure_uninstalled
|
27
28
|
end
|
28
29
|
|
29
30
|
desc "install all mods"
|
30
31
|
task install: :environment do
|
32
|
+
puts "installing mods"
|
33
|
+
Card::Auth.signin :wagn_bot.card
|
31
34
|
# Cardio.config.compress_assets = true # should not be here, imo #efm
|
32
35
|
Cardio::Mod.ensure_installed
|
33
36
|
end
|
@@ -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]
|
@@ -13,8 +13,7 @@ namespace :card do
|
|
13
13
|
ENV["NO_RAILS_CACHE"] = "true"
|
14
14
|
# Benchmark.bm do |x|
|
15
15
|
["migrate:port", "migrate:schema", "migrate:recode", :eat, "migrate:transform",
|
16
|
-
:reset
|
17
|
-
"mod:uninstall", "mod:install", "mod:symlink"].each do |task|
|
16
|
+
"mod:uninstall", "mod:install", "mod:symlink", :reset].each do |task|
|
18
17
|
Rake::Task["card:#{task}"].invoke
|
19
18
|
end
|
20
19
|
end
|
@@ -22,6 +21,7 @@ namespace :card do
|
|
22
21
|
|
23
22
|
desc "Ingests card data from mod yaml"
|
24
23
|
task eat: :environment do
|
24
|
+
puts "eating"
|
25
25
|
parse_options :eat do
|
26
26
|
add_opt :m, :mod, "only eat cards in given mod"
|
27
27
|
add_opt :n, :name, "only eat card with name (handles : for codenames)"
|
@@ -48,6 +48,7 @@ namespace :card do
|
|
48
48
|
|
49
49
|
desc "Exports card data to mod yaml"
|
50
50
|
task sow: :environment do
|
51
|
+
puts "sowing"
|
51
52
|
parse_options :sow do
|
52
53
|
add_opt :n, :name, "export card with name/mark (handles : and ~ prefixes)"
|
53
54
|
flag_opt :i, :items, "also export card items (with -n)"
|
@@ -66,6 +67,9 @@ namespace :card do
|
|
66
67
|
|
67
68
|
desc "Clears both cache and tmpfiles"
|
68
69
|
task reset: :environment do
|
70
|
+
puts "resetting"
|
71
|
+
Card::Cache.shared_on!
|
72
|
+
|
69
73
|
parse_options :reset do
|
70
74
|
flag_opt :c, :cache, "cache only"
|
71
75
|
flag_opt :t, :tmpfiles, "tmpfiles only"
|
@@ -1,11 +1,3 @@
|
|
1
|
-
def codename
|
2
|
-
super&.to_sym
|
3
|
-
end
|
4
|
-
|
5
|
-
def codename?
|
6
|
-
codename.present?
|
7
|
-
end
|
8
|
-
|
9
1
|
event :validate_codename, :validate, on: :update, changed: :codename do
|
10
2
|
validate_codename_permission
|
11
3
|
validate_codename_uniqueness
|
@@ -20,6 +12,12 @@ end
|
|
20
12
|
|
21
13
|
private
|
22
14
|
|
15
|
+
def validate_codename_characters
|
16
|
+
return unless codename.to_s.match?(/[^a-z_]/)
|
17
|
+
|
18
|
+
errors.add :codename, t(:core_error_codename_special_characters)
|
19
|
+
end
|
20
|
+
|
23
21
|
def validate_codename_permission
|
24
22
|
return if Auth.always_ok? || Auth.as_id == creator_id
|
25
23
|
|
@@ -4,13 +4,13 @@ event :validate_name, :validate, on: :save, changed: :name, when: :no_autoname?
|
|
4
4
|
validate_legality_of_name
|
5
5
|
return if errors.any?
|
6
6
|
|
7
|
-
Card.
|
7
|
+
Card.write_to_temp_cache self
|
8
8
|
validate_uniqueness_of_name
|
9
9
|
end
|
10
10
|
|
11
11
|
# called by validate_name
|
12
12
|
event :validate_uniqueness_of_name, skip: :allowed do
|
13
|
-
return unless (existing_id =
|
13
|
+
return unless (existing_id = Lexicon.id key) && existing_id != id
|
14
14
|
# The above is a fast check but cannot detect if card is in trash
|
15
15
|
|
16
16
|
# TODO: perform the following as a remote-only fetch (not yet supported)
|
@@ -71,9 +71,11 @@ event :prepare_left_and_right, :store, changed: :name, on: :save do
|
|
71
71
|
prepare_side :right
|
72
72
|
end
|
73
73
|
|
74
|
-
|
75
|
-
|
76
|
-
|
74
|
+
# as soon as the name has an id, we have to update the lexicon.
|
75
|
+
# (the after_store callbacks are called _right_ after the storage)
|
76
|
+
event :update_lexicon, :store, changed: :name do
|
77
|
+
lexicon_action = @action == :create ? :add : @action
|
78
|
+
director.after_store { |card| Lexicon.send lexicon_action, card }
|
77
79
|
end
|
78
80
|
|
79
81
|
protected
|
data/mod/core/set/all/result.rb
CHANGED
data/mod/core/set/all/trash.rb
CHANGED
@@ -57,10 +57,8 @@ event :delete_children, after: :validate_delete, on: :delete do
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def pull_from_trash!
|
60
|
-
|
61
|
-
return unless (trashed_card = Card.where(
|
62
|
-
|
63
|
-
# confirm name is actually in trash
|
60
|
+
query = Lexicon.lex_query(lex).merge trash: true
|
61
|
+
return unless (trashed_card = Card.where(query).take)
|
64
62
|
|
65
63
|
db_attributes["id"] = trashed_card.db_attributes["id"]
|
66
64
|
# id_in_database returns existing card id
|
data/mod/core/set/all/type.rb
CHANGED
data/mod/core/set/self/mod.rb
CHANGED
@@ -28,7 +28,7 @@ format :html do
|
|
28
28
|
content_tag(:h1, "Roles"),
|
29
29
|
card.all_admin_configs_grouped_by(:roles, :category).map do |(role, configs_by_cat)|
|
30
30
|
output [
|
31
|
-
content_tag(:h2,
|
31
|
+
content_tag(:h2, role.to_sym.cardname),
|
32
32
|
(configs_by_cat.map do |(cat, configs)|
|
33
33
|
list_section cat, configs.map(&:codename)
|
34
34
|
end)
|
data/mod/core/set/self/trash.rb
CHANGED
@@ -73,7 +73,7 @@ RSpec.describe Card::Set::All::Trash do
|
|
73
73
|
create! "born to die"
|
74
74
|
create! "born to die+slowly"
|
75
75
|
create! "slowly+born to die"
|
76
|
-
create! "born to die+slowly+without regrets"
|
76
|
+
bsw = create! "born to die+slowly+without regrets"
|
77
77
|
|
78
78
|
Card["born to die"].delete!
|
79
79
|
|
@@ -84,8 +84,8 @@ RSpec.describe Card::Set::All::Trash do
|
|
84
84
|
expect(Card["slowly"]).to be_a Card
|
85
85
|
expect(Card["without regrets"]).to be_a Card
|
86
86
|
|
87
|
-
|
88
|
-
expect(
|
87
|
+
trashed_dependent = Card.find bsw.id
|
88
|
+
expect(trashed_dependent.trash).to be_truthy
|
89
89
|
end
|
90
90
|
|
91
91
|
# TODO: explain what this adds to testing above or remove test.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: card
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.108.1
|
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: 2024-
|
13
|
+
date: 2024-11-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: cardname
|
@@ -18,14 +18,14 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.
|
21
|
+
version: 0.18.1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - '='
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 0.
|
28
|
+
version: 0.18.1
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: rake
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -270,98 +270,98 @@ dependencies:
|
|
270
270
|
requirements:
|
271
271
|
- - "~>"
|
272
272
|
- !ruby/object:Gem::Version
|
273
|
-
version:
|
273
|
+
version: '7.1'
|
274
274
|
type: :runtime
|
275
275
|
prerelease: false
|
276
276
|
version_requirements: !ruby/object:Gem::Requirement
|
277
277
|
requirements:
|
278
278
|
- - "~>"
|
279
279
|
- !ruby/object:Gem::Version
|
280
|
-
version:
|
280
|
+
version: '7.1'
|
281
281
|
- !ruby/object:Gem::Dependency
|
282
282
|
name: activestorage
|
283
283
|
requirement: !ruby/object:Gem::Requirement
|
284
284
|
requirements:
|
285
285
|
- - "~>"
|
286
286
|
- !ruby/object:Gem::Version
|
287
|
-
version:
|
287
|
+
version: '7.1'
|
288
288
|
type: :runtime
|
289
289
|
prerelease: false
|
290
290
|
version_requirements: !ruby/object:Gem::Requirement
|
291
291
|
requirements:
|
292
292
|
- - "~>"
|
293
293
|
- !ruby/object:Gem::Version
|
294
|
-
version:
|
294
|
+
version: '7.1'
|
295
295
|
- !ruby/object:Gem::Dependency
|
296
296
|
name: actionview
|
297
297
|
requirement: !ruby/object:Gem::Requirement
|
298
298
|
requirements:
|
299
299
|
- - "~>"
|
300
300
|
- !ruby/object:Gem::Version
|
301
|
-
version:
|
301
|
+
version: '7.1'
|
302
302
|
type: :runtime
|
303
303
|
prerelease: false
|
304
304
|
version_requirements: !ruby/object:Gem::Requirement
|
305
305
|
requirements:
|
306
306
|
- - "~>"
|
307
307
|
- !ruby/object:Gem::Version
|
308
|
-
version:
|
308
|
+
version: '7.1'
|
309
309
|
- !ruby/object:Gem::Dependency
|
310
310
|
name: actionmailer
|
311
311
|
requirement: !ruby/object:Gem::Requirement
|
312
312
|
requirements:
|
313
313
|
- - "~>"
|
314
314
|
- !ruby/object:Gem::Version
|
315
|
-
version:
|
315
|
+
version: '7.1'
|
316
316
|
type: :runtime
|
317
317
|
prerelease: false
|
318
318
|
version_requirements: !ruby/object:Gem::Requirement
|
319
319
|
requirements:
|
320
320
|
- - "~>"
|
321
321
|
- !ruby/object:Gem::Version
|
322
|
-
version:
|
322
|
+
version: '7.1'
|
323
323
|
- !ruby/object:Gem::Dependency
|
324
324
|
name: activejob
|
325
325
|
requirement: !ruby/object:Gem::Requirement
|
326
326
|
requirements:
|
327
327
|
- - "~>"
|
328
328
|
- !ruby/object:Gem::Version
|
329
|
-
version:
|
329
|
+
version: '7.1'
|
330
330
|
type: :runtime
|
331
331
|
prerelease: false
|
332
332
|
version_requirements: !ruby/object:Gem::Requirement
|
333
333
|
requirements:
|
334
334
|
- - "~>"
|
335
335
|
- !ruby/object:Gem::Version
|
336
|
-
version:
|
336
|
+
version: '7.1'
|
337
337
|
- !ruby/object:Gem::Dependency
|
338
338
|
name: actionmailbox
|
339
339
|
requirement: !ruby/object:Gem::Requirement
|
340
340
|
requirements:
|
341
341
|
- - "~>"
|
342
342
|
- !ruby/object:Gem::Version
|
343
|
-
version:
|
343
|
+
version: '7.1'
|
344
344
|
type: :runtime
|
345
345
|
prerelease: false
|
346
346
|
version_requirements: !ruby/object:Gem::Requirement
|
347
347
|
requirements:
|
348
348
|
- - "~>"
|
349
349
|
- !ruby/object:Gem::Version
|
350
|
-
version:
|
350
|
+
version: '7.1'
|
351
351
|
- !ruby/object:Gem::Dependency
|
352
352
|
name: railties
|
353
353
|
requirement: !ruby/object:Gem::Requirement
|
354
354
|
requirements:
|
355
355
|
- - "~>"
|
356
356
|
- !ruby/object:Gem::Version
|
357
|
-
version:
|
357
|
+
version: '7.1'
|
358
358
|
type: :runtime
|
359
359
|
prerelease: false
|
360
360
|
version_requirements: !ruby/object:Gem::Requirement
|
361
361
|
requirements:
|
362
362
|
- - "~>"
|
363
363
|
- !ruby/object:Gem::Version
|
364
|
-
version:
|
364
|
+
version: '7.1'
|
365
365
|
description: Cards are wiki-inspired data atoms.Card "Sharks" use links, nests, types,
|
366
366
|
patterned names, queries, views, events, and rules to create rich structures.
|
367
367
|
email:
|
@@ -383,12 +383,14 @@ files:
|
|
383
383
|
- config/i18n-tasks.yml
|
384
384
|
- config/initializers/01_core_extensions/array.rb
|
385
385
|
- config/initializers/01_core_extensions/hash.rb
|
386
|
+
- config/initializers/01_core_extensions/integer.rb
|
386
387
|
- config/initializers/01_core_extensions/kernel.rb
|
387
388
|
- config/initializers/01_core_extensions/match_data.rb
|
388
389
|
- config/initializers/01_core_extensions/module.rb
|
389
390
|
- config/initializers/01_core_extensions/object.rb
|
390
|
-
- config/initializers/01_core_extensions/
|
391
|
+
- config/initializers/01_core_extensions/persistent_identifier.rb
|
391
392
|
- config/initializers/01_core_extensions/string.rb
|
393
|
+
- config/initializers/01_core_extensions/symbol.rb
|
392
394
|
- config/initializers/02_patches/active_job.rb
|
393
395
|
- config/initializers/02_patches/active_record.rb
|
394
396
|
- config/initializers/02_patches/active_support.rb
|
@@ -420,9 +422,10 @@ files:
|
|
420
422
|
- lib/card/cache.rb
|
421
423
|
- lib/card/cache/all.rb
|
422
424
|
- lib/card/cache/card_class.rb
|
423
|
-
- lib/card/cache/
|
424
|
-
- lib/card/cache/
|
425
|
-
- lib/card/cache/
|
425
|
+
- lib/card/cache/class_methods.rb
|
426
|
+
- lib/card/cache/populate.rb
|
427
|
+
- lib/card/cache/shared.rb
|
428
|
+
- lib/card/cache/shared_class.rb
|
426
429
|
- lib/card/cache/temporary.rb
|
427
430
|
- lib/card/codename.rb
|
428
431
|
- lib/card/content.rb
|
@@ -594,6 +597,7 @@ files:
|
|
594
597
|
- lib/cardio/job.rb
|
595
598
|
- lib/cardio/migration.rb
|
596
599
|
- lib/cardio/migration/assumption.rb
|
600
|
+
- lib/cardio/migration/port.rb
|
597
601
|
- lib/cardio/migration/schema.rb
|
598
602
|
- lib/cardio/migration/stamp.rb
|
599
603
|
- lib/cardio/migration/transform.rb
|
@@ -710,6 +714,8 @@ files:
|
|
710
714
|
- mod/core/data/schema/20200805200729_add_unique_pair_indices.rb
|
711
715
|
- mod/core/data/schema/20211128040849_virtuals_updated_at.rb
|
712
716
|
- mod/core/data/schema/20221031182227_remove_referee_key_requirement.rb
|
717
|
+
- mod/core/data/schema/20240628212556_add_trash_index.rb
|
718
|
+
- mod/core/data/schema/20241017160402_unique_codename.rb
|
713
719
|
- mod/core/data/test.yml
|
714
720
|
- mod/core/data/test/cardtype.yml
|
715
721
|
- mod/core/data/test/sample.yml
|
@@ -803,7 +809,7 @@ files:
|
|
803
809
|
- mod/core/spec/shared_examples/mod_admin_config.rb
|
804
810
|
homepage: https://decko.org
|
805
811
|
licenses:
|
806
|
-
- GPL-3.0
|
812
|
+
- GPL-3.0-or-later
|
807
813
|
metadata:
|
808
814
|
source_code_uri: https://github.com/decko-commons/decko
|
809
815
|
homepage_uri: https://decko.org
|
@@ -1,48 +0,0 @@
|
|
1
|
-
class Card
|
2
|
-
class Cache
|
3
|
-
# pre-populate cache for testing purposes
|
4
|
-
module Prepopulate
|
5
|
-
def restore
|
6
|
-
reset_soft
|
7
|
-
prepopulate
|
8
|
-
end
|
9
|
-
|
10
|
-
private
|
11
|
-
|
12
|
-
def prepopulate?
|
13
|
-
Cardio.config.prepopulate_cache
|
14
|
-
end
|
15
|
-
|
16
|
-
def prepopulate
|
17
|
-
return unless prepopulate?
|
18
|
-
|
19
|
-
prepopulate_rule_caches
|
20
|
-
# prepopulate_lexicon_caches
|
21
|
-
end
|
22
|
-
|
23
|
-
def prepopulate_cache variable
|
24
|
-
@prepopulated ||= {}
|
25
|
-
value = @prepopulated[variable] ||= yield
|
26
|
-
Card.cache.soft.write variable, value.clone
|
27
|
-
end
|
28
|
-
|
29
|
-
# def prepopulate_lexicon_caches
|
30
|
-
# end
|
31
|
-
|
32
|
-
def prepopulate_rule_caches
|
33
|
-
prepopulate_cache("RULES") { Card::Rule.rule_cache }
|
34
|
-
prepopulate_cache("READRULES") { Card::Rule.read_rule_cache }
|
35
|
-
prepopulate_cache("PREFERENCES") { Card::Rule.preference_cache }
|
36
|
-
end
|
37
|
-
|
38
|
-
# def prepopulate_card_cache
|
39
|
-
# prepopulate_cache "ALL_CARDS" do
|
40
|
-
# Card.find_each do |card|
|
41
|
-
# Card.write_to_cache card
|
42
|
-
# end
|
43
|
-
# true
|
44
|
-
# end
|
45
|
-
# end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|