card 1.104.2 → 1.105.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (390) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -6
  3. data/VERSION +1 -1
  4. data/config/environments/development.rb +1 -1
  5. data/config/environments/test.rb +1 -0
  6. data/config/initializers/01_core_extensions/object.rb +10 -0
  7. data/config/initializers/01_core_extensions/string.rb +9 -0
  8. data/config/initializers/core_extensions.rb +1 -0
  9. data/db/migrate/{20160122153608_new_indeces.rb → 20160122153608_new_indices.rb} +2 -2
  10. data/db/migrate/{20200805200729_add_unique_pair_indeces.rb → 20200805200729_add_unique_pair_indices.rb} +1 -1
  11. data/db/migrate/20221031182227_remove_referee_key_requirement.rb +11 -0
  12. data/db/migrate_core_cards/20130920291703_update_stylesheets.rb +1 -9
  13. data/db/migrate_core_cards/20140307231621_user_data_to_cards.rb +1 -38
  14. data/db/migrate_core_cards/20161103154836_update_keys.rb +1 -1
  15. data/db/migrate_core_cards/20180905061537_migrate_layouts.rb +1 -1
  16. data/db/migrate_core_cards/20190125125150_add_script_rules_card.rb +1 -1
  17. data/db/migrate_core_cards/20190320091257_upgrade_recaptcha_to_v3.rb +1 -1
  18. data/db/migrate_core_cards/20190502130029_add_shark_and_help_desk_role.rb +2 -20
  19. data/db/migrate_core_cards/20190528131330_enabled_roles.rb +0 -3
  20. data/db/migrate_core_cards/20190625153616_pointer_overhaul.rb +0 -2
  21. data/db/migrate_core_cards/20190718140126_add_guides.rb +1 -1
  22. data/db/migrate_core_cards/20190822093633_move_help_text_to_code.rb +1 -1
  23. data/db/migrate_core_cards/20190829205148_remove_add_help.rb +1 -1
  24. data/db/migrate_core_cards/20190902193208_input_type.rb +1 -1
  25. data/db/migrate_core_cards/20190909104250_add_cardtype_input_types.rb +2 -2
  26. data/db/schema.rb +2 -2
  27. data/db/seeds.rb +14 -1
  28. data/db/version.txt +1 -1
  29. data/lib/card/auth/current.rb +4 -2
  30. data/lib/card/auth/permissions.rb +1 -1
  31. data/lib/card/auth/setup.rb +1 -1
  32. data/lib/card/auth/token.rb +1 -1
  33. data/lib/card/cache/persistent.rb +4 -1
  34. data/lib/card/codename.rb +2 -6
  35. data/lib/card/content/all.rb +2 -2
  36. data/lib/card/content/clean.rb +1 -1
  37. data/lib/card/content/parser.rb +0 -2
  38. data/lib/card/content.rb +1 -8
  39. data/lib/card/director/all.rb +67 -0
  40. data/lib/card/director/card_class.rb +158 -2
  41. data/lib/card/director/{act_direction.rb → class_methods.rb} +13 -3
  42. data/lib/card/director/phases.rb +7 -4
  43. data/lib/card/director/run.rb +51 -50
  44. data/lib/card/director/stages.rb +18 -16
  45. data/lib/card/director/store.rb +1 -1
  46. data/lib/card/director.rb +6 -7
  47. data/lib/card/env/location.rb +1 -1
  48. data/lib/card/env/serializable.rb +2 -0
  49. data/lib/card/env/serialization.rb +2 -3
  50. data/lib/card/env.rb +2 -2
  51. data/lib/card/error.rb +9 -5
  52. data/lib/card/format/error.rb +6 -12
  53. data/lib/card/format/nest.rb +1 -1
  54. data/lib/card/format/wrapper.rb +1 -1
  55. data/lib/card/format.rb +4 -0
  56. data/lib/card/model/save_helper/save_arguments.rb +0 -44
  57. data/lib/card/model/save_helper/save_helper_helper.rb +0 -37
  58. data/lib/card/model/save_helper.rb +0 -82
  59. data/lib/card/name/all.rb +1 -4
  60. data/lib/card/name/card_class.rb +0 -2
  61. data/lib/card/name/name_variants.rb +4 -0
  62. data/lib/card/name.rb +0 -5
  63. data/lib/card/query/abstract_query/query_helper.rb +3 -5
  64. data/lib/card/query/abstract_query/tie.rb +1 -1
  65. data/lib/card/query/abstract_query.rb +36 -17
  66. data/lib/card/query/card_class.rb +36 -0
  67. data/lib/card/query/card_query/custom.rb +12 -0
  68. data/lib/card/query/card_query/interpretation.rb +1 -0
  69. data/lib/card/query/card_query/normalization.rb +11 -3
  70. data/lib/card/query/card_query/reference_attributes.rb +3 -2
  71. data/lib/card/query/card_query/sorting.rb +5 -4
  72. data/lib/card/query/card_query.rb +1 -0
  73. data/lib/card/query/sql_statement/order.rb +12 -10
  74. data/lib/card/query/sql_statement/where.rb +2 -2
  75. data/lib/card/query.rb +5 -1
  76. data/lib/card/reference/all.rb +10 -10
  77. data/lib/card/set/advanced_api.rb +1 -1
  78. data/lib/card/set/event/all.rb +9 -1
  79. data/lib/card/set/event/delayed_event.rb +4 -2
  80. data/lib/card/set/event/options.rb +1 -1
  81. data/lib/card/set/event/skip_and_trigger.rb +34 -10
  82. data/lib/card/set/format/abstract_format/haml_views.rb +3 -3
  83. data/lib/card/set/format/abstract_format.rb +1 -1
  84. data/lib/card/set/format/haml_paths.rb +5 -21
  85. data/lib/card/set/inheritance.rb +4 -4
  86. data/lib/card/set/pattern/all.rb +1 -1
  87. data/lib/card/set/pattern/base.rb +1 -1
  88. data/lib/card/set/pattern/class_methods.rb +4 -4
  89. data/lib/card/set/trait.rb +1 -1
  90. data/lib/card/set/type.rb +0 -41
  91. data/lib/card/setting.rb +0 -1
  92. data/lib/card/subcards/all.rb +6 -8
  93. data/lib/card/subcards/args.rb +9 -9
  94. data/lib/card/view/cache/cache_action.rb +1 -1
  95. data/lib/card/view/options/visibility.rb +4 -0
  96. data/lib/card/view/options.rb +1 -0
  97. data/lib/card/view/permission.rb +12 -4
  98. data/lib/card/view.rb +4 -0
  99. data/lib/card.rb +18 -27
  100. data/lib/cardio/cli.rb +3 -1
  101. data/lib/cardio/command/application.rb +5 -0
  102. data/lib/cardio/{commands/command.rb → command/command_base.rb} +2 -2
  103. data/lib/cardio/{commands → command}/custom.rb +16 -13
  104. data/lib/cardio/{commands → command}/rake_command/parser.rb +3 -3
  105. data/lib/cardio/{commands → command}/rake_command.rb +4 -4
  106. data/lib/cardio/{commands → command}/rspec_command/parser.rb +2 -2
  107. data/lib/cardio/{commands → command}/rspec_command.rb +7 -9
  108. data/lib/cardio/command.rb +129 -0
  109. data/lib/cardio/commands.rb +17 -116
  110. data/lib/cardio/generators/deck_generator_loader.rb +1 -0
  111. data/lib/cardio/generators.rb +2 -2
  112. data/lib/cardio/migration.rb +3 -53
  113. data/lib/cardio/mod/class_methods.rb +26 -22
  114. data/lib/cardio/mod/dirs.rb +29 -22
  115. data/lib/cardio/mod/eat/edibles.rb +22 -15
  116. data/lib/cardio/mod/eat.rb +18 -14
  117. data/lib/cardio/mod/load_strategy/set_tmp_files.rb +1 -1
  118. data/lib/cardio/mod/load_strategy.rb +12 -2
  119. data/lib/cardio/mod/modfile_api.rb +18 -18
  120. data/lib/cardio/mod/{poop.rb → sow.rb} +10 -18
  121. data/lib/cardio/mod.rb +21 -30
  122. data/lib/cardio/railtie.rb +19 -56
  123. data/lib/cardio/schema.rb +2 -1
  124. data/lib/cardio/script_loader.rb +3 -1
  125. data/lib/cardio/seed.rb +101 -8
  126. data/lib/cardio/utils.rb +39 -1
  127. data/lib/generators/deck/deck_generator.rb +5 -2
  128. data/lib/generators/deck/templates/config/puma.rb +1 -1
  129. data/lib/generators/deck/templates/script/decko_rspec +1 -1
  130. data/lib/generators/deck/templates/simplecov.rb.erb +10 -8
  131. data/lib/generators/mod/USAGE +1 -1
  132. data/lib/generators/set/USAGE +2 -2
  133. data/mod/core/data/fixtures/real/card_actions.yml +78 -0
  134. data/{db/seed/new → mod/core/data/fixtures/real}/card_acts.yml +2 -2
  135. data/{db/seed/new → mod/core/data/fixtures/real}/card_changes.yml +0 -0
  136. data/mod/core/data/fixtures/real/card_references.yml +8 -0
  137. data/mod/core/data/fixtures/real/cards.yml +135 -0
  138. data/{db/seed/new → mod/core/data/fixtures/real}/schema_migrations.yml +0 -0
  139. data/{db/seed/new → mod/core/data/fixtures/real}/schema_migrations_core_cards.yml +0 -0
  140. data/{db/seed/new → mod/core/data/fixtures/real}/schema_migrations_deck.yml +0 -0
  141. data/{db/seed/new → mod/core/data/fixtures/real}/schema_migrations_deck_cards.yml +0 -0
  142. data/mod/core/data/real.yml +79 -0
  143. data/mod/core/data/test/cardtype.yml +38 -0
  144. data/mod/core/data/test/sample.yml +50 -0
  145. data/mod/core/data/test/user.yml +41 -0
  146. data/mod/core/data/test.yml +79 -28
  147. data/mod/core/lib/tasks/card/assets.rake +17 -0
  148. data/{lib → mod/core/lib}/tasks/card/create.rake +0 -0
  149. data/{lib → mod/core/lib}/tasks/card/migrate.rake +4 -0
  150. data/{lib → mod/core/lib}/tasks/card/mod.rake +4 -3
  151. data/mod/core/lib/tasks/card/seed.rake +58 -0
  152. data/mod/core/lib/tasks/card.rake +115 -0
  153. data/mod/core/locales/de.yml +4 -0
  154. data/mod/core/locales/en.yml +13 -0
  155. data/mod/core/set/all/admin.rb +14 -0
  156. data/mod/core/set/all/codename.rb +4 -0
  157. data/mod/core/set/all/content.rb +8 -4
  158. data/mod/core/set/all/{abort.rb → result.rb} +11 -15
  159. data/mod/core/set/all/states.rb +15 -1
  160. data/mod/core/set/all/trash.rb +25 -73
  161. data/mod/core/set/all/type.rb +2 -2
  162. data/mod/core/set/all/utils.rb +3 -87
  163. data/mod/core/set/right/autoname.rb +2 -0
  164. data/mod/core/set/self/admin/warning_alert.haml +3 -0
  165. data/mod/core/set/self/admin.rb +173 -0
  166. data/mod/core/set/type/cardtype.rb +2 -0
  167. data/mod/core/set_pattern/02_all_plus.rb +1 -1
  168. data/mod/core/set_pattern/05_rstar.rb +1 -1
  169. data/mod/core/set_pattern/06_rule.rb +1 -1
  170. data/mod/core/set_pattern/07_right.rb +1 -1
  171. data/mod/core/set_pattern/08_type_plus_right.rb +1 -1
  172. data/mod/core/spec/set/all/assign_attributes_spec.rb +3 -3
  173. data/mod/core/spec/set/all/autoname_spec.rb +25 -0
  174. data/mod/core/spec/set/all/codename_spec.rb +1 -1
  175. data/mod/core/spec/set/all/name_events_spec.rb +43 -66
  176. data/mod/core/spec/set/all/trash_spec.rb +149 -68
  177. data/mod/{admin → core}/spec/set/self/admin_spec.rb +25 -22
  178. data/mod/core/spec/set/self/trash_spec.rb +5 -0
  179. metadata +88 -251
  180. data/db/migrate_core_cards/20130411211600_delete_old_related_tab_cards.rb +0 -18
  181. data/db/migrate_core_cards/20130419215612_import_help_text.rb +0 -13
  182. data/db/migrate_core_cards/20130823192433_add_style_cards.rb +0 -100
  183. data/db/migrate_core_cards/20130910183318_move_styles_to_content.rb +0 -11
  184. data/db/migrate_core_cards/20130927191728_account_events.rb +0 -20
  185. data/db/migrate_core_cards/20131016172445_common_css_patch.rb +0 -9
  186. data/db/migrate_core_cards/20140110193325_reset_account_request_type.rb +0 -8
  187. data/db/migrate_core_cards/20140512155840_add_script_cards.rb +0 -86
  188. data/db/migrate_core_cards/20140629222005_add_email_cards.rb +0 -132
  189. data/db/migrate_core_cards/20140725180118_config_card_updates.rb +0 -9
  190. data/db/migrate_core_cards/20141111083921_delete_machine_output.rb +0 -7
  191. data/db/migrate_core_cards/20141115034214_config_descriptions_etc.rb +0 -14
  192. data/db/migrate_core_cards/20141119001955_make_symlinks_relative.rb +0 -15
  193. data/db/migrate_core_cards/20141120120605_fix_notification_html_message.rb +0 -10
  194. data/db/migrate_core_cards/20141216155251_add_more_following_cards.rb +0 -26
  195. data/db/migrate_core_cards/20141230204340_uri_codename.rb +0 -13
  196. data/db/migrate_core_cards/20150202143810_import_bootstrap_layout.rb +0 -76
  197. data/db/migrate_core_cards/20150317162412_bootstrap_themes.rb +0 -41
  198. data/db/migrate_core_cards/20150326205655_bootswatch_themes.rb +0 -36
  199. data/db/migrate_core_cards/20150331135745_new_card_menu.rb +0 -8
  200. data/db/migrate_core_cards/20150501010515_responsive_sidebar.rb +0 -11
  201. data/db/migrate_core_cards/20150508212032_menu_compatibility.rb +0 -24
  202. data/db/migrate_core_cards/20150528084659_add_session_cardtype.rb +0 -18
  203. data/db/migrate_core_cards/20150601133433_add_recent_setting_session_card.rb +0 -18
  204. data/db/migrate_core_cards/20150610171702_add_debugger_session_card.rb +0 -12
  205. data/db/migrate_core_cards/20150610180019_add_recaptcha_key_and_admin_info_cards.rb +0 -58
  206. data/db/migrate_core_cards/20150627205133_fix_script_bootstrap_card_type.rb +0 -7
  207. data/db/migrate_core_cards/20150702130543_remove_edit_toolbar_pinned.rb +0 -9
  208. data/db/migrate_core_cards/20150708224756_add_list_cards.rb +0 -29
  209. data/db/migrate_core_cards/20150903130006_attachment_upload_cards.rb +0 -15
  210. data/db/migrate_core_cards/20150910085603_remove_performance_log_card.rb +0 -10
  211. data/db/migrate_core_cards/20151120180631_add_token_expiration.rb +0 -7
  212. data/db/migrate_core_cards/20160801143221_change_bootstrap_card_type_to_scss.rb +0 -10
  213. data/db/migrate_core_cards/20160804112510_reorganize_scripts.rb +0 -27
  214. data/db/migrate_core_cards/20160908154210_add_trash_card.rb +0 -7
  215. data/db/migrate_core_cards/20161102202156_tweak_recaptcha_setting_cards.rb +0 -17
  216. data/db/migrate_core_cards/20170209132834_email_test_context.rb +0 -49
  217. data/db/migrate_core_cards/20170314175313_add_notification_event_card.rb +0 -20
  218. data/db/migrate_core_cards/20170515101262_add_advanced_edit_cards.rb +0 -20
  219. data/db/migrate_core_cards/20170608083819_add_full_width_layout_card.rb +0 -23
  220. data/db/migrate_core_cards/20170608200649_add_input_options_codename.rb +0 -8
  221. data/db/migrate_core_cards/20180423120222_add_mod_styles_card.rb +0 -20
  222. data/db/migrate_core_cards/20180508210903_add_json_type.rb +0 -10
  223. data/db/migrate_core_cards/20180515175726_add_codenames.rb +0 -8
  224. data/db/migrate_core_cards/20180712042655_head_rule.rb +0 -13
  225. data/db/migrate_core_cards/20181120200937_update_layout.rb +0 -7
  226. data/db/migrate_core_cards/20190204195039_add_rule_card.rb +0 -10
  227. data/db/migrate_core_cards/20190321085735_wagn_to_decko_logo.rb +0 -11
  228. data/db/migrate_core_cards/20190417142612_reorganize_scripts_2.rb +0 -17
  229. data/db/migrate_core_cards/20190424100531_update_credit_image.rb +0 -76
  230. data/db/migrate_core_cards/20190424101004_add_read_anyone_rules.rb +0 -13
  231. data/db/migrate_core_cards/20190503122739_update_pristine_data.rb +0 -18
  232. data/db/migrate_core_cards/20190605133556_tweak_config_cards.rb +0 -10
  233. data/db/migrate_core_cards/20190618110446_add_dropdown_divider.rb +0 -8
  234. data/db/migrate_core_cards/20190621143156_add_role_assign_permissions.rb +0 -9
  235. data/db/migrate_core_cards/20190710090209_homepage_tweaks.rb +0 -13
  236. data/db/migrate_core_cards/20190820155833_update_cardtype_type_structure.rb +0 -7
  237. data/db/migrate_core_cards/20190823220018_cleanup_for_decko_1_0.rb +0 -19
  238. data/db/migrate_core_cards/20190826132738_add_more_guides.rb +0 -7
  239. data/db/migrate_core_cards/20190829093961_cardtype_grouping.rb +0 -16
  240. data/db/migrate_core_cards/20190830131820_setting_settings_aside.rb +0 -17
  241. data/db/migrate_core_cards/20190902161223_add_style_media.rb +0 -7
  242. data/db/migrate_core_cards/20190918200115_ensure_description_card.rb +0 -13
  243. data/db/migrate_core_cards/20191008201046_fixture_fix.rb +0 -11
  244. data/db/migrate_core_cards/20191028135243_add_link_editor_to_tiny_mce_config.rb +0 -9
  245. data/db/migrate_core_cards/20191118145629_codename_fixes.rb +0 -5
  246. data/db/migrate_core_cards/20200821231558_add_nest_list_type.rb +0 -9
  247. data/db/migrate_core_cards/data/1.11_help_text.json +0 -410
  248. data/db/migrate_core_cards/data/1.12_stylesheets/classic_cards.scss +0 -104
  249. data/db/migrate_core_cards/data/1.12_stylesheets/common.scss +0 -228
  250. data/db/migrate_core_cards/data/1.12_stylesheets/right_sidebar.scss +0 -27
  251. data/db/migrate_core_cards/data/1.12_stylesheets/traditional.scss +0 -143
  252. data/db/migrate_core_cards/data/1.13_config_text.json +0 -32
  253. data/db/migrate_core_cards/data/1.14_config_descriptions_etc.json +0 -77
  254. data/db/migrate_core_cards/data/bootstrap_layout.json +0 -96
  255. data/db/migrate_core_cards/data/cards/Xaccount +0 -22
  256. data/db/migrate_core_cards/data/cards/Xaccount_setting-Xright-Xstructure +0 -12
  257. data/db/migrate_core_cards/data/cards/Xall-Xlayout +0 -1
  258. data/db/migrate_core_cards/data/cards/Xcredit +0 -2
  259. data/db/migrate_core_cards/data/cards/Xfooter +0 -3
  260. data/db/migrate_core_cards/data/cards/Xgetting_started +0 -31
  261. data/db/migrate_core_cards/data/cards/Xgetting_started-shark +0 -66
  262. data/db/migrate_core_cards/data/cards/Xgetting_started_link +0 -6
  263. data/db/migrate_core_cards/data/cards/Xheader +0 -19
  264. data/db/migrate_core_cards/data/cards/Xhome +0 -1
  265. data/db/migrate_core_cards/data/cards/Xlogo +0 -1
  266. data/db/migrate_core_cards/data/cards/Xmain_menu +0 -2
  267. data/db/migrate_core_cards/data/cards/Xrecaptcha_setting-Xself-Xstructure +0 -1
  268. data/db/migrate_core_cards/data/cards/Xsidebar +0 -7
  269. data/db/migrate_core_cards/data/cards/Xstructure-Xright-Xguide +0 -12
  270. data/db/migrate_core_cards/data/cards/Xtitle +0 -1
  271. data/db/migrate_core_cards/data/cards/administrator-dashboard +0 -23
  272. data/db/migrate_core_cards/data/cards/administrator-description +0 -1
  273. data/db/migrate_core_cards/data/cards/anyone_signed_in-dashboard +0 -0
  274. data/db/migrate_core_cards/data/cards/cardtype-Xtype-Xguide +0 -24
  275. data/db/migrate_core_cards/data/cards/cardtype-Xtype-Xstructure +0 -3
  276. data/db/migrate_core_cards/data/cards/default_layout +0 -6
  277. data/db/migrate_core_cards/data/cards/full_width_layout +0 -5
  278. data/db/migrate_core_cards/data/cards/help_desk-dashboard +0 -7
  279. data/db/migrate_core_cards/data/cards/help_desk-description +0 -1
  280. data/db/migrate_core_cards/data/cards/home +0 -2
  281. data/db/migrate_core_cards/data/cards/home-Xself-Xlayout +0 -1
  282. data/db/migrate_core_cards/data/cards/home-original +0 -22
  283. data/db/migrate_core_cards/data/cards/home_layout +0 -6
  284. data/db/migrate_core_cards/data/cards/left_sidebar_layout +0 -6
  285. data/db/migrate_core_cards/data/cards/menu +0 -1
  286. data/db/migrate_core_cards/data/cards/right_thin_sidebar_layout +0 -8
  287. data/db/migrate_core_cards/data/cards/role-Xtype-Xstructure +0 -2
  288. data/db/migrate_core_cards/data/cards/shark-dashboard +0 -19
  289. data/db/migrate_core_cards/data/cards/shark-description +0 -1
  290. data/db/migrate_core_cards/data/cards/shark_menu +0 -2
  291. data/db/migrate_core_cards/data/cards.yml +0 -138
  292. data/db/migrate_core_cards/data/decko_logo.svg +0 -1
  293. data/db/migrate_core_cards/data/mailer/follower_notification_email.html +0 -9
  294. data/db/migrate_core_cards/data/mailer/follower_notification_email.txt +0 -11
  295. data/db/migrate_core_cards/data/mailer/mail_config.json +0 -22
  296. data/db/migrate_core_cards/data/mailer/password_reset_email.html +0 -13
  297. data/db/migrate_core_cards/data/mailer/password_reset_email.txt +0 -11
  298. data/db/migrate_core_cards/data/mailer/signup_alert_email.html +0 -7
  299. data/db/migrate_core_cards/data/mailer/signup_alert_email.txt +0 -5
  300. data/db/migrate_core_cards/data/mailer/verification_email.html +0 -12
  301. data/db/migrate_core_cards/data/mailer/verification_email.txt +0 -9
  302. data/db/migrate_core_cards/data/skin_images.json +0 -91
  303. data/db/migrate_core_cards/data/themes/bootstrap_default/_bootswatch.scss +0 -0
  304. data/db/migrate_core_cards/data/themes/bootstrap_default/_variables.scss +0 -867
  305. data/db/migrate_core_cards/data/themes/cerulean/_bootswatch.scss +0 -125
  306. data/db/migrate_core_cards/data/themes/cerulean/_variables.scss +0 -861
  307. data/db/migrate_core_cards/data/themes/cosmo/_bootswatch.scss +0 -237
  308. data/db/migrate_core_cards/data/themes/cosmo/_variables.scss +0 -861
  309. data/db/migrate_core_cards/data/themes/cyborg/_bootswatch.scss +0 -210
  310. data/db/migrate_core_cards/data/themes/cyborg/_variables.scss +0 -861
  311. data/db/migrate_core_cards/data/themes/darkly/_bootswatch.scss +0 -330
  312. data/db/migrate_core_cards/data/themes/darkly/_variables.scss +0 -861
  313. data/db/migrate_core_cards/data/themes/flatly/_bootswatch.scss +0 -313
  314. data/db/migrate_core_cards/data/themes/flatly/_variables.scss +0 -861
  315. data/db/migrate_core_cards/data/themes/journal/_bootswatch.scss +0 -120
  316. data/db/migrate_core_cards/data/themes/journal/_variables.scss +0 -861
  317. data/db/migrate_core_cards/data/themes/lumen/_bootswatch.scss +0 -496
  318. data/db/migrate_core_cards/data/themes/lumen/_variables.scss +0 -861
  319. data/db/migrate_core_cards/data/themes/paper/_bootswatch.scss +0 -607
  320. data/db/migrate_core_cards/data/themes/paper/_variables.scss +0 -861
  321. data/db/migrate_core_cards/data/themes/readable/_bootswatch.scss +0 -174
  322. data/db/migrate_core_cards/data/themes/readable/_variables.scss +0 -861
  323. data/db/migrate_core_cards/data/themes/sandstone/_bootswatch.scss +0 -194
  324. data/db/migrate_core_cards/data/themes/sandstone/_variables.scss +0 -861
  325. data/db/migrate_core_cards/data/themes/simplex/_bootswatch.scss +0 -142
  326. data/db/migrate_core_cards/data/themes/simplex/_variables.scss +0 -861
  327. data/db/migrate_core_cards/data/themes/slate/_bootswatch.scss +0 -417
  328. data/db/migrate_core_cards/data/themes/slate/_variables.scss +0 -861
  329. data/db/migrate_core_cards/data/themes/spacelab/_bootswatch.scss +0 -137
  330. data/db/migrate_core_cards/data/themes/spacelab/_variables.scss +0 -861
  331. data/db/migrate_core_cards/data/themes/superhero/_bootswatch.scss +0 -332
  332. data/db/migrate_core_cards/data/themes/superhero/_variables.scss +0 -861
  333. data/db/migrate_core_cards/data/themes/united/_bootswatch.scss +0 -42
  334. data/db/migrate_core_cards/data/themes/united/_variables.scss +0 -861
  335. data/db/migrate_core_cards/data/themes/yeti/_bootswatch.scss +0 -437
  336. data/db/migrate_core_cards/data/themes/yeti/_variables.scss +0 -861
  337. data/db/seed/README.md +0 -2
  338. data/db/seed/new/card_actions.yml +0 -5913
  339. data/db/seed/new/card_references.yml +0 -6532
  340. data/db/seed/new/cards.yml +0 -14595
  341. data/db/seed/test/fixtures/card_actions.yml +0 -8153
  342. data/db/seed/test/fixtures/card_acts.yml +0 -1039
  343. data/db/seed/test/fixtures/card_changes.yml +0 -230
  344. data/db/seed/test/fixtures/card_references.yml +0 -8471
  345. data/db/seed/test/fixtures/cards.yml +0 -20171
  346. data/db/seed/test/fixtures/file1.txt +0 -1
  347. data/db/seed/test/fixtures/file2.txt +0 -1
  348. data/db/seed/test/fixtures/mao2.jpg +0 -0
  349. data/db/seed/test/fixtures/rails.gif +0 -0
  350. data/db/seed/test/fixtures/schema_migrations.yml +0 -67
  351. data/db/seed/test/fixtures/schema_migrations_core_cards.yml +0 -347
  352. data/db/seed/test/fixtures/schema_migrations_deck.yml +0 -1
  353. data/db/seed/test/fixtures/schema_migrations_deck_cards.yml +0 -5
  354. data/db/test_seed.rb +0 -322
  355. data/lib/card/content/truncate.rb +0 -67
  356. data/lib/card/director/card_methods.rb +0 -45
  357. data/lib/card/file_card_creator/abstract_file_card/migration_file.rb +0 -50
  358. data/lib/card/file_card_creator/abstract_file_card/ruby_file.rb +0 -30
  359. data/lib/card/file_card_creator/abstract_file_card/source_file.rb +0 -36
  360. data/lib/card/file_card_creator/abstract_file_card.rb +0 -44
  361. data/lib/card/file_card_creator/haml_card.rb +0 -42
  362. data/lib/card/file_card_creator/output_helper.rb +0 -53
  363. data/lib/card/file_card_creator/script_card.rb +0 -35
  364. data/lib/card/file_card_creator/style_card.rb +0 -25
  365. data/lib/card/file_card_creator.rb +0 -25
  366. data/lib/card/name/fields_and_traits.rb +0 -42
  367. data/lib/cardio/commands/application.rb +0 -10
  368. data/lib/cardio/migration/import/import_data/card_attributes.rb +0 -64
  369. data/lib/cardio/migration/import/import_data/card_content.rb +0 -30
  370. data/lib/cardio/migration/import/import_data.rb +0 -119
  371. data/lib/cardio/migration/import/merger.rb +0 -46
  372. data/lib/cardio/migration/import.rb +0 -125
  373. data/lib/tasks/card.rake +0 -65
  374. data/mod/admin/locales/de.yml +0 -4
  375. data/mod/admin/locales/en.yml +0 -4
  376. data/mod/admin/set/all/admin.rb +0 -16
  377. data/mod/admin/set/self/admin.rb +0 -144
  378. data/mod/admin/set/self/admin_info.rb +0 -40
  379. data/mod/admin/set/self/debugger.rb +0 -3
  380. data/mod/admin/spec/set/self/admin_info_spec.rb +0 -9
  381. data/mod/core/data/production.yml +0 -7
  382. data/mod/core/set/all/collection.rb +0 -53
  383. data/mod/core/spec/set/all/collection_spec.rb +0 -170
  384. data/mod/core/spec/set/all/utils_spec.rb +0 -5
  385. data/mod/standard/data/files/favicon/image-icon.png +0 -0
  386. data/mod/standard/data/files/favicon/image-large.png +0 -0
  387. data/mod/standard/data/files/favicon/image-medium.png +0 -0
  388. data/mod/standard/data/files/favicon/image-original.png +0 -0
  389. data/mod/standard/data/files/favicon/image-small.png +0 -0
  390. data/mod/standard/data/files/logo/image-original.svg +0 -1
