card 1.19.1 → 1.19.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +3 -3
- data/VERSION +1 -1
- data/db/migrate_core_cards/20160908154210_add_trash_card.rb +7 -0
- data/lib/card.rb +2 -2
- data/lib/card/act_manager.rb +143 -0
- data/lib/card/act_manager/stage.rb +56 -0
- data/lib/card/act_manager/stage_director.rb +313 -0
- data/lib/card/act_manager/subdirector_array.rb +43 -0
- data/lib/card/set.rb +1 -0
- data/lib/card/set/i18n_scope.rb +52 -0
- data/lib/card/subcards.rb +2 -3
- data/lib/cardio.rb +4 -4
- data/mod/admin/set/self/admin.rb +1 -2
- data/mod/admin/set/self/trash.rb +29 -0
- data/mod/core/set/abstract/code_file.rb +5 -25
- data/mod/core/set/all/actify.rb +35 -0
- data/mod/core/set/all/fetch.rb +12 -15
- data/mod/core/set/all/i18n.rb +9 -0
- data/mod/core/set/all/phases.rb +1 -1
- data/mod/core/set/all/stages.rb +2 -2
- data/mod/developer/set/all/event_viz.rb +2 -1
- data/mod/email/set/all/notify.rb +1 -1
- data/mod/history/lib/card/act.rb +1 -1
- data/mod/history/lib/card/action.rb +1 -1
- data/mod/history/set/all/history.rb +1 -1
- data/mod/machines/set/abstract/machine.rb +1 -1
- data/mod/machines/spec/set/type/coffeescript_spec.rb +1 -1
- data/mod/machines/spec/set/type/css_spec.rb +1 -1
- data/mod/machines/spec/set/type/javascript_spec.rb +1 -1
- data/mod/machines/spec/set/type/scss_spec.rb +1 -1
- data/mod/machines/spec/set/type/skin_spec.rb +1 -1
- data/mod/machines/spec/{lib/shared_machine_examples.rb → shared_examples/machine.rb} +15 -24
- data/mod/machines/spec/{lib/shared_machine_input_examples.rb → shared_examples/machine_input.rb} +0 -0
- data/mod/settings/spec/set/right/script_spec.rb +1 -1
- data/mod/settings/spec/set/right/style_spec.rb +1 -4
- data/mod/solid_cache/set/abstract/solid_cache.rb +1 -1
- data/spec/lib/card/content_spec.rb +118 -132
- data/spec/lib/card/i18n_spec.rb +6 -7
- data/spec/lib/card/query_spec.rb +5 -4
- data/spec/lib/card/stage_director_spec.rb +1 -1
- data/spec/spec_helper.rb +3 -4
- data/tmpsets/set/{mod002-core → mod001-core}/abstract/code_file.rb +0 -0
- data/tmpsets/set/{mod002-core → mod001-core}/all/actify.rb +0 -0
- data/tmpsets/set/{mod002-core → mod001-core}/all/active_card.rb +0 -0
- data/tmpsets/set/{mod002-core → mod001-core}/all/collection.rb +0 -0
- data/tmpsets/set/{mod002-core → mod001-core}/all/content.rb +0 -0
- data/tmpsets/set/{mod002-core → mod001-core}/all/erb.rb +0 -0
- data/tmpsets/set/{mod002-core → mod001-core}/all/event.rb +0 -0
- data/tmpsets/set/{mod002-core → mod001-core}/all/export.rb +0 -0
- data/tmpsets/set/{mod002-core → mod001-core}/all/fetch.rb +12 -14
- data/tmpsets/set/{mod002-core → mod001-core}/all/haml.rb +0 -0
- data/tmpsets/set/{mod002-core → mod001-core}/all/initialize.rb +0 -0
- data/tmpsets/set/{mod002-core → mod001-core}/all/location_history.rb +0 -0
- data/tmpsets/set/{mod002-core → mod001-core}/all/name.rb +0 -0
- data/tmpsets/set/{mod002-core → mod001-core}/all/name_validations.rb +0 -0
- data/tmpsets/set/{mod002-core → mod001-core}/all/pattern.rb +0 -0
- data/tmpsets/set/{mod002-core → mod001-core}/all/permissions.rb +0 -0
- data/tmpsets/set/{mod002-core → mod001-core}/all/phases.rb +0 -0
- data/tmpsets/set/{mod002-core → mod001-core}/all/references.rb +0 -0
- data/tmpsets/set/{mod002-core → mod001-core}/all/rules.rb +0 -0
- data/tmpsets/set/{mod002-core → mod001-core}/all/stages.rb +0 -0
- data/tmpsets/set/{mod002-core → mod001-core}/all/states.rb +0 -0
- data/tmpsets/set/{mod002-core → mod001-core}/all/subcards.rb +0 -0
- data/tmpsets/set/{mod002-core → mod001-core}/all/templating.rb +0 -0
- data/tmpsets/set/{mod002-core → mod001-core}/all/tracked_attributes.rb +0 -0
- data/tmpsets/set/{mod002-core → mod001-core}/all/trash.rb +0 -50
- data/tmpsets/set/{mod002-core → mod001-core}/all/type.rb +0 -0
- data/tmpsets/set/{mod002-core → mod001-core}/all/utils.rb +33 -0
- data/tmpsets/set/{mod002-core → mod001-core}/all/view_cache.rb +0 -0
- data/tmpsets/set/{mod003-history → mod002-history}/all/actions.rb +0 -0
- data/tmpsets/set/{mod003-history → mod002-history}/all/content_history.rb +0 -0
- data/tmpsets/set/{mod003-history → mod002-history}/all/history.rb +0 -0
- data/tmpsets/set/{mod004-basic_formats → mod003-basic_formats}/all/all_css.rb +0 -0
- data/tmpsets/set/{mod004-basic_formats → mod003-basic_formats}/all/all_csv.rb +0 -0
- data/tmpsets/set/{mod004-basic_formats → mod003-basic_formats}/all/all_js.rb +0 -0
- data/tmpsets/set/{mod004-basic_formats → mod003-basic_formats}/all/base.rb +0 -0
- data/tmpsets/set/{mod004-basic_formats → mod003-basic_formats}/all/file.rb +0 -0
- data/tmpsets/set/{mod004-basic_formats → mod003-basic_formats}/all/json.rb +0 -0
- data/tmpsets/set/{mod004-basic_formats → mod003-basic_formats}/all/rss.rb +0 -0
- data/tmpsets/set/{mod004-basic_formats → mod003-basic_formats}/all/text.rb +0 -0
- data/tmpsets/set/{mod004-basic_formats → mod003-basic_formats}/self/01_head/javascript.rb +0 -0
- data/tmpsets/set/{mod004-basic_formats → mod003-basic_formats}/self/head.rb +1 -1
- data/tmpsets/set/{mod005-pointer → mod004-pointer}/abstract/01_pointer.rb +0 -0
- data/tmpsets/set/{mod005-pointer → mod004-pointer}/abstract/01_pointer/edit.rb +0 -0
- data/tmpsets/set/{mod005-pointer → mod004-pointer}/abstract/code_pointer.rb +0 -0
- data/tmpsets/set/{mod005-pointer → mod004-pointer}/self/script_editors.rb +0 -0
- data/tmpsets/set/{mod005-pointer → mod004-pointer}/self/script_mods.rb +0 -0
- data/tmpsets/set/{mod005-pointer → mod004-pointer}/self/script_pointer_config.rb +0 -0
- data/tmpsets/set/{mod005-pointer → mod004-pointer}/type/pointer.rb +0 -0
- data/tmpsets/set/{mod006-ace_editor → mod005-ace_editor}/abstract/ace_editor.rb +0 -0
- data/tmpsets/set/{mod006-ace_editor → mod005-ace_editor}/self/script_ace.rb +0 -0
- data/tmpsets/set/{mod006-ace_editor → mod005-ace_editor}/self/script_ace_config.rb +0 -0
- data/tmpsets/set/{mod007-prosemirror_editor → mod006-prosemirror_editor}/abstract/prosemirror_editor.rb +0 -0
- data/tmpsets/set/{mod007-prosemirror_editor → mod006-prosemirror_editor}/self/script_prosemirror.rb +0 -0
- data/tmpsets/set/{mod007-prosemirror_editor → mod006-prosemirror_editor}/self/script_prosemirror_config.rb +0 -0
- data/tmpsets/set/{mod009-solid_cache → mod008-solid_cache}/abstract/solid_cache.rb +1 -1
- data/tmpsets/set/{mod009-solid_cache → mod008-solid_cache}/all/solid_cache.rb +0 -0
- data/tmpsets/set/{mod009-solid_cache → mod008-solid_cache}/right/solid_cache.rb +0 -0
- data/tmpsets/set/{mod010-basic_types → mod009-basic_types}/type/html.rb +0 -0
- data/tmpsets/set/{mod010-basic_types → mod009-basic_types}/type/plain_text.rb +0 -0
- data/tmpsets/set/{mod011-machines → mod010-machines}/abstract/script.rb +0 -0
- data/tmpsets/set/{mod011-machines → mod010-machines}/all/reset_machines.rb +0 -0
- data/tmpsets/set/{mod011-machines → mod010-machines}/right/machine_cache.rb +0 -0
- data/tmpsets/set/{mod011-machines → mod010-machines}/right/machine_input.rb +0 -0
- data/tmpsets/set/{mod011-machines → mod010-machines}/right/machine_output.rb +1 -9
- data/tmpsets/set/{mod011-machines → mod010-machines}/self/script_card_menu.rb +0 -0
- data/tmpsets/set/{mod011-machines → mod010-machines}/self/script_html5shiv_printshiv.rb +0 -0
- data/tmpsets/set/{mod011-machines → mod010-machines}/self/script_jquery.rb +0 -0
- data/tmpsets/set/{mod011-machines → mod010-machines}/self/script_jquery_helper.rb +0 -0
- data/tmpsets/set/{mod011-machines → mod010-machines}/self/script_slot.rb +0 -0
- data/tmpsets/set/{mod011-machines → mod010-machines}/self/style_bootstrap_compatible.rb +0 -0
- data/tmpsets/set/{mod011-machines → mod010-machines}/self/style_cards.rb +0 -0
- data/tmpsets/set/{mod011-machines → mod010-machines}/self/style_jquery_ui_smoothness.rb +0 -0
- data/tmpsets/set/{mod011-machines → mod010-machines}/type/coffee_script.rb +6 -2
- data/tmpsets/set/{mod011-machines → mod010-machines}/type/css.rb +2 -2
- data/tmpsets/set/{mod011-machines → mod010-machines}/type/java_script.rb +2 -2
- data/tmpsets/set/{mod011-machines → mod010-machines}/type/scss.rb +0 -0
- data/tmpsets/set/{mod011-machines → mod010-machines}/type/skin.rb +2 -2
- data/tmpsets/set/{mod012-settings → mod011-settings}/abstract/permission.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/right/add_help.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/right/comment.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/right/create.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/right/default.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/right/delete.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/right/help.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/right/read.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/right/script.rb +1 -1
- data/tmpsets/set/{mod012-settings → mod011-settings}/right/structure.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/right/style.rb +1 -1
- data/tmpsets/set/{mod012-settings → mod011-settings}/right/update.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/self/accountable.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/self/add_help.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/self/autoname.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/self/captcha.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/self/create.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/self/default.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/self/default_html_view.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/self/delete.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/self/follow_fields.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/self/help.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/self/input.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/self/layout.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/self/on_create.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/self/on_delete.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/self/on_update.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/self/options.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/self/options_label.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/self/read.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/self/recent_settings.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/self/script.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/self/structure.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/self/style.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/self/table_of_contents.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/self/thanks.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/self/update.rb +0 -0
- data/tmpsets/set/{mod012-settings → mod011-settings}/type/setting.rb +0 -0
- data/tmpsets/set/{mod013-email → mod012-email}/all/email_html.rb +0 -0
- data/tmpsets/set/{mod013-email → mod012-email}/all/email_text.rb +0 -0
- data/tmpsets/set/{mod013-email → mod012-email}/all/follow.rb +0 -0
- data/tmpsets/set/{mod013-email → mod012-email}/all/notify.rb +0 -0
- data/tmpsets/set/{mod013-email → mod012-email}/all/observer.rb +0 -0
- data/tmpsets/set/{mod013-email → mod012-email}/right/bcc.rb +0 -0
- data/tmpsets/set/{mod013-email → mod012-email}/right/cc.rb +0 -0
- data/tmpsets/set/{mod013-email → mod012-email}/right/follow.rb +0 -0
- data/tmpsets/set/{mod013-email → mod012-email}/right/follow_fields.rb +0 -0
- data/tmpsets/set/{mod013-email → mod012-email}/right/followers.rb +0 -0
- data/tmpsets/set/{mod013-email → mod012-email}/right/following.rb +0 -0
- data/tmpsets/set/{mod013-email → mod012-email}/right/from.rb +0 -0
- data/tmpsets/set/{mod013-email → mod012-email}/right/html_message.rb +0 -0
- data/tmpsets/set/{mod013-email → mod012-email}/right/to.rb +0 -0
- data/tmpsets/set/{mod013-email → mod012-email}/self/always.rb +0 -0
- data/tmpsets/set/{mod013-email → mod012-email}/self/created.rb +0 -0
- data/tmpsets/set/{mod013-email → mod012-email}/self/edited.rb +0 -0
- data/tmpsets/set/{mod013-email → mod012-email}/self/follow.rb +0 -0
- data/tmpsets/set/{mod013-email → mod012-email}/self/follow_defaults.rb +0 -0
- data/tmpsets/set/{mod013-email → mod012-email}/self/never.rb +0 -0
- data/tmpsets/set/{mod013-email → mod012-email}/type/email_template.rb +0 -0
- data/tmpsets/set/{mod013-email → mod012-email}/type_plus_right/user/follow.rb +8 -4
- data/tmpsets/set/mod016-standard/all/links.rb +2 -2
- data/tmpsets/set/mod018-bootstrap/all/bootstrap/table.rb +1 -1
- data/tmpsets/set/mod018-bootstrap/self/bootswatch_shared.rb +1 -1
- metadata +149 -163
- data/lib/card/director_register.rb +0 -101
- data/lib/card/stage.rb +0 -106
- data/lib/card/stage_director.rb +0 -310
- data/lib/card/subdirector_array.rb +0 -43
- data/tmpsets/set/mod001-admin/self/admin.rb +0 -130
- data/tmpsets/set/mod001-admin/self/admin_info.rb +0 -110
- data/tmpsets/set/mod001-admin/self/version.rb +0 -15
- data/tmpsets/set/mod002-core/all/debug.rb +0 -30
- data/tmpsets/set/mod002-core/all/update_read_rules.rb +0 -91
- data/tmpsets/set/mod011-machines/abstract/machine.rb +0 -277
- data/tmpsets/set/mod011-machines/abstract/machine_input.rb +0 -83
- data/tmpsets/set/mod014-developer/all/event_viz.rb +0 -59
- data/tmpsets/set/mod014-developer/all/view_viz.rb +0 -30
- data/tmpsets/set/mod014-developer/right/debug.rb +0 -96
- data/tmpsets/set/mod015-carrierwave/abstract/attachment.rb +0 -118
- data/tmpsets/set/mod015-carrierwave/abstract/attachment/paths.rb +0 -57
- data/tmpsets/set/mod015-carrierwave/abstract/attachment/storage_type.rb +0 -326
- data/tmpsets/set/mod015-carrierwave/abstract/attachment/upload_cache.rb +0 -84
- data/tmpsets/set/mod015-carrierwave/all/file_utils.rb +0 -35
- data/tmpsets/set/mod015-carrierwave/self/admin.rb +0 -30
- data/tmpsets/set/mod015-carrierwave/type/file.rb +0 -158
- data/tmpsets/set/mod015-carrierwave/type/image.rb +0 -97
data/spec/lib/card/i18n_spec.rb
CHANGED
@@ -6,14 +6,13 @@ if use_i18_tasks
|
|
6
6
|
require "i18n/tasks"
|
7
7
|
end
|
8
8
|
|
9
|
-
# Note: I18n::Tasks only knows how to function when run from root of Card GEM,
|
10
|
-
# since it locates its configuration file and source to parse relative to this
|
11
|
-
|
12
|
-
def card_gem_root
|
13
|
-
Pathname(__FILE__).parent.parent.parent.parent.to_s
|
14
|
-
end
|
15
|
-
|
16
9
|
RSpec.describe "I18n" do
|
10
|
+
# Note: I18n::Tasks only knows how to function when run from root of Card GEM,
|
11
|
+
# since it locates its configuration file and source to parse relative to this
|
12
|
+
def card_gem_root
|
13
|
+
Pathname(__FILE__).parent.parent.parent.parent.to_s
|
14
|
+
end
|
15
|
+
|
17
16
|
if use_i18_tasks
|
18
17
|
let(:i18n) { Dir.chdir(card_gem_root) { I18n::Tasks::BaseTask.new } }
|
19
18
|
let(:missing_keys) { Dir.chdir(card_gem_root) { i18n.missing_keys } }
|
data/spec/lib/card/query_spec.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
|
3
|
-
A_JOINEES = %w(B C D E F).freeze
|
4
|
-
CARDS_MATCHING_TWO = ["Joe User", "One+Two", "One+Two+Three",
|
5
|
-
"script: slot+*all+*script+*machine cache", "Two"].freeze
|
6
|
-
|
7
3
|
describe Card::Query do
|
4
|
+
A_JOINEES = %w(B C D E F).freeze
|
5
|
+
CARDS_MATCHING_TWO = ["Joe User", "One+Two", "One+Two+Three",
|
6
|
+
"script: slot+*all+*script+*machine cache",
|
7
|
+
"Two"].freeze
|
8
|
+
|
8
9
|
subject do
|
9
10
|
Card::Query.run @query.reverse_merge return: :name, sort: :name
|
10
11
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -11,10 +11,9 @@ require File.expand_path("../../db/seed/test/seed.rb", __FILE__)
|
|
11
11
|
require File.expand_path("../../config/simplecov_helper.rb", __FILE__)
|
12
12
|
require "simplecov"
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
require
|
17
|
-
"shared_machine_input_examples.rb", __FILE__)
|
14
|
+
shared_example_dir =
|
15
|
+
File.expand_path("../../mod/machines/spec/shared_examples", __FILE__)
|
16
|
+
Dir["#{shared_example_dir}**/*.rb"].sort.each { |f| require f }
|
18
17
|
|
19
18
|
Spork.prefork do
|
20
19
|
if ENV["RAILS_ROOT"]
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -11,20 +11,18 @@ module ClassMethods
|
|
11
11
|
# * database
|
12
12
|
# * virtual cards
|
13
13
|
#
|
14
|
-
# @param
|
15
|
-
# one of three unique identifiers
|
16
|
-
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
24
|
-
#
|
25
|
-
#
|
26
|
-
# :local_only Use only local cache for lookup and storing
|
27
|
-
# new: { opts for Card#new } Return a new card when not found
|
14
|
+
# @param args [Integer, String, Card::Name, Symbol]
|
15
|
+
# one or more of the three unique identifiers
|
16
|
+
# 1. a numeric id (Integer)
|
17
|
+
# 2. a name/key (String or Card::Name)
|
18
|
+
# 3. a codename (Symbol)
|
19
|
+
# If you pass more then one mark they get joined with a '+'.
|
20
|
+
# The final argument can be a hash to set the following options
|
21
|
+
# :skip_virtual Real cards only
|
22
|
+
# :skip_modules Don't load Set modules
|
23
|
+
# :look_in_trash Return trashed card objects
|
24
|
+
# :local_only Use only local cache for lookup and storing
|
25
|
+
# new: { opts for Card#new } Return a new card when not found
|
28
26
|
#
|
29
27
|
# @return [Card]
|
30
28
|
def fetch *args
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,56 +1,6 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
class Card; module Set; class All; module Trash; extend Card::Set
|
3
3
|
# ~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/core/set/all/trash.rb ~~
|
4
|
-
Self::Admin.add_to_basket(
|
5
|
-
:tasks,
|
6
|
-
name: :empty_trash,
|
7
|
-
execute_policy: -> { Card.empty_trash },
|
8
|
-
stats: {
|
9
|
-
title: "trashed cards",
|
10
|
-
count: -> { Card.where(trash: true) },
|
11
|
-
link_text: "delete all",
|
12
|
-
task: "empty_trash"
|
13
|
-
}
|
14
|
-
)
|
15
|
-
|
16
|
-
module ClassMethods
|
17
|
-
def empty_trash
|
18
|
-
Card.delete_trashed_files
|
19
|
-
Card.where(trash: true).delete_all
|
20
|
-
Card::Action.delete_cardless
|
21
|
-
Card::Reference.unmap_if_referee_missing
|
22
|
-
Card::Reference.delete_if_referer_missing
|
23
|
-
end
|
24
|
-
|
25
|
-
# deletes any file not associated with a real card.
|
26
|
-
def delete_trashed_files
|
27
|
-
dir = Cardio.paths["files"].existent.first
|
28
|
-
# TODO: handle cloud files
|
29
|
-
return unless dir
|
30
|
-
|
31
|
-
trashed_card_ids = all_trashed_card_ids
|
32
|
-
file_ids = all_file_ids
|
33
|
-
file_ids.each do |file_id|
|
34
|
-
next unless trashed_card_ids.member?(file_id)
|
35
|
-
if Card.exists?(file_id) # double check!
|
36
|
-
raise Card::Error, "Narrowly averted deleting current file"
|
37
|
-
end
|
38
|
-
FileUtils.rm_rf "#{dir}/#{file_id}", secure: true
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
def all_file_ids
|
43
|
-
dir = Card.paths["files"].existent.first
|
44
|
-
Dir.entries(dir)[2..-1].map(&:to_i)
|
45
|
-
end
|
46
|
-
|
47
|
-
def all_trashed_card_ids
|
48
|
-
trashed_card_sql = %( select id from cards where trash is true )
|
49
|
-
sql_results = Card.connection.select_all(trashed_card_sql)
|
50
|
-
sql_results.map(&:values).flatten.map(&:to_i)
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
4
|
def delete
|
55
5
|
update_attributes trash: true unless new_card?
|
56
6
|
end
|
File without changes
|
@@ -2,6 +2,28 @@
|
|
2
2
|
class Card; module Set; class All; module Utils; extend Card::Set
|
3
3
|
# ~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/core/set/all/utils.rb ~~
|
4
4
|
module ClassMethods
|
5
|
+
def empty_trash
|
6
|
+
Card.delete_trashed_files
|
7
|
+
Card.where(trash: true).delete_all
|
8
|
+
Card::Action.delete_cardless
|
9
|
+
Card::Reference.unmap_if_referee_missing
|
10
|
+
Card::Reference.delete_if_referer_missing
|
11
|
+
end
|
12
|
+
|
13
|
+
# deletes any file not associated with a real card.
|
14
|
+
def delete_trashed_files
|
15
|
+
trashed_card_ids = all_trashed_card_ids
|
16
|
+
file_ids = all_file_ids
|
17
|
+
dir = Cardio.paths["files"].existent.first
|
18
|
+
file_ids.each do |file_id|
|
19
|
+
next unless trashed_card_ids.member?(file_id)
|
20
|
+
if Card.exists?(file_id) # double check!
|
21
|
+
raise Card::Error, "Narrowly averted deleting current file"
|
22
|
+
end
|
23
|
+
FileUtils.rm_rf "#{dir}/#{file_id}", secure: true
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
5
27
|
def delete_tmp_files id=nil
|
6
28
|
dir = Cardio.paths["files"].existent.first + "/tmp"
|
7
29
|
dir += "/#{id}" if id
|
@@ -10,6 +32,17 @@ module ClassMethods
|
|
10
32
|
Rails.logger.info "failed to remove tmp files"
|
11
33
|
end
|
12
34
|
|
35
|
+
def all_file_ids
|
36
|
+
dir = Card.paths["files"].existent.first
|
37
|
+
Dir.entries(dir)[2..-1].map(&:to_i)
|
38
|
+
end
|
39
|
+
|
40
|
+
def all_trashed_card_ids
|
41
|
+
trashed_card_sql = %( select id from cards where trash is true )
|
42
|
+
sql_results = Card.connection.select_all(trashed_card_sql)
|
43
|
+
sql_results.map(&:values).flatten.map(&:to_i)
|
44
|
+
end
|
45
|
+
|
13
46
|
def merge_list attribs, opts={}
|
14
47
|
unmerged = []
|
15
48
|
attribs.each do |row|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -54,7 +54,7 @@ format :html do
|
|
54
54
|
if params[:debug] == "style"
|
55
55
|
page_path(style_card.cardname, item: :import, format: :css)
|
56
56
|
elsif style_card
|
57
|
-
style_card.machine_output_url
|
57
|
+
card_path style_card.machine_output_url
|
58
58
|
end
|
59
59
|
return unless @css_path
|
60
60
|
%(<link href="#{@css_path}" media="all" rel="stylesheet" type="text/css" />)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/tmpsets/set/{mod007-prosemirror_editor → mod006-prosemirror_editor}/self/script_prosemirror.rb
RENAMED
File without changes
|
File without changes
|
@@ -31,7 +31,7 @@ module ClassMethods
|
|
31
31
|
# cards whose solid caches are expired because of the update.
|
32
32
|
# @param set_of_changed_card [set constant] a set of cards that triggers
|
33
33
|
# a cache update
|
34
|
-
# @
|
34
|
+
# @param args [Hash]
|
35
35
|
# @option args [Symbol, Array of symbols] :on the action(s)
|
36
36
|
# (:create, :update, or :delete) on which the cache update
|
37
37
|
# should be triggered. Default is all actions.
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -9,14 +9,6 @@ def history?
|
|
9
9
|
false
|
10
10
|
end
|
11
11
|
|
12
|
-
event :remove_codename, :prepare_to_validate,
|
13
|
-
on: :delete,
|
14
|
-
when: proc { |c| c.codename.present? } do
|
15
|
-
# load file before deleting codename otherwise it will fail later
|
16
|
-
attachment
|
17
|
-
self.codename = nil
|
18
|
-
end
|
19
|
-
|
20
12
|
format do
|
21
13
|
view :not_found do |args|
|
22
14
|
if update_machine_output_live?
|
@@ -31,7 +23,7 @@ format do
|
|
31
23
|
|
32
24
|
def update_machine_output_live?
|
33
25
|
case
|
34
|
-
when !card.left.is_a?(
|
26
|
+
when !card.left.is_a?(Machine) then false # must be a machine
|
35
27
|
when card.left.locked? then false # machine must not be running
|
36
28
|
when card.new_card? then true # always update if new
|
37
29
|
else
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -5,8 +5,12 @@ class Card; module Set; class Type; module CoffeeScript; extend Card::Set
|
|
5
5
|
require "coffee-script"
|
6
6
|
|
7
7
|
include_set Abstract::Script
|
8
|
-
|
9
|
-
|
8
|
+
|
9
|
+
require_dependency "card/machine"
|
10
|
+
require_dependency "card/machine_input"
|
11
|
+
|
12
|
+
include Machine
|
13
|
+
include MachineInput
|
10
14
|
|
11
15
|
store_machine_output filetype: "js"
|
12
16
|
|
@@ -3,8 +3,8 @@ class Card; module Set; class Type; module Css; extend Card::Set
|
|
3
3
|
# ~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/machines/set/type/css.rb ~~
|
4
4
|
# -*- encoding : utf-8 -*-
|
5
5
|
require "sass"
|
6
|
-
|
7
|
-
|
6
|
+
include Machine
|
7
|
+
include MachineInput
|
8
8
|
include_set Abstract::AceEditor
|
9
9
|
|
10
10
|
store_machine_output filetype: "css"
|
@@ -5,8 +5,8 @@ class Card; module Set; class Type; module JavaScript; extend Card::Set
|
|
5
5
|
|
6
6
|
include_set Abstract::Script
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
include Machine
|
9
|
+
include MachineInput
|
10
10
|
|
11
11
|
store_machine_output filetype: "js"
|
12
12
|
|
File without changes
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
class Card; module Set; class Type; module Skin; extend Card::Set
|
3
3
|
# ~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/machines/set/type/skin.rb ~~
|
4
|
-
|
5
|
-
|
4
|
+
include Machine
|
5
|
+
include MachineInput
|
6
6
|
|
7
7
|
store_machine_output filetype: "css"
|
8
8
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|