card 1.19.6 → 1.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/card.gemspec +8 -7
- data/config/initializers/01_core_extensions/array.rb +4 -0
- data/config/initializers/01_core_extensions/persistent_identifiers.rb +12 -0
- data/config/initializers/02_patches/better_errors.rb +56 -0
- data/config/initializers/core_extensions.rb +13 -18
- data/config/initializers/patches.rb +8 -0
- data/config/locales/de.yml +0 -2
- data/db/migrate_core_cards/20150202143810_import_bootstrap_layout.rb +22 -12
- data/db/migrate_core_cards/20161102202156_tweak_recaptcha_setting_cards.rb +17 -0
- data/db/migrate_core_cards/20161103154836_update_keys.rb +46 -0
- data/lib/card.rb +1 -8
- data/lib/card/act_manager.rb +4 -0
- data/lib/card/auth/permissions.rb +5 -3
- data/lib/card/cache.rb +1 -20
- data/lib/card/cache/persistent.rb +6 -0
- data/lib/card/content/chunk.rb +4 -3
- data/lib/card/content/diff.rb +2 -2
- data/lib/card/content/diff/result.rb +11 -0
- data/lib/card/env/success.rb +4 -0
- data/lib/card/error.rb +2 -0
- data/lib/card/format.rb +14 -17
- data/lib/card/format/content.rb +16 -8
- data/lib/card/format/error.rb +3 -5
- data/lib/card/format/names.rb +22 -16
- data/lib/card/format/nest.rb +67 -61
- data/lib/card/format/nest/fetch.rb +40 -33
- data/lib/card/format/nest/main.rb +39 -19
- data/lib/card/format/nest/subformat.rb +3 -16
- data/lib/card/format/nest/view.rb +23 -32
- data/lib/card/format/permission.rb +49 -34
- data/lib/card/format/registration.rb +12 -6
- data/lib/card/format/render.rb +62 -73
- data/lib/card/migration.rb +14 -10
- data/lib/card/migration/import.rb +20 -19
- data/lib/card/migration/import/import_data.rb +50 -59
- data/lib/card/migration/import/import_data/card_attributes.rb +56 -0
- data/lib/card/migration/import/import_data/card_content.rb +33 -0
- data/lib/card/migration/import/merger.rb +47 -0
- data/lib/card/mod/loader.rb +4 -4
- data/lib/card/model/save_helper.rb +49 -10
- data/lib/card/name.rb +16 -52
- data/lib/card/name/fields_and_traits.rb +67 -0
- data/lib/card/name/variants.rb +17 -0
- data/lib/card/query.rb +6 -2
- data/lib/card/query/attributes.rb +1 -1
- data/lib/card/query/interpretation.rb +3 -3
- data/lib/card/set/event.rb +2 -1
- data/lib/card/set/format.rb +18 -7
- data/lib/card/set_pattern.rb +17 -13
- data/lib/card/tasks/card.rake +1 -1
- data/lib/card/view.rb +55 -0
- data/lib/card/view/cache.rb +90 -0
- data/lib/card/view/fetch.rb +109 -0
- data/lib/card/view/options.rb +164 -0
- data/lib/card/view/stub.rb +30 -0
- data/lib/card/view/visibility.rb +95 -0
- data/lib/cardio.rb +3 -2
- data/lib/cardio/schema.rb +21 -8
- data/lib/generators/card.rb +16 -2
- data/lib/generators/card/format/format_generator.rb +10 -9
- data/lib/generators/card/migration/migration_generator.rb +10 -5
- data/lib/generators/card/set/USAGE +1 -1
- data/lib/generators/card/set/set_generator.rb +11 -9
- data/mod/account/set/right/account.rb +38 -40
- data/mod/account/set/right/token.rb +2 -1
- data/mod/account/set/self/account_links.rb +34 -54
- data/mod/account/set/self/signin.rb +107 -93
- data/mod/account/set/type/signup.rb +33 -32
- data/mod/account/set/type/user.rb +28 -21
- data/mod/account/spec/set/all/account_spec.rb +9 -9
- data/mod/account/spec/set/right/account_spec.rb +23 -14
- data/mod/account/spec/set/right/email_spec.rb +6 -6
- data/mod/account/spec/set/right/password_spec.rb +4 -4
- data/mod/account/spec/set/right/token_spec.rb +3 -3
- data/mod/account/spec/set/self/account_links_spec.rb +3 -3
- data/mod/account/spec/set/self/signin_spec.rb +2 -2
- data/mod/account/spec/set/type/signup_spec.rb +7 -8
- data/mod/ace_editor/set/abstract/ace_editor.rb +1 -4
- data/mod/admin/set/self/admin.rb +2 -2
- data/mod/admin/set/self/admin_info.rb +1 -1
- data/mod/admin/set/self/recaptcha_private_key.rb +3 -0
- data/mod/admin/set/self/recaptcha_proxy.rb +3 -0
- data/mod/admin/set/self/recaptcha_public_key.rb +3 -0
- data/mod/admin/set/self/trash.rb +4 -4
- data/mod/admin/spec/set/self/admin_spec.rb +4 -4
- data/mod/admin/spec/set/self/version_spec.rb +1 -1
- data/mod/basic_formats/set/all/all_css.rb +3 -3
- data/mod/basic_formats/set/all/all_csv.rb +6 -6
- data/mod/basic_formats/set/all/all_js.rb +4 -0
- data/mod/basic_formats/set/all/base.rb +40 -62
- data/mod/basic_formats/set/all/json.rb +34 -39
- data/mod/basic_formats/set/all/rss.rb +6 -6
- data/mod/basic_formats/set/all/text.rb +3 -2
- data/mod/basic_formats/set/self/01_head/javascript.rb +2 -2
- data/mod/basic_formats/set/self/head.rb +6 -10
- data/mod/basic_formats/spec/set/all/all_css_spec.rb +1 -1
- data/mod/basic_formats/spec/set/all/all_csv_spec.rb +1 -1
- data/mod/basic_formats/spec/set/all/base_spec.rb +8 -5
- data/mod/basic_formats/spec/set/all/json_spec.rb +2 -2
- data/mod/basic_formats/spec/set/all/rss_spec.rb +4 -4
- data/mod/basic_types/set/type/plain_text.rb +3 -5
- data/mod/basic_types/spec/set/type/plain_text_spec.rb +2 -2
- data/mod/bootstrap/lib/bootstrap.rb +16 -0
- data/mod/bootstrap/lib/bootstrap/basic_tags.rb +26 -0
- data/mod/bootstrap/lib/bootstrap/component.rb +133 -0
- data/mod/bootstrap/lib/bootstrap/component/form.rb +31 -0
- data/mod/bootstrap/lib/bootstrap/component/horizontal_form.rb +38 -0
- data/mod/bootstrap/lib/bootstrap/component/layout.rb +83 -0
- data/mod/bootstrap/lib/bootstrap/component/panel.rb +9 -0
- data/mod/bootstrap/lib/bootstrap/component_loader.rb +30 -0
- data/mod/bootstrap/lib/bootstrap/delegate.rb +16 -0
- data/mod/bootstrap/lib/bootstrapper.rb +16 -0
- data/mod/bootstrap/lib/stylesheets/bootstrap/_tables.scss +55 -52
- data/mod/bootstrap/lib/stylesheets/bootstrap/mixins/_table-row.scss +12 -12
- data/mod/bootstrap/lib/stylesheets/bootstrap_cards.scss +12 -0
- data/mod/bootstrap/set/all/bootstrap/accordion.rb +63 -0
- data/mod/bootstrap/set/all/bootstrap/helper.rb +7 -140
- data/mod/bootstrap/set/all/bootstrap/navbar.rb +74 -0
- data/mod/bootstrap/set/all/bootstrap/table.rb +76 -46
- data/mod/bootstrap/set/all/bootstrap/tabs.rb +58 -23
- data/mod/bootstrap/set/all/bootstrap/wrapper.rb +14 -8
- data/mod/bootstrap/set/all/rich_bootstrap.rb +5 -3
- data/mod/bootstrap/spec/set/all/bootstrap/bootstrap_builder_spec.rb +31 -0
- data/mod/bootstrap/spec/set/all/bootstrap/bootstrap_spec.rb +20 -0
- data/mod/bootstrap/spec/set/all/bootstrap/form_spec.rb +59 -1
- data/mod/bootstrap/spec/set/all/bootstrap/layout_spec.rb +104 -15
- data/mod/carrierwave/set/abstract/attachment.rb +4 -3
- data/mod/carrierwave/set/abstract/attachment/paths.rb +1 -1
- data/mod/carrierwave/set/abstract/attachment/storage_type.rb +5 -11
- data/mod/carrierwave/set/type/file.rb +39 -32
- data/mod/carrierwave/set/type/image.rb +59 -34
- data/mod/carrierwave/spec/set/type/image_spec.rb +3 -3
- data/mod/core/chunk/link.rb +5 -0
- data/mod/core/chunk/{include.rb → nest.rb} +8 -29
- data/mod/core/chunk/reference.rb +5 -6
- data/mod/core/chunk/view_stub.rb +42 -0
- data/mod/core/format/html_format.rb +23 -26
- data/mod/core/set/abstract/code_file.rb +1 -1
- data/mod/core/set/all/actify.rb +1 -1
- data/mod/core/set/all/active_card.rb +0 -1
- data/mod/core/set/all/{tracked_attributes.rb → assign_attributes.rb} +55 -24
- data/mod/core/set/all/collection.rb +136 -122
- data/mod/core/set/all/content.rb +8 -0
- data/mod/core/set/all/event.rb +5 -2
- data/mod/core/set/all/export.rb +7 -7
- data/mod/core/set/all/fetch.rb +90 -26
- data/mod/core/set/all/initialize.rb +17 -6
- data/mod/core/set/all/name.rb +2 -3
- data/mod/core/set/all/permissions.rb +19 -11
- data/mod/core/set/all/states.rb +12 -2
- data/mod/core/set/all/trash.rb +1 -1
- data/mod/core/set/all/type.rb +2 -0
- data/mod/core/set/all/utils.rb +4 -3
- data/mod/core/spec/chunk/literal_spec.rb +2 -2
- data/mod/core/spec/chunk/uri_spec.rb +17 -17
- data/mod/core/spec/format/html_format_spec.rb +11 -13
- data/mod/core/spec/set/all/attribute_tracking_spec.rb +2 -2
- data/mod/core/spec/set/all/collection_spec.rb +21 -24
- data/mod/core/spec/set/all/content_spec.rb +1 -1
- data/mod/core/spec/set/all/export_spec.rb +3 -3
- data/mod/core/spec/set/all/fetch_spec.rb +5 -5
- data/mod/core/spec/set/all/initialize_spec.rb +4 -4
- data/mod/core/spec/set/all/name_spec.rb +6 -6
- data/mod/core/spec/set/all/permissions_spec.rb +10 -10
- data/mod/core/spec/set/all/references_spec.rb +1 -1
- data/mod/core/spec/set/all/rules2_spec.rb +24 -24
- data/mod/core/spec/set/all/rules_spec.rb +1 -1
- data/mod/core/spec/set/all/templating_spec.rb +8 -8
- data/mod/core/spec/set/all/tracked_attributes_spec.rb +6 -6
- data/mod/core/spec/set/all/type_spec.rb +5 -5
- data/mod/developer/spec/set/all/event_viz_spec.rb +1 -1
- data/mod/developer/spec/set/right/debug_spec.rb +1 -1
- data/mod/email/set/all/email_html.rb +2 -2
- data/mod/email/set/all/notify.rb +8 -3
- data/mod/email/set/right/bcc.rb +3 -3
- data/mod/email/set/right/follow.rb +5 -5
- data/mod/email/set/right/following.rb +1 -1
- data/mod/email/set/self/follow_defaults.rb +27 -16
- data/mod/email/set/type/email_template.rb +1 -1
- data/mod/email/set/type_plus_right/user/follow.rb +10 -9
- data/mod/history/lib/card/act.rb +4 -0
- data/mod/history/lib/card/act/act_renderer.rb +194 -0
- data/mod/history/lib/card/act/act_renderer/absolute_act_renderer.rb +25 -0
- data/mod/history/lib/card/act/act_renderer/relative_act_renderer.rb +41 -0
- data/mod/history/lib/card/action.rb +1 -0
- data/mod/history/lib/card/action/action_renderer.rb +92 -0
- data/mod/history/lib/card/action/differ.rb +6 -1
- data/mod/history/set/all/act_view.rb +64 -0
- data/mod/history/set/all/action_view.rb +65 -0
- data/mod/history/set/all/content_history.rb +44 -37
- data/mod/history/set/all/history.rb +49 -263
- data/mod/machines/lib/stylesheets/style_cards.scss +30 -115
- data/mod/machines/set/abstract/script.rb +42 -7
- data/mod/machines/set/right/machine_input.rb +4 -0
- data/mod/machines/set/type/coffee_script.rb +8 -22
- data/mod/machines/set/type/css.rb +2 -2
- data/mod/machines/set/type/java_script.rb +4 -24
- data/mod/machines/set/type/scss.rb +1 -1
- data/mod/machines/spec/set/type/css_spec.rb +1 -1
- data/mod/machines/spec/set/type/scss_spec.rb +3 -3
- data/mod/machines/spec/set/type/skin_spec.rb +7 -7
- data/mod/pointer/set/abstract/01_pointer.rb +44 -46
- data/mod/pointer/set/abstract/01_pointer/edit.rb +13 -13
- data/mod/pointer/set/right/options.rb +4 -0
- data/mod/pointer/spec/set/type/pointer_spec.rb +7 -7
- data/mod/prosemirror_editor/set/abstract/prosemirror_editor.rb +3 -3
- data/mod/settings/set/abstract/permission.rb +25 -18
- data/mod/settings/set/right/add_help.rb +3 -3
- data/mod/settings/set/right/structure.rb +10 -16
- data/mod/settings/spec/set/right/comment_spec.rb +3 -3
- data/mod/settings/spec/set/right/create_spec.rb +1 -1
- data/mod/settings/spec/set/right/style_spec.rb +1 -1
- data/mod/settings/spec/set/type/setting_spec.rb +1 -1
- data/mod/solid_cache/set/abstract/solid_cache.rb +4 -4
- data/mod/solid_cache/set/right/solid_cache.rb +9 -10
- data/mod/standard/set/abstract/01_search_params.rb +41 -0
- data/mod/standard/set/abstract/search.rb +132 -0
- data/mod/standard/set/abstract/search/paging.rb +81 -0
- data/mod/standard/set/abstract/search/paging/paging_links.rb +90 -0
- data/mod/standard/set/abstract/wql_search.rb +67 -0
- data/mod/standard/set/all/error.rb +89 -82
- data/mod/standard/set/all/links.rb +1 -1
- data/mod/standard/set/all/rich_html/content.rb +125 -141
- data/mod/standard/set/all/rich_html/editing.rb +115 -178
- data/mod/standard/set/all/rich_html/form.rb +111 -131
- data/mod/standard/set/all/rich_html/header.rb +57 -39
- data/mod/standard/set/all/rich_html/menu.rb +94 -94
- data/mod/standard/set/all/rich_html/modal.rb +5 -10
- data/mod/standard/set/all/rich_html/new.rb +103 -0
- data/mod/standard/set/all/rich_html/toolbar.rb +54 -74
- data/mod/standard/set/all/rich_html/wrapper.rb +111 -138
- data/mod/standard/set/rstar/rules.rb +27 -38
- data/mod/standard/set/rstar/rules_editor.rb +298 -277
- data/mod/standard/set/self/navbox.rb +20 -15
- data/mod/standard/set/self/recent.rb +25 -17
- data/mod/standard/set/self/search.rb +25 -4
- data/mod/standard/set/type/cardtype.rb +11 -9
- data/mod/standard/set/type/date.rb +1 -1
- data/mod/standard/set/type/number.rb +1 -1
- data/mod/standard/set/type/phrase.rb +1 -1
- data/mod/standard/set/type/search_type.rb +17 -282
- data/mod/standard/set/type/session.rb +1 -1
- data/mod/standard/set/type/set.rb +155 -131
- data/mod/standard/set/type/toggle.rb +1 -1
- data/mod/standard/set/type/uri.rb +4 -4
- data/mod/standard/spec/chunk/include_spec.rb +13 -31
- data/mod/standard/spec/chunk/link_spec.rb +1 -1
- data/mod/standard/spec/set/all/error_spec.rb +1 -1
- data/mod/standard/spec/set/all/history_spec.rb +2 -2
- data/mod/standard/spec/set/all/rich_html/form_spec.rb +4 -4
- data/mod/standard/spec/set/all/rich_html/toolbar_spec.rb +22 -0
- data/mod/standard/spec/set/all/rich_html/wrapper_spec.rb +3 -2
- data/mod/standard/spec/set/right/when_created_spec.rb +1 -1
- data/mod/standard/spec/set/right/when_last_edited_spec.rb +1 -1
- data/mod/standard/spec/set/rstar/rules_spec.rb +2 -3
- data/mod/standard/spec/set/self/head_spec.rb +2 -2
- data/mod/standard/spec/set/self/navbox_spec.rb +1 -1
- data/mod/standard/spec/set/self/now_spec.rb +1 -1
- data/mod/standard/spec/set/type/date_spec.rb +1 -1
- data/mod/standard/spec/set/type/email_template_spec.rb +1 -1
- data/mod/standard/spec/set/type/layout_type_spec.rb +1 -1
- data/mod/standard/spec/set/type/number_spec.rb +1 -1
- data/mod/standard/spec/set/type/phrase_spec.rb +1 -1
- data/mod/standard/spec/set/type/search_type_spec.rb +2 -2
- data/mod/standard/spec/set/type/set_spec.rb +2 -2
- data/mod/standard/spec/set/type/toggle_spec.rb +2 -2
- data/mod/standard/spec/set/type/uri_spec.rb +3 -1
- data/mod/tinymce_editor/set/abstract/tinymce_editor.rb +1 -1
- data/spec/config/initializers/core_extensions_spec.rb +40 -10
- data/spec/lib/card/auth_spec.rb +8 -8
- data/spec/lib/card/cache_spec.rb +3 -3
- data/spec/lib/card/chunk_spec.rb +4 -4
- data/spec/lib/card/codename_spec.rb +2 -2
- data/spec/lib/card/content_spec.rb +23 -23
- data/spec/lib/card/diff_spec.rb +1 -1
- data/spec/lib/card/format_spec.rb +19 -24
- data/spec/lib/card/loader_spec.rb +4 -4
- data/spec/lib/card/name_spec.rb +16 -16
- data/spec/lib/card/query_spec.rb +80 -80
- data/spec/lib/card/reference_spec.rb +5 -5
- data/spec/lib/card/set_spec.rb +6 -6
- data/spec/lib/card/subcards_spec.rb +14 -0
- data/spec/lib/card/view_cache_spec.rb +5 -5
- data/spec/models/card/cardtype_spec.rb +15 -15
- data/spec/models/card/create_spec.rb +2 -2
- data/spec/models/card/trash_spec.rb +24 -24
- data/spec/models/card/type_transition_spec.rb +8 -8
- data/spec/models/card/validation_spec.rb +5 -5
- data/spec/models/card_spec.rb +14 -14
- data/spec/spec_helper.rb +6 -2
- data/spec/support/card_spec_helper.rb +21 -11
- data/spec/support/helper/card_helper.rb +11 -4
- metadata +73 -15
- data/lib/card/cache/view_cache.rb +0 -103
- data/mod/bootstrap/set/all/bootstrap/layout.rb +0 -58
- data/mod/core/set/all/view_cache.rb +0 -9
@@ -1,30 +1,30 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
|
3
3
|
describe Card, "validate name" do
|
4
|
-
it "
|
4
|
+
it "errors on name with /" do
|
5
5
|
@c = Card.create name: "testname/"
|
6
6
|
expect(@c.errors[:name]).not_to be_blank
|
7
7
|
end
|
8
8
|
|
9
|
-
it "
|
9
|
+
it "errors on junction name with /" do
|
10
10
|
@c = Card.create name: "jasmin+ri/ce"
|
11
11
|
expect(@c.errors[:name]).not_to be_blank
|
12
12
|
end
|
13
13
|
|
14
|
-
it "
|
14
|
+
it "does not create any new cards when name invalid" do
|
15
15
|
original_card_count = Card.count
|
16
16
|
@c = Card.create name: "jasmin+ri/ce"
|
17
17
|
expect(Card.count).to eq(original_card_count)
|
18
18
|
end
|
19
19
|
|
20
|
-
it "
|
20
|
+
it "does not allow empty name" do
|
21
21
|
@c = Card.new name: ""
|
22
22
|
expect(@c.valid?).to eq(false)
|
23
23
|
expect(@c.errors[:name]).not_to be_blank
|
24
24
|
end
|
25
25
|
|
26
26
|
# maybe the @c.key= should just throw an error, but now it doesn't take anyway
|
27
|
-
it "
|
27
|
+
it "does not allow mismatched name and key" do
|
28
28
|
@c = Card.new name: "Test"
|
29
29
|
@c.key = "foo"
|
30
30
|
# @c.key.should == 'test'
|
data/spec/models/card_spec.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
describe Card do
|
4
4
|
describe "test data" do
|
5
|
-
it "
|
5
|
+
it "is findable by name" do
|
6
6
|
expect(Card["Wagn Bot"].class).to eq(Card)
|
7
7
|
end
|
8
8
|
end
|
@@ -15,18 +15,18 @@ describe Card do
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
it "
|
19
|
-
it "
|
20
|
-
it "
|
21
|
-
it "
|
22
|
-
it "
|
18
|
+
it "does not have errors" do expect(@b.errors.size).to eq(0) end
|
19
|
+
it "has the right class" do expect(@c.class).to eq(Card) end
|
20
|
+
it "has the right key" do expect(@c.key).to eq("new_card") end
|
21
|
+
it "has the right name" do expect(@c.name).to eq("New Card") end
|
22
|
+
it "has the right content" do expect(@c.content).to eq("Great Content") end
|
23
23
|
|
24
|
-
it "
|
24
|
+
it "has the right content" do
|
25
25
|
expect(@c.db_content).to eq("Great Content")
|
26
26
|
expect(@c.content).to eq("Great Content")
|
27
27
|
end
|
28
28
|
|
29
|
-
it "
|
29
|
+
it "is findable by name" do
|
30
30
|
expect(Card["New Card"].class).to eq(Card)
|
31
31
|
end
|
32
32
|
end
|
@@ -39,17 +39,17 @@ describe Card do
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
-
it "
|
42
|
+
it "has 2 actions" do
|
43
43
|
expect(@c.actions.count).to eq(2)
|
44
44
|
end
|
45
45
|
|
46
|
-
it "
|
46
|
+
it "has original action" do
|
47
47
|
expect(@c.nth_action(1).value :db_content).to eq("basiccontent")
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
51
|
describe "created a virtual card when missing and has a template" do
|
52
|
-
it "
|
52
|
+
it "is flagged as virtual" do
|
53
53
|
expect(Card.new(name: "A+*last edited").virtual?).to be_truthy
|
54
54
|
end
|
55
55
|
end
|
@@ -76,7 +76,7 @@ describe "basic card tests" do
|
|
76
76
|
assert_equal card1.right, card2.right
|
77
77
|
end
|
78
78
|
|
79
|
-
it "
|
79
|
+
it "removes cards" do
|
80
80
|
forba = Card.create! name: "Forba"
|
81
81
|
torga = Card.create! name: "TorgA"
|
82
82
|
torgb = Card.create! name: "TorgB"
|
@@ -107,7 +107,7 @@ describe "basic card tests" do
|
|
107
107
|
# alpha.attribute_card('beta').should be_instance_of(Card)
|
108
108
|
# end
|
109
109
|
|
110
|
-
it "
|
110
|
+
it "creates cards" do
|
111
111
|
alpha = Card.new name: "alpha", content: "alpha"
|
112
112
|
expect(alpha.content).to eq("alpha")
|
113
113
|
alpha.save
|
@@ -115,7 +115,7 @@ describe "basic card tests" do
|
|
115
115
|
assert_stable alpha
|
116
116
|
end
|
117
117
|
|
118
|
-
it "
|
118
|
+
it "does not find nonexistent" do
|
119
119
|
expect(Card["no such card+no such tag"]).to be_nil
|
120
120
|
expect(Card["HomeCard+no such tag"]).to be_nil
|
121
121
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -37,7 +37,11 @@ end
|
|
37
37
|
CardSpecLoader.helper
|
38
38
|
|
39
39
|
class ActiveSupport::Logger
|
40
|
-
def rspec msg
|
41
|
-
Thread.current["logger-output"]
|
40
|
+
def rspec msg, console_text=nil
|
41
|
+
if Thread.current["logger-output"]
|
42
|
+
Thread.current["logger-output"] << msg
|
43
|
+
else
|
44
|
+
puts console_text || msg
|
45
|
+
end
|
42
46
|
end
|
43
47
|
end
|
@@ -29,20 +29,30 @@ class Card
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def debug_assert_view_select view_html, *args, &block
|
32
|
-
|
33
|
-
#{CodeRay.scan(Nokogiri::XML(view_html, &:noblanks).to_s, :html).div}
|
34
|
-
<style>
|
35
|
-
.CodeRay {
|
36
|
-
background-color: #FFF;
|
37
|
-
border: 1px solid #CCC;
|
38
|
-
padding: 1em 0px 1em 1em;
|
39
|
-
}
|
40
|
-
.CodeRay .code pre { overflow: auto }
|
41
|
-
</style>
|
42
|
-
HTML
|
32
|
+
log_html view_html
|
43
33
|
assert_view_select view_html, *args, &block
|
44
34
|
end
|
45
35
|
|
36
|
+
def log_html html
|
37
|
+
parsed = CodeRay.scan(Nokogiri::XML(html, &:noblanks).to_s, :html)
|
38
|
+
if Rails.logger.respond_to? :rspec
|
39
|
+
Rails.logger.rspec "#{parsed.div}#{CODE_RAY_STYLE}"
|
40
|
+
else
|
41
|
+
puts parsed.text
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
CODE_RAY_STYLE = <<-HTML
|
46
|
+
<style>
|
47
|
+
.CodeRay {
|
48
|
+
background-color: #FFF;
|
49
|
+
border: 1px solid #CCC;
|
50
|
+
padding: 1em 0px 1em 1em;
|
51
|
+
}
|
52
|
+
.CodeRay .code pre { overflow: auto }
|
53
|
+
</style>
|
54
|
+
HTML
|
55
|
+
|
46
56
|
def users
|
47
57
|
SharedData::USERS.sort
|
48
58
|
end
|
@@ -54,13 +54,20 @@ class Card
|
|
54
54
|
rescue NameError
|
55
55
|
end
|
56
56
|
|
57
|
-
def
|
57
|
+
def with_set set
|
58
58
|
set = include_set_in_test_set(set) if set.abstract_set?
|
59
|
-
|
60
59
|
singleton_class.send :include, set
|
60
|
+
yield set if block_given?
|
61
|
+
self
|
62
|
+
end
|
63
|
+
|
64
|
+
def format_with_set set, format_type=:base
|
61
65
|
format = format format_type
|
62
|
-
|
63
|
-
|
66
|
+
with_set set do |extended_set|
|
67
|
+
format_class = set_format_class(extended_set, format_type)
|
68
|
+
format.singleton_class.send :include, format_class
|
69
|
+
end
|
70
|
+
block_given? ? yield(format) : format
|
64
71
|
end
|
65
72
|
|
66
73
|
def set_format_class set, format_type
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: card
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ethan McCutchen
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2017-01-02 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: smartname
|
@@ -19,14 +19,14 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - '='
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.
|
22
|
+
version: '0.4'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - '='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.
|
29
|
+
version: '0.4'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: uuid
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -47,14 +47,14 @@ dependencies:
|
|
47
47
|
requirements:
|
48
48
|
- - '='
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: 1.0.0.
|
50
|
+
version: 1.0.0.rc
|
51
51
|
type: :runtime
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
54
54
|
requirements:
|
55
55
|
- - '='
|
56
56
|
- !ruby/object:Gem::Version
|
57
|
-
version: 1.0.0.
|
57
|
+
version: 1.0.0.rc
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: htmlentities
|
60
60
|
requirement: !ruby/object:Gem::Requirement
|
@@ -153,6 +153,20 @@ dependencies:
|
|
153
153
|
- - "~>"
|
154
154
|
- !ruby/object:Gem::Version
|
155
155
|
version: '3.0'
|
156
|
+
- !ruby/object:Gem::Dependency
|
157
|
+
name: nokogiri
|
158
|
+
requirement: !ruby/object:Gem::Requirement
|
159
|
+
requirements:
|
160
|
+
- - "~>"
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: 1.6.8
|
163
|
+
type: :runtime
|
164
|
+
prerelease: false
|
165
|
+
version_requirements: !ruby/object:Gem::Requirement
|
166
|
+
requirements:
|
167
|
+
- - "~>"
|
168
|
+
- !ruby/object:Gem::Version
|
169
|
+
version: 1.6.8
|
156
170
|
- !ruby/object:Gem::Dependency
|
157
171
|
name: haml
|
158
172
|
requirement: !ruby/object:Gem::Requirement
|
@@ -223,8 +237,8 @@ dependencies:
|
|
223
237
|
- - '='
|
224
238
|
- !ruby/object:Gem::Version
|
225
239
|
version: 2.99.1
|
226
|
-
description: Cards are data atoms
|
227
|
-
|
240
|
+
description: Cards are wiki-inspired data atoms."Cardists" use links, nests, types,
|
241
|
+
patterned names, queries, views, events, and rules to create rich structures.
|
228
242
|
email:
|
229
243
|
- info@wagn.org
|
230
244
|
executables: []
|
@@ -243,6 +257,8 @@ files:
|
|
243
257
|
- config/initializers/01_core_extensions/hash.rb
|
244
258
|
- config/initializers/01_core_extensions/module.rb
|
245
259
|
- config/initializers/01_core_extensions/object.rb
|
260
|
+
- config/initializers/01_core_extensions/persistent_identifiers.rb
|
261
|
+
- config/initializers/02_patches/better_errors.rb
|
246
262
|
- config/initializers/02_patches/kaminari.rb
|
247
263
|
- config/initializers/core_extensions.rb
|
248
264
|
- config/initializers/inflections.rb
|
@@ -323,6 +339,8 @@ files:
|
|
323
339
|
- db/migrate_core_cards/20160811115836_rename_stats_to_admin.rb
|
324
340
|
- db/migrate_core_cards/20160908154210_add_trash_card.rb
|
325
341
|
- db/migrate_core_cards/20160914132636_fix_mod_files.rb
|
342
|
+
- db/migrate_core_cards/20161102202156_tweak_recaptcha_setting_cards.rb
|
343
|
+
- db/migrate_core_cards/20161103154836_update_keys.rb
|
326
344
|
- db/migrate_core_cards/data/1.11_help_text.json
|
327
345
|
- db/migrate_core_cards/data/1.12_stylesheets/classic_cards.scss
|
328
346
|
- db/migrate_core_cards/data/1.12_stylesheets/common.scss
|
@@ -412,7 +430,6 @@ files:
|
|
412
430
|
- lib/card/cache/persistent.rb
|
413
431
|
- lib/card/cache/prepopulate.rb
|
414
432
|
- lib/card/cache/temporary.rb
|
415
|
-
- lib/card/cache/view_cache.rb
|
416
433
|
- lib/card/codename.rb
|
417
434
|
- lib/card/content.rb
|
418
435
|
- lib/card/content/chunk.rb
|
@@ -445,10 +462,15 @@ files:
|
|
445
462
|
- lib/card/migration/core.rb
|
446
463
|
- lib/card/migration/import.rb
|
447
464
|
- lib/card/migration/import/import_data.rb
|
465
|
+
- lib/card/migration/import/import_data/card_attributes.rb
|
466
|
+
- lib/card/migration/import/import_data/card_content.rb
|
467
|
+
- lib/card/migration/import/merger.rb
|
448
468
|
- lib/card/mod/dirs.rb
|
449
469
|
- lib/card/mod/loader.rb
|
450
470
|
- lib/card/model/save_helper.rb
|
451
471
|
- lib/card/name.rb
|
472
|
+
- lib/card/name/fields_and_traits.rb
|
473
|
+
- lib/card/name/variants.rb
|
452
474
|
- lib/card/name/view_name.rb
|
453
475
|
- lib/card/query.rb
|
454
476
|
- lib/card/query/attributes.rb
|
@@ -477,6 +499,12 @@ files:
|
|
477
499
|
- lib/card/subcards.rb
|
478
500
|
- lib/card/tasks/card.rake
|
479
501
|
- lib/card/version.rb
|
502
|
+
- lib/card/view.rb
|
503
|
+
- lib/card/view/cache.rb
|
504
|
+
- lib/card/view/fetch.rb
|
505
|
+
- lib/card/view/options.rb
|
506
|
+
- lib/card/view/stub.rb
|
507
|
+
- lib/card/view/visibility.rb
|
480
508
|
- lib/cardio.rb
|
481
509
|
- lib/cardio/schema.rb
|
482
510
|
- lib/generators/card.rb
|
@@ -522,6 +550,9 @@ files:
|
|
522
550
|
- mod/ace_editor/set/self/script_ace_config.rb
|
523
551
|
- mod/admin/set/self/admin.rb
|
524
552
|
- mod/admin/set/self/admin_info.rb
|
553
|
+
- mod/admin/set/self/recaptcha_private_key.rb
|
554
|
+
- mod/admin/set/self/recaptcha_proxy.rb
|
555
|
+
- mod/admin/set/self/recaptcha_public_key.rb
|
525
556
|
- mod/admin/set/self/trash.rb
|
526
557
|
- mod/admin/set/self/version.rb
|
527
558
|
- mod/admin/spec/set/self/admin_spec.rb
|
@@ -633,6 +664,16 @@ files:
|
|
633
664
|
- mod/bootstrap/file/yeti_skin_image/image-medium.png
|
634
665
|
- mod/bootstrap/file/yeti_skin_image/image-original.png
|
635
666
|
- mod/bootstrap/file/yeti_skin_image/image-small.png
|
667
|
+
- mod/bootstrap/lib/bootstrap.rb
|
668
|
+
- mod/bootstrap/lib/bootstrap/basic_tags.rb
|
669
|
+
- mod/bootstrap/lib/bootstrap/component.rb
|
670
|
+
- mod/bootstrap/lib/bootstrap/component/form.rb
|
671
|
+
- mod/bootstrap/lib/bootstrap/component/horizontal_form.rb
|
672
|
+
- mod/bootstrap/lib/bootstrap/component/layout.rb
|
673
|
+
- mod/bootstrap/lib/bootstrap/component/panel.rb
|
674
|
+
- mod/bootstrap/lib/bootstrap/component_loader.rb
|
675
|
+
- mod/bootstrap/lib/bootstrap/delegate.rb
|
676
|
+
- mod/bootstrap/lib/bootstrapper.rb
|
636
677
|
- mod/bootstrap/lib/javascript/bootstrap.js
|
637
678
|
- mod/bootstrap/lib/javascript/bootstrap.min.js
|
638
679
|
- mod/bootstrap/lib/javascript/bootstrap_modal_wagn.js
|
@@ -708,9 +749,10 @@ files:
|
|
708
749
|
- mod/bootstrap/lib/stylesheets/bootstrap/mixins/_vendor-prefixes.scss
|
709
750
|
- mod/bootstrap/lib/stylesheets/bootstrap_cards.scss
|
710
751
|
- mod/bootstrap/lib/stylesheets/smartmenu.css
|
752
|
+
- mod/bootstrap/set/all/bootstrap/accordion.rb
|
711
753
|
- mod/bootstrap/set/all/bootstrap/form.rb
|
712
754
|
- mod/bootstrap/set/all/bootstrap/helper.rb
|
713
|
-
- mod/bootstrap/set/all/bootstrap/
|
755
|
+
- mod/bootstrap/set/all/bootstrap/navbar.rb
|
714
756
|
- mod/bootstrap/set/all/bootstrap/table.rb
|
715
757
|
- mod/bootstrap/set/all/bootstrap/tabs.rb
|
716
758
|
- mod/bootstrap/set/all/bootstrap/wrapper.rb
|
@@ -721,6 +763,8 @@ files:
|
|
721
763
|
- mod/bootstrap/set/self/script_mods.rb
|
722
764
|
- mod/bootstrap/set/self/smartmenu_css.rb
|
723
765
|
- mod/bootstrap/set/self/smartmenu_js.rb
|
766
|
+
- mod/bootstrap/spec/set/all/bootstrap/bootstrap_builder_spec.rb
|
767
|
+
- mod/bootstrap/spec/set/all/bootstrap/bootstrap_spec.rb
|
724
768
|
- mod/bootstrap/spec/set/all/bootstrap/form_spec.rb
|
725
769
|
- mod/bootstrap/spec/set/all/bootstrap/layout_spec.rb
|
726
770
|
- mod/carrierwave/Gemfile
|
@@ -738,12 +782,13 @@ files:
|
|
738
782
|
- mod/carrierwave/spec/lib/carrier_wave/file_card_uploader_spec.rb
|
739
783
|
- mod/carrierwave/spec/set/type/file_spec.rb
|
740
784
|
- mod/carrierwave/spec/set/type/image_spec.rb
|
741
|
-
- mod/core/chunk/include.rb
|
742
785
|
- mod/core/chunk/link.rb
|
743
786
|
- mod/core/chunk/literal.rb
|
787
|
+
- mod/core/chunk/nest.rb
|
744
788
|
- mod/core/chunk/query_reference.rb
|
745
789
|
- mod/core/chunk/reference.rb
|
746
790
|
- mod/core/chunk/uri.rb
|
791
|
+
- mod/core/chunk/view_stub.rb
|
747
792
|
- mod/core/format/data_format.rb
|
748
793
|
- mod/core/format/html_format.rb
|
749
794
|
- mod/core/format/text_format.rb
|
@@ -756,6 +801,7 @@ files:
|
|
756
801
|
- mod/core/set/abstract/code_file.rb
|
757
802
|
- mod/core/set/all/actify.rb
|
758
803
|
- mod/core/set/all/active_card.rb
|
804
|
+
- mod/core/set/all/assign_attributes.rb
|
759
805
|
- mod/core/set/all/collection.rb
|
760
806
|
- mod/core/set/all/content.rb
|
761
807
|
- mod/core/set/all/debug.rb
|
@@ -778,12 +824,10 @@ files:
|
|
778
824
|
- mod/core/set/all/states.rb
|
779
825
|
- mod/core/set/all/subcards.rb
|
780
826
|
- mod/core/set/all/templating.rb
|
781
|
-
- mod/core/set/all/tracked_attributes.rb
|
782
827
|
- mod/core/set/all/trash.rb
|
783
828
|
- mod/core/set/all/type.rb
|
784
829
|
- mod/core/set/all/update_read_rules.rb
|
785
830
|
- mod/core/set/all/utils.rb
|
786
|
-
- mod/core/set/all/view_cache.rb
|
787
831
|
- mod/core/set_pattern/01_all.rb
|
788
832
|
- mod/core/set_pattern/02_all_plus.rb
|
789
833
|
- mod/core/set_pattern/03_type.rb
|
@@ -856,10 +900,16 @@ files:
|
|
856
900
|
- mod/email/spec/set/right/following_spec.rb
|
857
901
|
- mod/email/spec/set/self/follow_defaults_spec.rb
|
858
902
|
- mod/history/lib/card/act.rb
|
903
|
+
- mod/history/lib/card/act/act_renderer.rb
|
904
|
+
- mod/history/lib/card/act/act_renderer/absolute_act_renderer.rb
|
905
|
+
- mod/history/lib/card/act/act_renderer/relative_act_renderer.rb
|
859
906
|
- mod/history/lib/card/action.rb
|
907
|
+
- mod/history/lib/card/action/action_renderer.rb
|
860
908
|
- mod/history/lib/card/action/admin.rb
|
861
909
|
- mod/history/lib/card/action/differ.rb
|
862
910
|
- mod/history/lib/card/change.rb
|
911
|
+
- mod/history/set/all/act_view.rb
|
912
|
+
- mod/history/set/all/action_view.rb
|
863
913
|
- mod/history/set/all/actions.rb
|
864
914
|
- mod/history/set/all/content_history.rb
|
865
915
|
- mod/history/set/all/history.rb
|
@@ -920,6 +970,7 @@ files:
|
|
920
970
|
- mod/pointer/set/abstract/01_pointer.rb
|
921
971
|
- mod/pointer/set/abstract/01_pointer/edit.rb
|
922
972
|
- mod/pointer/set/abstract/code_pointer.rb
|
973
|
+
- mod/pointer/set/right/options.rb
|
923
974
|
- mod/pointer/set/self/script_editors.rb
|
924
975
|
- mod/pointer/set/self/script_mods.rb
|
925
976
|
- mod/pointer/set/self/script_pointer_config.rb
|
@@ -1002,6 +1053,11 @@ files:
|
|
1002
1053
|
- mod/standard/file/logo/image-medium.png
|
1003
1054
|
- mod/standard/file/logo/image-original.png
|
1004
1055
|
- mod/standard/file/logo/image-small.png
|
1056
|
+
- mod/standard/set/abstract/01_search_params.rb
|
1057
|
+
- mod/standard/set/abstract/search.rb
|
1058
|
+
- mod/standard/set/abstract/search/paging.rb
|
1059
|
+
- mod/standard/set/abstract/search/paging/paging_links.rb
|
1060
|
+
- mod/standard/set/abstract/wql_search.rb
|
1005
1061
|
- mod/standard/set/all/comment.rb
|
1006
1062
|
- mod/standard/set/all/error.rb
|
1007
1063
|
- mod/standard/set/all/links.rb
|
@@ -1012,6 +1068,7 @@ files:
|
|
1012
1068
|
- mod/standard/set/all/rich_html/header.rb
|
1013
1069
|
- mod/standard/set/all/rich_html/menu.rb
|
1014
1070
|
- mod/standard/set/all/rich_html/modal.rb
|
1071
|
+
- mod/standard/set/all/rich_html/new.rb
|
1015
1072
|
- mod/standard/set/all/rich_html/toolbar.rb
|
1016
1073
|
- mod/standard/set/all/rich_html/wrapper.rb
|
1017
1074
|
- mod/standard/set/right/discussion.rb
|
@@ -1057,6 +1114,7 @@ files:
|
|
1057
1114
|
- mod/standard/spec/set/all/links_spec.rb
|
1058
1115
|
- mod/standard/spec/set/all/rich_html/editing_spec.rb
|
1059
1116
|
- mod/standard/spec/set/all/rich_html/form_spec.rb
|
1117
|
+
- mod/standard/spec/set/all/rich_html/toolbar_spec.rb
|
1060
1118
|
- mod/standard/spec/set/all/rich_html/wrapper_spec.rb
|
1061
1119
|
- mod/standard/spec/set/right/when_created_spec.rb
|
1062
1120
|
- mod/standard/spec/set/right/when_last_edited_spec.rb
|
@@ -1346,7 +1404,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
1346
1404
|
requirements:
|
1347
1405
|
- - ">="
|
1348
1406
|
- !ruby/object:Gem::Version
|
1349
|
-
version:
|
1407
|
+
version: '2.0'
|
1350
1408
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
1351
1409
|
requirements:
|
1352
1410
|
- - ">="
|
@@ -1357,7 +1415,7 @@ rubyforge_project:
|
|
1357
1415
|
rubygems_version: 2.6.6
|
1358
1416
|
signing_key:
|
1359
1417
|
specification_version: 4
|
1360
|
-
summary:
|
1418
|
+
summary: a surprisingly simple content nesting engine
|
1361
1419
|
test_files:
|
1362
1420
|
- spec/config/initializers/core_extensions_spec.rb
|
1363
1421
|
- spec/lib/card/action_spec.rb
|