@@ -1,35 +0,0 @@
1
- require_relative "./abstract_file_card"
2
-
3
- class Card
4
- class FileCardCreator
5
- # Move javascript or coffeescript from the card database to a file.
6
- # It generates three files:
7
- # 1. a migration file that ensures the card has a codename and adds it to the
8
- # script rule card.
9
- # 2. a script file with the source code
10
- # 3. a ruby file (=code rule) that ties the script file to the card
11
- class ScriptCard < AbstractFileCard
12
- @supported_types = %i[js coffee]
13
- @category = :script
14
- @default_rule_name = "*all+*script"
15
-
16
- private
17
-
18
- def source_file_ext
19
- @type == :coffee ? "js.coffee" : @type
20
- end
21
-
22
- def type_codename
23
- @type_codename ||=
24
- case @type
25
- when :js then :java_script
26
- when :coffee then :coffee_script
27
- end
28
- end
29
-
30
- def source_file_dir
31
- File.join "lib", "javascript"
32
- end
33
- end
34
- end
35
- end
@@ -1,25 +0,0 @@
1
- class Card
2
- class FileCardCreator
3
- # Move css or scss from the card database to a file.
4
- # It generates three files:
5
- # 1. a migration file that ensures the card has a codename and adds it to the
6
- # style rule card.
7
- # 2. a style file with the source code
8
- # 3. a ruby file (=code rule) that ties the style file to the card
9
- class StyleCard < AbstractFileCard
10
- @supported_types = %i[css scss]
11
- @category = :style
12
- @default_rule_name = "*all+*style"
13
-
14
- private
15
-
16
- def type_codename
17
- @type_codename ||= @type.to_sym
18
- end
19
-
20
- def source_file_dir
21
- File.join "lib", "stylesheets"
22
- end
23
- end
24
- end
25
- end
@@ -1,25 +0,0 @@
1
- class Card
2
- # A Factory class
3
- # It chooses the class to create the file card according to the given type.
4
- class FileCardCreator
5
- CARD_CLASSES = [StyleCard, ScriptCard, HamlCard].freeze
6
-
7
- attr_reader :creator
8
-
9
- def initialize mod, name, type, codename, force
10
- card_class = FileCardCreator.card_class type
11
- unless card_class
12
- raise "'#{type}' is not a valid type. "\
13
- "Please choose between js, coffee, css, scss and haml", :red
14
- end
15
-
16
- @creator = card_class.new mod, name, type, codename: codename, force: force
17
- end
18
-
19
- def self.card_class type
20
- CARD_CLASSES.find { |cc| cc.valid_type? type }
21
- end
22
-
23
- delegate :create, to: :creator
24
- end
25
- end
@@ -1,42 +0,0 @@
1
- class Card
2
- class Name
3
- # Name-based "Fields" are compound names in which the right name is treated
4
- # as an attribute of the left. (Eg MyName+address)
5
- #
6
- # "Traits" are the subset of fields in which the right name corresponds to a
7
- # card with a codename
8
- module FieldsAndTraits
9
- # @return [String]
10
- def field tag_name
11
- field_name(tag_name).s
12
- end
13
-
14
- # @return [Card::Name]
15
- def field_name tag
16
- tag = tag.to_s[1..-1] if !tag.is_a?(Symbol) && tag.to_s[0] == "+"
17
- [self, tag].to_name
18
- end
19
-
20
- # @return [True/False]
21
- def field_of? context
22
- return false unless compound?
23
-
24
- if context.present?
25
- absolute_name(context).left_name.key == context.to_name.key
26
- else
27
- s.match?(/^\s*\+[^+]+$/)
28
- end
29
- end
30
-
31
- # name is relative name containing only the rightmost part
32
- # @return [True/False]
33
- def field_only?
34
- relative? && stripped.to_name.parts.reject(&:blank?).first == parts.last
35
- end
36
-
37
- def relative_field_name tag_name
38
- field_name(tag_name).name_from self
39
- end
40
- end
41
- end
42
- end
@@ -1,10 +0,0 @@
1
- require "rails/generators"
2
- require File.expand_path("../../../generators/deck/deck_generator", __FILE__)
3
-
4
- if ARGV.first != "new"
5
- ARGV[0] = "--help"
6
- else
7
- ARGV.shift
8
- end
9
-
10
- Cardio::Generators::Deck::DeckGenerator.start
@@ -1,64 +0,0 @@
1
- module Cardio
2
- class Migration
3
- class Import
4
- class ImportData
5
- # handles card attributes for import
6
- module CardAttributes
7
- def card_attributes data
8
- card_attr = ::Set.new %i[name type codename file image]
9
- data.select { |k, v| v && card_attr.include?(k) }
10
- end
11
-
12
- def update_card_attributes card_data
13
- card_entry = find_card_attributes card_data[:name]
14
- # we only want strings and not the whole name objects
15
- # for name and type
16
- card_data[:name] = card_data[:name].to_s
17
- card_data[:type] = card_data[:type].to_s
18
- if card_entry
19
- card_entry.replace card_data
20
- else
21
- cards << card_data
22
- end
23
- end
24
-
25
- def update_attribute name, attr_key, attr_value
26
- card = find_card_attributes name
27
- return unless card
28
-
29
- card[attr_key] = attr_value
30
- card
31
- end
32
-
33
- def write_attributes
34
- File.write @path, @data.to_yaml
35
- rescue SystemCallError
36
- false
37
- # card.yml not written
38
- end
39
-
40
- def read_attributes
41
- ensure_path
42
- return { cards: [], remotes: {} } unless File.exist? @path
43
-
44
- YAML.load_file(@path).deep_symbolize_keys
45
- end
46
-
47
- def find_card_attributes name
48
- key = name.to_name.key
49
- cards.find do |attr|
50
- key == (attr[:key].present? ? attr[:key] : attr[:name].to_name.key)
51
- end
52
- end
53
-
54
- private
55
-
56
- def ensure_path
57
- dir = File.dirname(@path)
58
- FileUtils.mkpath dir unless Dir.exist? dir
59
- end
60
- end
61
- end
62
- end
63
- end
64
- end
@@ -1,30 +0,0 @@
1
- module Cardio
2
- class Migration
3
- class Import
4
- class ImportData
5
- # handles card content for import
6
- module CardContent
7
- def card_content data
8
- File.read content_path(data)
9
- end
10
-
11
- def content_changed? data
12
- Time.parse(data[:merged]) < File.mtime(content_path(data))
13
- end
14
-
15
- private
16
-
17
- def write_card_content data, content
18
- FileUtils.mkpath @card_content_dir unless Dir.exist? @card_content_dir
19
- File.write content_path(data), content.to_s
20
- end
21
-
22
- def content_path data
23
- filename = (data[:key] || data[:name]).to_name.safe_key
24
- File.join @card_content_dir, filename
25
- end
26
- end
27
- end
28
- end
29
- end
30
- end
@@ -1,119 +0,0 @@
1
- module Cardio
2
- class Migration
3
- class Import
4
- # Handles the card attributes and remotes for the import
5
- class ImportData
6
- include CardContent
7
- include CardAttributes
8
-
9
- # Takes a block to update import data
10
- # use #add_card and #add_remote in the block to make
11
- # changes
12
- def self.update data_path
13
- data = ImportData.new(data_path)
14
- yield(data)
15
- data.write_attributes
16
- end
17
-
18
- def self.load data_path, opts={}
19
- data = ImportData.new(data_path)
20
- if opts[:all]
21
- data.all_cards
22
- elsif opts[:only]
23
- data.select_cards opts[:only]
24
- else
25
- data.changed_cards
26
- end
27
- end
28
-
29
- def initialize data_path
30
- @path = File.join data_path, "cards.yml"
31
- @card_content_dir = File.join data_path, "cards"
32
- @data = read_attributes
33
- end
34
-
35
- def all_cards
36
- cards.map { |data| prepare_for_import data }
37
- end
38
-
39
- def select_cards names_or_keys
40
- names_or_keys.map do |key|
41
- attributes = find_card_attributes(key)
42
- unless attributes
43
- raise("no entry for #{key} (key: #{key.to_name.key}) in #{@path}")
44
- end
45
-
46
- prepare_for_import attributes
47
- end
48
- end
49
-
50
- def changed_cards
51
- cards.map do |data|
52
- next unless changed?(data)
53
-
54
- prepare_for_import data
55
- end.compact
56
- end
57
-
58
- # mark as merged
59
- def merged data, time
60
- update_attribute data["name"], :merged, time
61
- end
62
-
63
- # to be used in an update block
64
- def add_card card_data
65
- card_attr, card_content = split_attributes_and_content card_data
66
-
67
- update_card_attributes card_attr
68
- write_card_content card_attr, card_content
69
- card_attr
70
- end
71
-
72
- # to be used in an update block
73
- def add_remote name, url
74
- remotes[name] = url
75
- end
76
-
77
- def url remote_name
78
- remotes[remote_name.to_sym] || raise("unknown remote: #{remote_name}")
79
- end
80
-
81
- private
82
-
83
- def split_attributes_and_content data
84
- card_data = {}
85
- %i[name type codename].each do |key|
86
- card_data[key] = data[key] if data[key]
87
- end
88
- card_data[:key] = data[:name].to_name.key
89
- [card_data, data[:content]]
90
- end
91
-
92
- def remotes
93
- @data[:remotes]
94
- end
95
-
96
- def cards
97
- @data[:cards]
98
- end
99
-
100
- def prepare_for_import data
101
- hash = card_attributes(data)
102
- hash[:content] = card_content(data)
103
- %i[file image].each do |attach|
104
- hash[attach] &&= card_attachment(attach, data)
105
- end
106
- hash.with_indifferent_access
107
- end
108
-
109
- def changed? data
110
- !data[:merged] || content_changed?(data)
111
- end
112
-
113
- def card_attachment attach_type, data
114
- Cardio::Migration.data_path "files/#{data[attach_type]}"
115
- end
116
- end
117
- end
118
- end
119
- end
@@ -1,46 +0,0 @@
1
- module Cardio
2
- class Migration
3
- class Import
4
- # executes the card import
5
- class Merger
6
- def initialize data_path, opts={}
7
- @data_path = data_path
8
- @output_path = File.join data_path, "unmerged"
9
- @data = ImportData.load @data_path, opts
10
- end
11
-
12
- def merge
13
- puts("nothing to merge") && return if @data.empty?
14
-
15
- without_mail_deliveries do
16
- Card::Auth.as_bot do
17
- Card.merge_list @data, output_file: @output_path
18
- end
19
-
20
- update_import_data
21
- end
22
- end
23
-
24
- private
25
-
26
- def without_mail_deliveries
27
- m = Card::Mailer
28
- prior = m.perform_deliveries
29
- m.perform_deliveries = false
30
- yield
31
- ensure
32
- m.perform_deliveries = prior
33
- end
34
-
35
- def update_import_data
36
- update_time = Time.zone.now.to_s
37
- ImportData.update(@data_path) do |import_data|
38
- @data.each do |card_data|
39
- import_data.merged card_data, update_time
40
- end
41
- end
42
- end
43
- end
44
- end
45
- end
46
- end
@@ -1,125 +0,0 @@
1
- require_relative "import/import_data"
2
- require_relative "import/merger"
3
-
4
- module Cardio
5
- class Migration
6
- # Imports card data from a local or remote deck
7
- #
8
- # The cards' content for the import is stored for every card in a separate
9
- # file, other attributes like name or type are stored for all cards together
10
- # in a yml file.
11
- #
12
- # To update a card's content you only have to change the card's content
13
- # file. The merge method will recognize that the file was changed
14
- # since the last merge and merge it into the cards table
15
- # To update other attributes change them in the yml file and either remove
16
- # the 'merged' value or touch the corresponding content file
17
- class Import
18
- def initialize data_path
19
- @data_path = data_path
20
- end
21
-
22
- # Merge the import data into the cards table.
23
- # Bu default it merges only the data that was changed or added
24
- # since the last merge.
25
- # @param [Hash] opts choose which cards to merge
26
- # @option opts [Boolean] :all merge all available import data
27
- # @option opts [Array] :only a key/name or list of keys/names to
28
- # be merged
29
- def merge opts={}
30
- Merger.new(@data_path, opts).merge
31
- end
32
-
33
- # Get import data from a deck
34
- # @param [String] name The name of the card to be imported
35
- # @param [Hash] opts pull options
36
- # @option opts [String] remote Use a remote url. The remote url must
37
- # have been registered via 'add_remote'
38
- # @option opts [Boolean] deep if true fetch all nested cards, too
39
- # @option opts [Boolean] items_only if true fetch all nested cards but
40
- # not the card itself
41
- def pull name, opts={}
42
- update do |import_data|
43
- url = opts[:remote] ? import_data.url(opts.delete(:remote)) : nil
44
- fetch_card_data(name, url, opts).each do |card_data|
45
- import_data.add_card card_data
46
- end
47
- end
48
- end
49
-
50
- # Add a card with the given attributes to the import data
51
- def add_card attr
52
- update do |data|
53
- data.add_card attr
54
- end
55
- end
56
-
57
- # Save an url as remote deck to make it available for the pull method
58
- def add_remote name, url
59
- update do |data|
60
- data.add_remote name, url
61
- end
62
- end
63
-
64
- private
65
-
66
- def update &block
67
- ImportData.update @data_path, &block
68
- end
69
-
70
- def importer
71
- @importer ||= ImportData.new @data_path
72
- end
73
-
74
- # Returns an array of hashes with card attributes
75
- def fetch_card_data name, url, opts
76
- view, result_key = fetch_card_data_view_and_key opts
77
- card_data = fetch_all_card_data name, view, url
78
- result_key ? [card_data[result_key]] : card_data
79
- end
80
-
81
- def fetch_all_card_data name, view, url
82
- if url
83
- fetch_remote_data name, view, url
84
- else
85
- fetch_local_data name, view
86
- end
87
- end
88
-
89
- def fetch_card_data_view_and_key opts
90
- if opts[:items_only]
91
- ["export_items", nil]
92
- elsif opts[:deep]
93
- ["export", nil]
94
- else
95
- [nil, :card]
96
- end
97
- end
98
-
99
- def fetch_remote_data name, view, url
100
- json_url = "#{url}/#{name}.json"
101
- json_url += "?view=#{view}" if view
102
- json = open(json_url).read
103
- parse_and_symbolize json
104
- end
105
-
106
- def fetch_local_data name, view
107
- Card::Auth.as_bot do
108
- Card[name].format(format: :json).render!(view || :page)
109
- end
110
- end
111
-
112
- def parse_and_symbolize json
113
- parsed = JSON.parse(json)
114
- case parsed
115
- when Hash
116
- parsed.deep_symbolize_keys
117
- when Array
118
- parsed.map(&:deep_symbolize_keys)
119
- else
120
- parsed
121
- end
122
- end
123
- end
124
- end
125
- end
data/lib/tasks/card.rake DELETED
@@ -1,65 +0,0 @@
1
- require "optparse"
2
-
3
- namespace :card do
4
- desc "ingest card data from mod yaml"
5
- task eat: :environment do
6
- parse_options :eat do
7
- add_opt :m, :mod, "only merge cards in given mod"
8
- add_opt :e, :env, "environment of yaml source (default is current env)"
9
- add_opt :u, :user, "user to credit unless specified (otherwise uses Decko Bot)"
10
- flag_opt :v, :verbose, "progress info and error backtraces"
11
- end
12
- Cardio::Mod::Eat.new(**options).up
13
- exit 0
14
- end
15
-
16
- desc "export card data to mod yaml"
17
- task poop: :environment do
18
- parse_options :poop do
19
- add_opt :n, :name, "export card with name/mark (handles : and ~ prefixes)"
20
- flag_opt :i, :items, "also export card items (with -n)"
21
- flag_opt :o, :only_items, "also export card items (with -n)", items: :only
22
- add_opt :c, :cql, "export cards found by CQL (in JSON format)"
23
- add_opt :m, :mod, "output yaml to data/environment.yml file in mod"
24
- add_opt :e, :env, "environment to dump to (default is current env)"
25
- add_opt :t, :field_tags, "comma-separated list of field tag marks"
26
- end
27
- result = Cardio::Mod::Poop.new(**options).out
28
- exit 0 if result == :success
29
-
30
- puts "ERROR in card:poop\n #{result}".red
31
- exit 1
32
- end
33
-
34
- desc "reset cache"
35
- task reset_cache: :environment do
36
- Card::Cache.reset_all
37
- end
38
-
39
- def options
40
- @options ||= {}
41
- end
42
-
43
- def flag_opt letter, key, desc, hash=nil
44
- hash ||= { key => true }
45
- op.on("-#{letter}", "--#{key.to_s.tr '_', '-'}", desc) { options.merge! hash }
46
- end
47
-
48
- def add_opt letter, key, desc
49
- op.on "-#{letter}", "--#{key.to_s.tr '_', '-'} #{key.to_s.upcase}", desc do |val|
50
- options[key] = val
51
- end
52
- end
53
-
54
- def op
55
- @op ||= OptionParser.new
56
- end
57
-
58
- def parse_options task
59
- op.banner = "Usage: rake card:#{task} -- [options]"
60
- yield if block_given?
61
- args = op.order!(ARGV) {}
62
- # args << "-h" if args.empty?
63
- op.parse! args
64
- end
65
- end
@@ -1,4 +0,0 @@
1
- de:
2
- admin_warn: ADMINISTRATOR WARNUNG
3
- admin_email_off:
4
- E-Mail-Versand ist ausgeschaltet. Ändere die Einstellungen in %{path}, damit Benachrichtigungen verschickt werden, wenn sich neue Nutzer registrieren.
@@ -1,4 +0,0 @@
1
- en:
2
- admin_warn: ADMINISTRATOR WARNING
3
- admin_email_off:
4
- Email delivery is turned off. Change settings in %{path} to send sign up notifications.
@@ -1,16 +0,0 @@
1
-
2
- basket[:tasks] = []
3
-
4
- # to add an admin task:
5
- #
6
- # basket[:tasks] << {
7
- # name: NAME,
8
- # irreversible: TRUE/FALSE,
9
- # execute_policy: -> { TASK_CODE },
10
- # stats: {
11
- # title: TITLE_STRING,
12
- # count: -> { COUNT_CODE },
13
- # link_text: LINK_STRING,
14
- # task:
15
- # }
16
- # }