card 1.16.1 → 1.16.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardoc/checksums +60 -0
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/.yardopts +6 -0
- data/README_Developers.rdoc +100 -0
- data/VERSION +1 -1
- data/card.gemspec +18 -18
- data/db/migrate/20150724210803_add_comment_to_actions.rb +5 -0
- data/db/migrate_core_cards/20150724123438_update_file_and_image_cards.rb +70 -0
- data/db/migrate_core_cards/20150807205221_create_references_for_search_cards.rb +10 -0
- data/db/migrate_core_cards/data/1.12_stylesheets/common.scss +4 -2
- data/db/schema.rb +2 -1
- data/db/seed/new/card_actions.yml +2334 -12538
- data/db/seed/new/card_acts.yml +1 -1
- data/db/seed/new/card_changes.yml +7384 -38929
- data/db/seed/new/card_references.yml +207 -207
- data/db/seed/new/cards.yml +1364 -1440
- data/db/seed/test/fixtures/card_actions.yml +3285 -13219
- data/db/seed/test/fixtures/card_acts.yml +107 -107
- data/db/seed/test/fixtures/card_changes.yml +10830 -42375
- data/db/seed/test/fixtures/card_references.yml +393 -393
- data/db/seed/test/fixtures/cards.yml +1701 -1777
- data/db/version.txt +1 -1
- data/db/version_core_cards.txt +1 -1
- data/lib/card.rb +13 -3
- data/lib/card/chunk.rb +22 -15
- data/lib/card/content.rb +9 -8
- data/lib/card/diff.rb +79 -79
- data/lib/card/loader.rb +33 -33
- data/lib/card/name.rb +8 -0
- data/lib/card/set.rb +44 -17
- data/lib/card/set_pattern.rb +8 -0
- data/lib/cardio.rb +19 -3
- data/mod/01_core/chunk/link.rb +7 -6
- data/mod/01_core/chunk/query_reference.rb +65 -0
- data/mod/01_core/set/all/content.rb +1 -1
- data/mod/01_core/set/all/fetch.rb +15 -7
- data/mod/01_core/set/all/initialize.rb +4 -3
- data/mod/01_core/set/all/phases.rb +12 -8
- data/mod/01_core/set/all/references.rb +12 -6
- data/mod/01_core/set/all/rules.rb +14 -11
- data/mod/01_core/set/all/states.rb +2 -1
- data/mod/01_core/set/all/tracked_attributes.rb +14 -0
- data/mod/01_core/spec/set/all/collection_spec.rb +5 -5
- data/mod/01_core/spec/set/all/name_spec.rb +6 -6
- data/mod/01_history/lib/card/act.rb +2 -2
- data/mod/01_history/lib/card/action.rb +11 -2
- data/mod/01_history/set/all/actions.rb +4 -3
- data/mod/01_history/set/all/content_history.rb +1 -1
- data/mod/01_history/set/all/history.rb +55 -66
- data/mod/02_basic_types/set/all/file.rb +26 -3
- data/mod/02_basic_types/set/type/pointer.rb +13 -14
- data/mod/02_basic_types/spec/set/all/file_spec.rb +0 -1
- data/mod/03_machines/lib/card/machine.rb +4 -4
- data/mod/03_machines/lib/javascript/wagn_mod.js.coffee +4 -17
- data/mod/03_machines/lib/stylesheets/style_cards.scss +5 -0
- data/mod/03_machines/set/right/machine_input.rb +3 -0
- data/mod/03_machines/set/right/machine_output.rb +4 -0
- data/mod/04_settings/lib/card/setting.rb +2 -1
- data/mod/04_settings/set/abstract/permission.rb +95 -0
- data/mod/04_settings/set/right/comment.rb +2 -90
- data/mod/04_settings/set/right/create.rb +2 -2
- data/mod/04_settings/set/right/delete.rb +2 -3
- data/mod/04_settings/set/right/read.rb +3 -2
- data/mod/04_settings/set/right/update.rb +3 -2
- data/mod/04_settings/set/self/recent_settings.rb +3 -0
- data/mod/04_settings/set/type/setting.rb +9 -1
- data/mod/05_email/set/all/notify.rb +2 -1
- data/mod/05_email/set/type/email_template.rb +17 -17
- data/mod/05_standard/file/credit_image/image-icon.png +0 -0
- data/mod/05_standard/file/credit_image/image-large.png +0 -0
- data/mod/05_standard/file/credit_image/image-medium.png +0 -0
- data/mod/05_standard/file/credit_image/image-original.png +0 -0
- data/mod/05_standard/file/credit_image/image-small.png +0 -0
- data/mod/05_standard/file/favicon/{icon-image.png → image-icon.png} +0 -0
- data/mod/05_standard/file/favicon/{large-image.png → image-large.png} +0 -0
- data/mod/05_standard/file/favicon/{medium-image.png → image-medium.png} +0 -0
- data/mod/05_standard/file/favicon/{original-image.png → image-original.png} +0 -0
- data/mod/05_standard/file/favicon/{small-image.png → image-small.png} +0 -0
- data/mod/05_standard/file/logo/{icon-image.png → image-icon.png} +0 -0
- data/mod/05_standard/file/logo/{large-image.png → image-large.png} +0 -0
- data/mod/05_standard/file/logo/{medium-image.png → image-medium.png} +0 -0
- data/mod/05_standard/file/logo/{original-image.png → image-original.png} +0 -0
- data/mod/05_standard/file/logo/{small-image.png → image-small.png} +0 -0
- data/mod/05_standard/lib/carrier_wave/cardmount.rb +79 -0
- data/mod/05_standard/lib/file_uploader.rb +127 -0
- data/mod/05_standard/lib/image_uploader.rb +35 -0
- data/mod/05_standard/set/abstract/attachment.rb +85 -0
- data/mod/05_standard/set/all/error.rb +1 -18
- data/mod/05_standard/set/all/event_viz.rb +17 -14
- data/mod/05_standard/set/all/rich_html/editing.rb +10 -10
- data/mod/05_standard/set/all/rich_html/toolbar.rb +44 -37
- data/mod/05_standard/set/right/account.rb +1 -1
- data/mod/05_standard/set/right/password.rb +9 -10
- data/mod/05_standard/set/self/recent.rb +1 -1
- data/mod/05_standard/set/type/file.rb +43 -31
- data/mod/05_standard/set/type/image.rb +22 -6
- data/mod/05_standard/set/type/search_type.rb +4 -2
- data/mod/05_standard/set/type/session.rb +7 -5
- data/mod/05_standard/set/type/set.rb +3 -1
- data/mod/05_standard/spec/set/all/history_spec.rb +1 -1
- data/mod/05_standard/spec/set/type/cardtype_spec.rb +3 -3
- data/mod/05_standard/spec/set/type/file_spec.rb +85 -1
- data/mod/05_standard/spec/set/type/image_spec.rb +89 -5
- data/mod/05_standard/spec/set/type/search_type_spec.rb +16 -1
- data/mod/06_bootstrap/file/{cerulean_skin/icon-image.png → cerulean_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{cerulean_skin/large-image.png → cerulean_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{cerulean_skin/medium-image.png → cerulean_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{cerulean_skin/original-image.png → cerulean_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{cerulean_skin/small-image.png → cerulean_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{cosmo_skin/icon-image.png → cosmo_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{cosmo_skin/large-image.png → cosmo_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{cosmo_skin/medium-image.png → cosmo_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{cosmo_skin/original-image.png → cosmo_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{cosmo_skin/small-image.png → cosmo_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{cyborg_skin/icon-image.png → cyborg_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{cyborg_skin/large-image.png → cyborg_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{cyborg_skin/medium-image.png → cyborg_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{cyborg_skin/original-image.png → cyborg_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{cyborg_skin/small-image.png → cyborg_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{darkly_skin/icon-image.png → darkly_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{darkly_skin/large-image.png → darkly_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{darkly_skin/medium-image.png → darkly_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{darkly_skin/original-image.png → darkly_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{darkly_skin/small-image.png → darkly_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{flatly_skin/icon-image.png → flatly_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{flatly_skin/large-image.png → flatly_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{flatly_skin/medium-image.png → flatly_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{flatly_skin/original-image.png → flatly_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{flatly_skin/small-image.png → flatly_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{journal_skin/icon-image.png → journal_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{journal_skin/large-image.png → journal_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{journal_skin/medium-image.png → journal_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{journal_skin/original-image.png → journal_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{journal_skin/small-image.png → journal_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{lumen_skin/icon-image.png → lumen_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{lumen_skin/large-image.png → lumen_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{lumen_skin/medium-image.png → lumen_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{lumen_skin/original-image.png → lumen_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{lumen_skin/small-image.png → lumen_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{paper_skin/icon-image.png → paper_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{paper_skin/large-image.png → paper_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{paper_skin/medium-image.png → paper_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{paper_skin/original-image.png → paper_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{paper_skin/small-image.png → paper_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{readable_skin/icon-image.png → readable_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{readable_skin/large-image.png → readable_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{readable_skin/medium-image.png → readable_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{readable_skin/original-image.png → readable_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{readable_skin/small-image.png → readable_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{sandstone_skin/icon-image.png → sandstone_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{sandstone_skin/large-image.png → sandstone_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{sandstone_skin/medium-image.png → sandstone_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{sandstone_skin/original-image.png → sandstone_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{sandstone_skin/small-image.png → sandstone_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{simplex_skin/icon-image.png → simplex_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{simplex_skin/large-image.png → simplex_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{simplex_skin/medium-image.png → simplex_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{simplex_skin/original-image.png → simplex_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{simplex_skin/small-image.png → simplex_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{slate_skin/icon-image.png → slate_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{slate_skin/large-image.png → slate_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{slate_skin/medium-image.png → slate_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{slate_skin/original-image.png → slate_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{slate_skin/small-image.png → slate_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{spacelab_skin/icon-image.png → spacelab_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{spacelab_skin/large-image.png → spacelab_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{spacelab_skin/medium-image.png → spacelab_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{spacelab_skin/original-image.png → spacelab_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{spacelab_skin/small-image.png → spacelab_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{superhero_skin/icon-image.png → superhero_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{superhero_skin/large-image.png → superhero_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{superhero_skin/medium-image.png → superhero_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{superhero_skin/original-image.png → superhero_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{superhero_skin/small-image.png → superhero_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{united_skin/icon-image.png → united_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{united_skin/large-image.png → united_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{united_skin/medium-image.png → united_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{united_skin/original-image.png → united_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{united_skin/small-image.png → united_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{yeti_skin/icon-image.png → yeti_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{yeti_skin/large-image.png → yeti_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{yeti_skin/medium-image.png → yeti_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{yeti_skin/original-image.png → yeti_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{yeti_skin/small-image.png → yeti_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/lib/stylesheets/bootstrap_cards.scss +5 -3
- data/spec/lib/card/reference_spec.rb +8 -1
- data/tmpsets/README.md +2 -0
- data/tmpsets/set/mod001-01_core/all/active_card.rb +40 -0
- data/tmpsets/set/mod001-01_core/all/collection.rb +348 -0
- data/tmpsets/set/mod001-01_core/all/content.rb +68 -0
- data/tmpsets/set/mod001-01_core/all/erb.rb +17 -0
- data/tmpsets/set/mod001-01_core/all/fetch.rb +242 -0
- data/tmpsets/set/mod001-01_core/all/haml.rb +13 -0
- data/tmpsets/set/mod001-01_core/all/initialize.rb +56 -0
- data/tmpsets/set/mod001-01_core/all/name.rb +279 -0
- data/tmpsets/set/mod001-01_core/all/pattern.rb +62 -0
- data/tmpsets/set/mod001-01_core/all/permissions.rb +289 -0
- data/tmpsets/set/mod001-01_core/all/phases.rb +187 -0
- data/tmpsets/set/mod001-01_core/all/references.rb +130 -0
- data/tmpsets/set/mod001-01_core/all/rules.rb +324 -0
- data/tmpsets/set/mod001-01_core/all/states.rb +28 -0
- data/tmpsets/set/mod001-01_core/all/templating.rb +132 -0
- data/tmpsets/set/mod001-01_core/all/tracked_attributes.rb +136 -0
- data/tmpsets/set/mod001-01_core/all/trash.rb +56 -0
- data/tmpsets/set/mod001-01_core/all/type.rb +91 -0
- data/tmpsets/set/mod001-01_core/all/utils.rb +162 -0
- data/tmpsets/set/mod001-01_core/all/view_cache.rb +14 -0
- data/tmpsets/set/mod002-01_history/all/actions.rb +54 -0
- data/tmpsets/set/mod002-01_history/all/content_history.rb +140 -0
- data/tmpsets/set/mod002-01_history/all/history.rb +341 -0
- data/tmpsets/set/mod003-02_basic_types/all/all_css.rb +48 -0
- data/tmpsets/set/mod003-02_basic_types/all/all_csv.rb +58 -0
- data/tmpsets/set/mod003-02_basic_types/all/all_js.rb +13 -0
- data/tmpsets/set/mod003-02_basic_types/all/base.rb +128 -0
- data/tmpsets/set/mod003-02_basic_types/all/file.rb +42 -0
- data/tmpsets/set/mod003-02_basic_types/all/json.rb +72 -0
- data/tmpsets/set/mod003-02_basic_types/all/rss.rb +78 -0
- data/tmpsets/set/mod003-02_basic_types/all/text.rb +14 -0
- data/tmpsets/set/mod003-02_basic_types/type/html.rb +33 -0
- data/tmpsets/set/mod003-02_basic_types/type/plain_text.rb +16 -0
- data/tmpsets/set/mod003-02_basic_types/type/pointer.rb +358 -0
- data/tmpsets/set/mod004-03_machines/right/machine_input.rb +8 -0
- data/tmpsets/set/mod004-03_machines/right/machine_output.rb +30 -0
- data/tmpsets/set/mod004-03_machines/self/script_ace.rb +18 -0
- data/tmpsets/set/mod004-03_machines/self/script_card_menu.rb +17 -0
- data/tmpsets/set/mod004-03_machines/self/script_html5shiv_printshiv.rb +8 -0
- data/tmpsets/set/mod004-03_machines/self/script_jquery.rb +8 -0
- data/tmpsets/set/mod004-03_machines/self/script_jquery_helper.rb +18 -0
- data/tmpsets/set/mod004-03_machines/self/script_slot.rb +13 -0
- data/tmpsets/set/mod004-03_machines/self/script_tinymce.rb +8 -0
- data/tmpsets/set/mod004-03_machines/self/style_bootstrap_compatible.rb +11 -0
- data/tmpsets/set/mod004-03_machines/self/style_cards.rb +12 -0
- data/tmpsets/set/mod004-03_machines/self/style_jquery_ui_smoothness.rb +9 -0
- data/tmpsets/set/mod004-03_machines/type/coffee_script.rb +67 -0
- data/tmpsets/set/mod004-03_machines/type/css.rb +55 -0
- data/tmpsets/set/mod004-03_machines/type/java_script.rb +43 -0
- data/tmpsets/set/mod004-03_machines/type/scss.rb +28 -0
- data/tmpsets/set/mod004-03_machines/type/skin.rb +18 -0
- data/tmpsets/set/mod005-04_settings/abstract/permission.rb +101 -0
- data/tmpsets/set/mod005-04_settings/right/add_help.rb +17 -0
- data/tmpsets/set/mod005-04_settings/right/comment.rb +9 -0
- data/tmpsets/set/mod005-04_settings/right/create.rb +9 -0
- data/tmpsets/set/mod005-04_settings/right/default.rb +9 -0
- data/tmpsets/set/mod005-04_settings/right/delete.rb +9 -0
- data/tmpsets/set/mod005-04_settings/right/help.rb +9 -0
- data/tmpsets/set/mod005-04_settings/right/read.rb +9 -0
- data/tmpsets/set/mod005-04_settings/right/script.rb +16 -0
- data/tmpsets/set/mod005-04_settings/right/structure.rb +16 -0
- data/tmpsets/set/mod005-04_settings/right/style.rb +16 -0
- data/tmpsets/set/mod005-04_settings/right/update.rb +9 -0
- data/tmpsets/set/mod005-04_settings/self/accountable.rb +9 -0
- data/tmpsets/set/mod005-04_settings/self/add_help.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/autoname.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/captcha.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/create.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/default.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/delete.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/help.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/input.rb +7 -0
- data/tmpsets/set/mod005-04_settings/self/layout.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/on_create.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/on_delete.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/on_update.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/options.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/options_label.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/read.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/recent_settings.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/script.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/structure.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/style.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/table_of_contents.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/thanks.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/update.rb +8 -0
- data/tmpsets/set/mod005-04_settings/type/setting.rb +96 -0
- data/tmpsets/set/mod006-05_email/all/email_html.rb +11 -0
- data/tmpsets/set/mod006-05_email/all/email_text.rb +11 -0
- data/tmpsets/set/mod006-05_email/all/follow.rb +260 -0
- data/tmpsets/set/mod006-05_email/all/notify.rb +244 -0
- data/tmpsets/set/mod006-05_email/all/observer.rb +33 -0
- data/tmpsets/set/mod006-05_email/right/bcc.rb +51 -0
- data/tmpsets/set/mod006-05_email/right/cc.rb +9 -0
- data/tmpsets/set/mod006-05_email/right/follow.rb +90 -0
- data/tmpsets/set/mod006-05_email/right/follow_fields.rb +8 -0
- data/tmpsets/set/mod006-05_email/right/followers.rb +35 -0
- data/tmpsets/set/mod006-05_email/right/following.rb +58 -0
- data/tmpsets/set/mod006-05_email/right/from.rb +9 -0
- data/tmpsets/set/mod006-05_email/right/html_message.rb +9 -0
- data/tmpsets/set/mod006-05_email/right/to.rb +9 -0
- data/tmpsets/set/mod006-05_email/self/always.rb +20 -0
- data/tmpsets/set/mod006-05_email/self/created.rb +27 -0
- data/tmpsets/set/mod006-05_email/self/edited.rb +30 -0
- data/tmpsets/set/mod006-05_email/self/follow.rb +8 -0
- data/tmpsets/set/mod006-05_email/self/follow_defaults.rb +71 -0
- data/tmpsets/set/mod006-05_email/self/never.rb +21 -0
- data/tmpsets/set/mod006-05_email/type/email_template.rb +119 -0
- data/tmpsets/set/mod006-05_email/type_plus_right/user/follow.rb +182 -0
- data/tmpsets/set/mod007-05_standard/abstract/attachment.rb +91 -0
- data/tmpsets/set/mod007-05_standard/all/account.rb +73 -0
- data/tmpsets/set/mod007-05_standard/all/comment.rb +45 -0
- data/tmpsets/set/mod007-05_standard/all/error.rb +198 -0
- data/tmpsets/set/mod007-05_standard/all/event_viz.rb +75 -0
- data/tmpsets/set/mod007-05_standard/all/links.rb +153 -0
- data/tmpsets/set/mod007-05_standard/all/rich_html/content.rb +248 -0
- data/tmpsets/set/mod007-05_standard/all/rich_html/editing.rb +216 -0
- data/tmpsets/set/mod007-05_standard/all/rich_html/form.rb +238 -0
- data/tmpsets/set/mod007-05_standard/all/rich_html/header.rb +80 -0
- data/tmpsets/set/mod007-05_standard/all/rich_html/menu.rb +135 -0
- data/tmpsets/set/mod007-05_standard/all/rich_html/modal.rb +98 -0
- data/tmpsets/set/mod007-05_standard/all/rich_html/toolbar.rb +271 -0
- data/tmpsets/set/mod007-05_standard/all/rich_html/wrapper.rb +158 -0
- data/tmpsets/set/mod007-05_standard/right/account.rb +187 -0
- data/tmpsets/set/mod007-05_standard/right/discussion.rb +9 -0
- data/tmpsets/set/mod007-05_standard/right/email.rb +57 -0
- data/tmpsets/set/mod007-05_standard/right/password.rb +44 -0
- data/tmpsets/set/mod007-05_standard/right/salt.rb +11 -0
- data/tmpsets/set/mod007-05_standard/right/stats.rb +41 -0
- data/tmpsets/set/mod007-05_standard/right/status.rb +15 -0
- data/tmpsets/set/mod007-05_standard/right/token.rb +11 -0
- data/tmpsets/set/mod007-05_standard/right/when_created.rb +11 -0
- data/tmpsets/set/mod007-05_standard/right/when_last_edited.rb +11 -0
- data/tmpsets/set/mod007-05_standard/rstar/rules.rb +411 -0
- data/tmpsets/set/mod007-05_standard/self/account_links.rb +55 -0
- data/tmpsets/set/mod007-05_standard/self/alerts.rb +11 -0
- data/tmpsets/set/mod007-05_standard/self/all.rb +28 -0
- data/tmpsets/set/mod007-05_standard/self/foot.rb +14 -0
- data/tmpsets/set/mod007-05_standard/self/head.rb +126 -0
- data/tmpsets/set/mod007-05_standard/self/navbox.rb +39 -0
- data/tmpsets/set/mod007-05_standard/self/now.rb +12 -0
- data/tmpsets/set/mod007-05_standard/self/performance_log.rb +98 -0
- data/tmpsets/set/mod007-05_standard/self/recent.rb +54 -0
- data/tmpsets/set/mod007-05_standard/self/search.rb +49 -0
- data/tmpsets/set/mod007-05_standard/self/signin.rb +130 -0
- data/tmpsets/set/mod007-05_standard/self/stats.rb +109 -0
- data/tmpsets/set/mod007-05_standard/self/version.rb +15 -0
- data/tmpsets/set/mod007-05_standard/type/basic.rb +52 -0
- data/tmpsets/set/mod007-05_standard/type/cardtype.rb +78 -0
- data/tmpsets/set/mod007-05_standard/type/date.rb +14 -0
- data/tmpsets/set/mod007-05_standard/type/file.rb +103 -0
- data/tmpsets/set/mod007-05_standard/type/image.rb +89 -0
- data/tmpsets/set/mod007-05_standard/type/layout_type.rb +21 -0
- data/tmpsets/set/mod007-05_standard/type/number.rb +25 -0
- data/tmpsets/set/mod007-05_standard/type/phrase.rb +9 -0
- data/tmpsets/set/mod007-05_standard/type/search_type.rb +291 -0
- data/tmpsets/set/mod007-05_standard/type/session.rb +42 -0
- data/tmpsets/set/mod007-05_standard/type/set.rb +354 -0
- data/tmpsets/set/mod007-05_standard/type/signup.rb +150 -0
- data/tmpsets/set/mod007-05_standard/type/toggle.rb +18 -0
- data/tmpsets/set/mod007-05_standard/type/uri.rb +17 -0
- data/tmpsets/set/mod007-05_standard/type/user.rb +78 -0
- data/tmpsets/set/mod008-06_bootstrap/all/bootstrap/form.rb +41 -0
- data/tmpsets/set/mod008-06_bootstrap/all/bootstrap/helper.rb +150 -0
- data/tmpsets/set/mod008-06_bootstrap/all/bootstrap/wrapper.rb +18 -0
- data/tmpsets/set/mod008-06_bootstrap/all/rich_bootstrap.rb +14 -0
- data/tmpsets/set/mod008-06_bootstrap/self/bootstrap_cards.rb +15 -0
- data/tmpsets/set/mod008-06_bootstrap/self/bootstrap_js.rb +13 -0
- data/tmpsets/set/mod008-06_bootstrap/self/bootswatch_shared.rb +38 -0
- data/tmpsets/set/mod008-06_bootstrap/self/smartmenu_css.rb +13 -0
- data/tmpsets/set/mod008-06_bootstrap/self/smartmenu_js.rb +12 -0
- data/tmpsets/set_pattern/100-all.rb +24 -0
- data/tmpsets/set_pattern/101-all_plus.rb +26 -0
- data/tmpsets/set_pattern/102-type.rb +36 -0
- data/tmpsets/set_pattern/103-star.rb +28 -0
- data/tmpsets/set_pattern/104-rstar.rb +30 -0
- data/tmpsets/set_pattern/105-right.rb +33 -0
- data/tmpsets/set_pattern/106-type_plus_right.rb +36 -0
- data/tmpsets/set_pattern/107-self.rb +32 -0
- metadata +306 -107
- data/mod/05_standard/set/all/attach.rb +0 -164
- data/mod/05_standard/spec/set/all/attach_spec.rb +0 -9
data/lib/card/loader.rb
CHANGED
@@ -21,7 +21,7 @@ class Card
|
|
21
21
|
load_set_patterns
|
22
22
|
load_formats
|
23
23
|
load_sets
|
24
|
-
|
24
|
+
|
25
25
|
if Wagn.config.performance_logger
|
26
26
|
Card::Log::Performance.load_config Wagn.config.performance_logger
|
27
27
|
end
|
@@ -48,11 +48,6 @@ class Card
|
|
48
48
|
|
49
49
|
def mod_dirs
|
50
50
|
@@mod_dirs ||= begin
|
51
|
-
if Card.paths['local-mod']
|
52
|
-
Card.paths['mod'] << Card.paths['local-mod']
|
53
|
-
Rails.logger.warn 'DEPRECATION WARNING: Append to paths[\'mod\'] vs. local-mod for configuring location of local (deck) modules.'
|
54
|
-
end
|
55
|
-
|
56
51
|
Card.paths['mod'].existent.map do |dirname|
|
57
52
|
Dir.entries( dirname ).sort.map do |filename|
|
58
53
|
"#{dirname}/#{filename}" if filename !~ /^\./
|
@@ -65,12 +60,12 @@ class Card
|
|
65
60
|
|
66
61
|
def load_set_patterns
|
67
62
|
if rewrite_tmp_files?
|
68
|
-
|
63
|
+
generate_set_pattern_tmp_files
|
69
64
|
end
|
70
65
|
load_dir "#{Card.paths['tmp/set_pattern'].first}/*.rb"
|
71
66
|
end
|
72
67
|
|
73
|
-
def
|
68
|
+
def generate_set_pattern_tmp_files
|
74
69
|
prepare_tmp_dir 'tmp/set_pattern'
|
75
70
|
seq = 100
|
76
71
|
mod_dirs.each do |mod|
|
@@ -95,44 +90,49 @@ class Card
|
|
95
90
|
end
|
96
91
|
|
97
92
|
def load_sets
|
98
|
-
|
99
|
-
|
93
|
+
generate_tmp_set_modules
|
94
|
+
load_tmp_set_modules
|
100
95
|
Set.process_base_modules
|
101
96
|
Set.clean_empty_modules
|
102
97
|
end
|
103
98
|
|
104
99
|
|
105
|
-
def
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
100
|
+
def generate_tmp_set_modules
|
101
|
+
if prepare_tmp_dir 'tmp/set'
|
102
|
+
seq = 1
|
103
|
+
mod_dirs.each do |mod_dir|
|
104
|
+
mod_tmp_dir = make_set_module_tmp_dir mod_dir, seq
|
105
|
+
Dir.glob("#{mod_dir}/set/**/*.rb").each do |abs_filename|
|
106
|
+
rel_filename = abs_filename.gsub "#{mod_dir}/set/", ''
|
107
|
+
tmp_filename = "#{mod_tmp_dir}/#{rel_filename}"
|
108
|
+
Set.write_tmp_file abs_filename, tmp_filename, rel_filename
|
109
|
+
end
|
110
|
+
seq = seq + 1
|
114
111
|
end
|
115
112
|
end
|
116
113
|
end
|
117
114
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
path_parts = anchor_path.gsub(/\.rb/,'').split(File::SEPARATOR)
|
128
|
-
filename = File.join dirname, anchor_path
|
129
|
-
Set.write_tmp_file set_pattern, path_parts, filename, seq
|
130
|
-
seq = seq + 1
|
115
|
+
|
116
|
+
def load_tmp_set_modules
|
117
|
+
patterns = Card.set_patterns.reverse.map(&:pattern_code).unshift 'abstract'
|
118
|
+
Dir.glob( "#{Card.paths['tmp/set'].first}/*" ).sort.each do |tmp_mod|
|
119
|
+
patterns.each do |pattern|
|
120
|
+
pattern_dir = "#{tmp_mod}/#{pattern}"
|
121
|
+
if Dir.exists? pattern_dir
|
122
|
+
load_dir "#{pattern_dir}/**/*.rb"
|
123
|
+
end
|
131
124
|
end
|
132
|
-
Dir.chdir old_pwd
|
133
125
|
end
|
134
126
|
end
|
135
127
|
|
128
|
+
def make_set_module_tmp_dir mod_dir, seq
|
129
|
+
modname = mod_dir.match(/[^\/]+$/)[0]
|
130
|
+
mod_tmp_dir = "#{Card.paths['tmp/set'].first}/mod#{"%03d" % seq}-#{modname}"
|
131
|
+
Dir.mkdir mod_tmp_dir
|
132
|
+
mod_tmp_dir
|
133
|
+
end
|
134
|
+
|
135
|
+
|
136
136
|
def prepare_tmp_dir path
|
137
137
|
if rewrite_tmp_files?
|
138
138
|
p = Card.paths[ path ]
|
data/lib/card/name.rb
CHANGED
data/lib/card/set.rb
CHANGED
@@ -10,7 +10,7 @@ class Card
|
|
10
10
|
|
11
11
|
|
12
12
|
=begin
|
13
|
-
A "Set" is a group of
|
13
|
+
A "Set" is a group of Cards to which "Rules" may be applied. Sets can be as specific as
|
14
14
|
a single card, as general as all cards, or anywhere in between.
|
15
15
|
|
16
16
|
Rules take two main forms: card rules and code rules.
|
@@ -236,6 +236,22 @@ class Card
|
|
236
236
|
end
|
237
237
|
|
238
238
|
|
239
|
+
def ensure_set &block
|
240
|
+
begin
|
241
|
+
set_module = block.call
|
242
|
+
rescue NameError => e
|
243
|
+
if e.message.match /uninitialized constant (?:Card::Set::)?(.+)$/
|
244
|
+
$1.split('::').inject(Card::Set) do |set_module, module_name|
|
245
|
+
set_module.const_get_or_set module_name do
|
246
|
+
Module.new
|
247
|
+
end
|
248
|
+
end
|
249
|
+
end
|
250
|
+
ensure_set &block # try again - there might be another submodule that doesn't exist
|
251
|
+
else
|
252
|
+
set_module.extend Card::Set
|
253
|
+
end
|
254
|
+
end
|
239
255
|
|
240
256
|
|
241
257
|
# the set loading process has two main phases:
|
@@ -254,35 +270,34 @@ class Card
|
|
254
270
|
register_set mod
|
255
271
|
end
|
256
272
|
|
273
|
+
|
274
|
+
# make the set available for use
|
257
275
|
def register_set set_module
|
258
|
-
if set_module.
|
276
|
+
if set_module.abstract_set?
|
277
|
+
# noop; only used by explicit inclusion in other set modules
|
278
|
+
elsif set_module.all_set?
|
279
|
+
# automatically included in Card class
|
259
280
|
modules[ :base ] << set_module
|
260
281
|
else
|
282
|
+
# made ready for dynamic loading via #include_set_modules
|
261
283
|
modules[ :nonbase ][ set_module.shortname ] ||= []
|
262
284
|
modules[ :nonbase ][ set_module.shortname ] << set_module
|
263
285
|
end
|
264
286
|
end
|
265
287
|
|
266
|
-
def write_tmp_file
|
267
|
-
|
268
|
-
|
269
|
-
# include_set_modules, which will look for Card::Set::Rstar, not Card::Set::Rstar::Blah
|
270
|
-
# This issue appears to be addressed by making the entries, in modules arrays.
|
271
|
-
# If yes remove this comment.
|
272
|
-
|
273
|
-
to_file = "#{Cardio.paths['tmp/set'].first}/#{set_pattern}/#{seq}-#{anchors * '-'}.rb"
|
274
|
-
anchor_modules = anchors.map { |a| "module #{a.camelize};" } * ' '
|
288
|
+
def write_tmp_file from_file, to_file, rel_path
|
289
|
+
name_parts = rel_path.gsub(/\.rb/,'').split(File::SEPARATOR)
|
290
|
+
submodules = name_parts.map { |a| "module #{a.camelize};" } * ' '
|
275
291
|
file_content = <<EOF
|
276
292
|
# -*- encoding : utf-8 -*-
|
277
|
-
class Card; module Set;
|
278
|
-
extend Card::Set
|
279
|
-
# ~~~~~~~~~~~ above autogenerated; below pulled from #{from_file} ~~~~~~~~~~~
|
280
|
-
|
293
|
+
class Card; module Set; #{submodules} extend Card::Set # ~~~~~~~~~~~ above autogenerated; below pulled from #{from_file} ~~~~~~~~~~~
|
281
294
|
#{ File.read from_file }
|
282
295
|
|
283
296
|
# ~~~~~~~~~~~ below autogenerated; above pulled from #{from_file} ~~~~~~~~~~~
|
284
|
-
end;end
|
297
|
+
end;end;#{'end;'*name_parts.size}
|
285
298
|
EOF
|
299
|
+
|
300
|
+
FileUtils.mkdir_p to_file.gsub /[^\/]*$/, ''
|
286
301
|
File.write to_file, file_content
|
287
302
|
to_file
|
288
303
|
end
|
@@ -331,10 +346,14 @@ EOF
|
|
331
346
|
|
332
347
|
|
333
348
|
def register_set_format format_class, mod
|
334
|
-
if self.
|
349
|
+
if self.abstract_set?
|
350
|
+
# noop; only used by explicit inclusion in other set modules
|
351
|
+
elsif self.all_set?
|
352
|
+
# ready to include in base format classes
|
335
353
|
modules[ :base_format ][ format_class ] ||= []
|
336
354
|
modules[ :base_format ][ format_class ] << mod
|
337
355
|
else
|
356
|
+
# ready to include dynamically in set members' format singletons
|
338
357
|
format_hash = modules[ :nonbase_format ][ format_class ] ||= {}
|
339
358
|
format_hash[ shortname ] ||= []
|
340
359
|
format_hash[ shortname ] << mod
|
@@ -350,6 +369,10 @@ EOF
|
|
350
369
|
parts[first..last].join '::'
|
351
370
|
end
|
352
371
|
|
372
|
+
def abstract_set?
|
373
|
+
name =~ /^Card::Set::Abstract::/
|
374
|
+
end
|
375
|
+
|
353
376
|
def all_set?
|
354
377
|
name =~ /^Card::Set::All::/
|
355
378
|
end
|
@@ -417,6 +440,10 @@ EOF
|
|
417
440
|
end
|
418
441
|
end
|
419
442
|
|
443
|
+
def set_specific_attributes *args
|
444
|
+
Card.set_specific_attributes ||= []
|
445
|
+
Card.set_specific_attributes += args.map(&:to_s)
|
446
|
+
end
|
420
447
|
end
|
421
448
|
end
|
422
449
|
|
data/lib/card/set_pattern.rb
CHANGED
@@ -5,6 +5,14 @@ class Card
|
|
5
5
|
class << self
|
6
6
|
attr_accessor :pattern_code, :pattern_id, :junction_only, :assigns_type, :anchorless, :anchor_parts_count
|
7
7
|
|
8
|
+
def card_keys
|
9
|
+
@@card_keys ||= Card.set_patterns.inject({}) do |hash, set_pattern|
|
10
|
+
card_key = Card.fetch( set_pattern.pattern_code.to_sym, :skip_modules=>true ).key
|
11
|
+
hash[ card_key ] = true
|
12
|
+
hash
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
8
16
|
def find pattern_code
|
9
17
|
Card.set_patterns.find { |sub| sub.pattern_code == pattern_code }
|
10
18
|
end
|
data/lib/cardio.rb
CHANGED
@@ -2,10 +2,11 @@
|
|
2
2
|
|
3
3
|
require 'active_support/core_ext/numeric/time'
|
4
4
|
|
5
|
-
CARD_GEM_ROOT = File.expand_path('../..', __FILE__)
|
6
5
|
|
7
6
|
module Cardio
|
8
7
|
|
8
|
+
CARD_GEM_ROOT = File.expand_path('../..', __FILE__)
|
9
|
+
|
9
10
|
ActiveSupport.on_load :card do
|
10
11
|
if Card.count > 0
|
11
12
|
Card::Loader.load_mods
|
@@ -68,6 +69,7 @@ module Cardio
|
|
68
69
|
add_path 'tmp/set_pattern', :root => root
|
69
70
|
|
70
71
|
add_path 'mod'
|
72
|
+
|
71
73
|
add_path "db"
|
72
74
|
add_path 'db/migrate'
|
73
75
|
add_path "db/migrate_core_cards"
|
@@ -75,8 +77,22 @@ module Cardio
|
|
75
77
|
add_path "db/seeds", :with => "db/seeds.rb"
|
76
78
|
|
77
79
|
add_path 'config/initializers', :glob => '**/*.rb'
|
78
|
-
|
79
|
-
|
80
|
+
|
81
|
+
end
|
82
|
+
|
83
|
+
|
84
|
+
def set_mod_paths
|
85
|
+
each_mod_path do |mod_path|
|
86
|
+
Dir.glob( "#{mod_path}/*/initializers" ).each do |initializers_dir|
|
87
|
+
paths['config/initializers'] << initializers_dir
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
def each_mod_path
|
93
|
+
paths['mod'].each do |mod_path|
|
94
|
+
yield mod_path
|
95
|
+
end
|
80
96
|
end
|
81
97
|
|
82
98
|
def root
|
data/mod/01_core/chunk/link.rb
CHANGED
@@ -14,13 +14,14 @@ module Card::Chunk
|
|
14
14
|
}
|
15
15
|
|
16
16
|
def interpret match, content
|
17
|
-
target, @link_text =
|
18
|
-
if
|
19
|
-
|
20
|
-
|
21
|
-
[
|
17
|
+
target, @link_text =
|
18
|
+
if (raw_syntax = match[1])
|
19
|
+
if i = divider_index( raw_syntax ) # [[ A | B ]]
|
20
|
+
[ raw_syntax[0..(i-1)], raw_syntax[(i+1)..-1] ]
|
21
|
+
else # [[ A ]]
|
22
|
+
[ raw_syntax, nil ]
|
23
|
+
end
|
22
24
|
end
|
23
|
-
end
|
24
25
|
|
25
26
|
@link_text = objectify @link_text
|
26
27
|
if target =~ /\/|mailto:/
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
|
3
|
+
require_dependency File.expand_path( '../reference', __FILE__ )
|
4
|
+
|
5
|
+
module Card::Chunk
|
6
|
+
|
7
|
+
# This should find +Alfred+ in expressions like
|
8
|
+
# 1) {"name":"Alfred"}
|
9
|
+
# 2a) {"name":["in","Alfred"]}
|
10
|
+
# 3a) {"plus_right":["Alfred"]}
|
11
|
+
# but not in
|
12
|
+
# 2b) "content":"foo", "Alfred":"bar"
|
13
|
+
# 3b) {"name":["Alfred", "Toni"]}
|
14
|
+
# It's not possible to distinguish between 2a) and 2b) or 3a) and 3b) with a simple regex
|
15
|
+
# hence we use a too general regex and check for query keywords after the match
|
16
|
+
# which of course means that we don't find references with query keywords as name
|
17
|
+
class QueryReference < Reference
|
18
|
+
QUERY_KEYWORDS = ::Set.new(
|
19
|
+
(
|
20
|
+
Card::Query::MODIFIERS.keys +
|
21
|
+
Card::Query::OPERATORS.keys +
|
22
|
+
Card::Query::CardClause::ATTRIBUTES.keys +
|
23
|
+
Card::Query::CardClause::CONJUNCTIONS.keys +
|
24
|
+
['desc', 'asc', 'count']
|
25
|
+
).map(&:to_name)
|
26
|
+
)
|
27
|
+
word = /\s*([^"]+)\s*/
|
28
|
+
|
29
|
+
# we check for colon, comma or square bracket before a quote
|
30
|
+
# OPTIMIZE: instead of comma or square bracket check for operator followed by comma or "plus_right"|"plus_left"|"plus" followed by square bracket
|
31
|
+
Card::Chunk.register_class self, {
|
32
|
+
:prefix_re => '(?<=[:,\\[])\\s*"', # we have to use a lookbehind, otherwise
|
33
|
+
# if the colon matches it would be
|
34
|
+
# identified mistakenly as an URI chunk
|
35
|
+
:full_re => /"([^"]+)"/,
|
36
|
+
:idx_char => '"'
|
37
|
+
}
|
38
|
+
|
39
|
+
class << self
|
40
|
+
def full_match content, prefix
|
41
|
+
match, offset = super(content,prefix)
|
42
|
+
if match && !QUERY_KEYWORDS.include?(match[1].to_name)
|
43
|
+
[match, offset]
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def interpret match, content
|
49
|
+
@name = match[1]
|
50
|
+
end
|
51
|
+
|
52
|
+
def process_chunk
|
53
|
+
@process_chunk ||= @text
|
54
|
+
end
|
55
|
+
|
56
|
+
def inspect
|
57
|
+
"<##{self.class}:n[#{@name}] p[#{@process_chunk}] txt:#{@text}>"
|
58
|
+
end
|
59
|
+
|
60
|
+
def replace_reference old_name, new_name
|
61
|
+
replace_name_reference old_name, new_name
|
62
|
+
@text = "\"#{referee_name.to_s}\""
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -55,7 +55,7 @@ end
|
|
55
55
|
|
56
56
|
|
57
57
|
event :set_default_content, :on=>:create, :before=>:approve do
|
58
|
-
if !db_content_changed?
|
58
|
+
if !db_content_changed? && template && template.db_content.present?
|
59
59
|
self.db_content = template.db_content
|
60
60
|
end
|
61
61
|
end
|
@@ -11,17 +11,17 @@ module ClassMethods
|
|
11
11
|
# - database
|
12
12
|
# - virtual cards
|
13
13
|
#
|
14
|
-
# "mark" here means
|
14
|
+
# "mark" here means one of three unique identifiers
|
15
|
+
# 1. a numeric id (Integer)
|
16
|
+
# 2. a name/key (String or Card::Name)
|
17
|
+
# 3. a codename (Symbol)
|
15
18
|
#
|
16
19
|
# Options:
|
17
20
|
# :skip_virtual Real cards only
|
18
21
|
# :skip_modules Don't load Set modules
|
22
|
+
# :look_in_trash Return trashed card objects
|
19
23
|
# :new => { card opts } Return a new card when not found
|
20
24
|
#
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
25
|
def fetch mark, opts={}
|
26
26
|
if String === mark
|
27
27
|
case mark
|
@@ -143,14 +143,22 @@ module ClassMethods
|
|
143
143
|
val = mark
|
144
144
|
end
|
145
145
|
|
146
|
-
card = send( "fetch_from_cache_by_#{mark_type}", val )
|
146
|
+
card = send( "fetch_from_cache_by_#{mark_type}", val )
|
147
|
+
|
148
|
+
if opts[:look_in_trash]
|
149
|
+
if card.nil? || (card.new_card? && !card.trash)
|
150
|
+
card = Card.where( mark_type => val ).take
|
151
|
+
needs_caching = card && !card.trash
|
152
|
+
end
|
153
|
+
elsif card.nil?
|
147
154
|
needs_caching = true
|
148
|
-
|
155
|
+
card = Card.where( mark_type => val, trash: false).take
|
149
156
|
end
|
150
157
|
|
151
158
|
[ card, mark, needs_caching ]
|
152
159
|
end
|
153
160
|
|
161
|
+
|
154
162
|
def fetch_from_cache_by_id id
|
155
163
|
if name = fetch_from_cache("~#{id}")
|
156
164
|
fetch_from_cache name
|