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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6f7c57e5d0fbbb3e0d01a20620dda63db140430
|
4
|
+
data.tar.gz: 7cc371c0a6316b66dade977c1757d9bd172c6ca4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c412b712c3d638ba1d1701473ce9294541834ecf566d937db1b92f1e520709c2a7dc9d9f991fcfcbc99ba198c8403d0e52ddfee20a318b53823aa3eb6f10ea4
|
7
|
+
data.tar.gz: 97ea814246b69a991fd77a29f7c3019fe827d46ed7efcac6773c6c1862ce4bd4daafe141abdfd7778f9c66f2078afbe7303aeb599699b79e5b477e0d26df8969
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.20.0
|
data/card.gemspec
CHANGED
@@ -7,11 +7,11 @@ Gem::Specification.new do |s|
|
|
7
7
|
["Ethan McCutchen", "Lewis Hoffman", "Gerry Gleason", "Philipp Kühl"]
|
8
8
|
s.email = ["info@wagn.org"]
|
9
9
|
|
10
|
-
|
11
|
-
s.summary = "an atomic, set-driven content engine"
|
10
|
+
s.summary = "a surprisingly simple content nesting engine"
|
12
11
|
s.description =
|
13
|
-
"Cards are data atoms
|
14
|
-
"
|
12
|
+
"Cards are wiki-inspired data atoms." \
|
13
|
+
'"Cardists" use links, nests, types, patterned names, queries, views, ' \
|
14
|
+
"events, and rules to create rich structures."
|
15
15
|
s.homepage = "http://wagn.org"
|
16
16
|
s.licenses = ["GPL-2.0", "GPL-3.0"]
|
17
17
|
|
@@ -33,12 +33,12 @@ Gem::Specification.new do |s|
|
|
33
33
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
34
34
|
s.require_paths = ["lib"]
|
35
35
|
|
36
|
-
s.required_ruby_version = ">=
|
36
|
+
s.required_ruby_version = ">= 2.0"
|
37
37
|
|
38
38
|
[
|
39
|
-
["smartname", "0.
|
39
|
+
["smartname", "0.4"],
|
40
40
|
["uuid", "~> 2.3"],
|
41
|
-
["carrierwave", "1.0.0.
|
41
|
+
["carrierwave", "1.0.0.rc"],
|
42
42
|
["htmlentities", "~> 4.3"],
|
43
43
|
["mini_magick", "~> 4.2"],
|
44
44
|
# recaptcha 0.4.0 is last version that doesn't require ruby 2.0
|
@@ -47,6 +47,7 @@ Gem::Specification.new do |s|
|
|
47
47
|
["sass", "~> 3.2"],
|
48
48
|
["coffee-script", "~> 2.2"],
|
49
49
|
["uglifier", "~> 3.0"],
|
50
|
+
["nokogiri", "~> 1.6.8"],
|
50
51
|
["haml", "~> 4.0"],
|
51
52
|
["kaminari", "~> 0.16"],
|
52
53
|
["bootstrap-kaminari-views", "~> 0"],
|
@@ -0,0 +1,56 @@
|
|
1
|
+
module Patches
|
2
|
+
module BetterErrors
|
3
|
+
class StackFrame
|
4
|
+
# correct links to tmp files so that they point
|
5
|
+
# to the original file and line
|
6
|
+
module TmpPath
|
7
|
+
@map = {} # cache tmp path mapping
|
8
|
+
|
9
|
+
class << self
|
10
|
+
def included klass
|
11
|
+
klass.class_eval do
|
12
|
+
remove_method :initialize
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def corrections filename
|
17
|
+
@map[filename] ||= real_filename_and_line_offset filename
|
18
|
+
yield(*@map[filename])
|
19
|
+
end
|
20
|
+
|
21
|
+
def real_filename_and_line_offset filename
|
22
|
+
File.open(filename) do |file|
|
23
|
+
file.each_line.with_index do |line, i|
|
24
|
+
if line =~ /pulled from ([\S]+) ~~/
|
25
|
+
return Regexp.last_match(1), i + 1
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
[filename, 0]
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def initialize filename, line, name, frame_binding=nil
|
34
|
+
@filename = filename
|
35
|
+
@line = line
|
36
|
+
@name = name
|
37
|
+
@frame_binding = frame_binding
|
38
|
+
|
39
|
+
correct_tmp_file if tmp_file?
|
40
|
+
set_pretty_method_name if frame_binding
|
41
|
+
end
|
42
|
+
|
43
|
+
def tmp_file?
|
44
|
+
@filename.include? "/tmp/"
|
45
|
+
end
|
46
|
+
|
47
|
+
def correct_tmp_file
|
48
|
+
TmpPath.corrections(@filename) do |real_path, line_offset|
|
49
|
+
@filename = real_path
|
50
|
+
@line -= line_offset
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -1,24 +1,19 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
|
3
|
-
#
|
4
|
-
# Object.include CoreExtensions::Object
|
5
|
-
# Module.include CoreExtensions::Module
|
6
|
-
# Hash.include CoreExtensions::Hash::Merging
|
7
|
-
# Array.include CoreExtensions::Array
|
8
|
-
class Object
|
9
|
-
include CoreExtensions::Object
|
10
|
-
end
|
11
|
-
|
12
|
-
class Module
|
13
|
-
include CoreExtensions::Module
|
14
|
-
end
|
3
|
+
# extend core Ruby object classes
|
15
4
|
|
16
|
-
class
|
17
|
-
|
5
|
+
class Class
|
6
|
+
def include_extension extension
|
7
|
+
include extension
|
8
|
+
end
|
18
9
|
end
|
19
10
|
|
20
|
-
|
21
|
-
|
11
|
+
module CoreExtensions
|
12
|
+
::Object.include_extension Object
|
13
|
+
::Module.include_extension Module
|
14
|
+
::Array.include_extension Array
|
15
|
+
::Hash.include_extension Hash::Merging
|
16
|
+
::Symbol.include_extension PersistentIdentifier
|
17
|
+
::Integer.include_extension PersistentIdentifier
|
18
|
+
::Hash.extend Hash::ClassMethods::Nesting
|
22
19
|
end
|
23
|
-
|
24
|
-
Hash.extend CoreExtensions::Hash::ClassMethods::Nesting
|
data/config/locales/de.yml
CHANGED
@@ -10,8 +10,7 @@ class ImportBootstrapLayout < Card::Migration::Core
|
|
10
10
|
end
|
11
11
|
|
12
12
|
import_json "bootstrap_layout.json" # , pristine: true, output_file: nil
|
13
|
-
if layout && layout.pristine? &&
|
14
|
-
all = Card[:all]
|
13
|
+
if layout && layout.pristine? && (all = Card[:all])
|
15
14
|
layout_rule_card = all.fetch trait: :layout
|
16
15
|
style_rule_card = all.fetch trait: :style
|
17
16
|
if layout_rule_card.pristine? && style_rule_card.pristine?
|
@@ -19,9 +18,13 @@ class ImportBootstrapLayout < Card::Migration::Core
|
|
19
18
|
if style_rule_card.item_names.first == "customized classic skin"
|
20
19
|
Card.create! name: "customized bootstrap skin", type: "Skin",
|
21
20
|
content: "[[classic bootstrap skin]]\n[[*css]]"
|
22
|
-
style_rule_card.update_attributes!
|
21
|
+
style_rule_card.update_attributes!(
|
22
|
+
content: "[[customized bootstrap skin]]"
|
23
|
+
)
|
23
24
|
else
|
24
|
-
style_rule_card.update_attributes!
|
25
|
+
style_rule_card.update_attributes!(
|
26
|
+
content: "[[classic bootstrap skin]]"
|
27
|
+
)
|
25
28
|
end
|
26
29
|
end
|
27
30
|
end
|
@@ -40,15 +43,21 @@ class ImportBootstrapLayout < Card::Migration::Core
|
|
40
43
|
old_stand.delete!
|
41
44
|
|
42
45
|
# these are hard-coded
|
43
|
-
Card.create! name: "theme: bootstrap_default", type_code: :css,
|
44
|
-
|
45
|
-
Card.create! name: "style: bootstrap
|
46
|
+
Card.create! name: "theme: bootstrap_default", type_code: :css,
|
47
|
+
codename: "theme_bootstrap_default"
|
48
|
+
Card.create! name: "style: bootstrap", type_code: :css,
|
49
|
+
codename: "bootstrap_css"
|
50
|
+
Card.create! name: "style: bootstrap cards", type_code: :css,
|
51
|
+
codename: "bootstrap_cards"
|
46
52
|
|
47
|
-
Card.create! name: "style: bootstrap compatible", type_code: :scss,
|
48
|
-
|
53
|
+
Card.create! name: "style: bootstrap compatible", type_code: :scss,
|
54
|
+
codename: "style_bootstrap_compatible"
|
55
|
+
Card.create! name: "script: bootstrap", type_code: :js,
|
56
|
+
codename: "bootstrap_js"
|
49
57
|
|
50
58
|
# add new setting: *default html view
|
51
|
-
Card.create! name: "*default html view", type_code: :setting,
|
59
|
+
Card.create! name: "*default html view", type_code: :setting,
|
60
|
+
codename: "default_html_view"
|
52
61
|
Card.create! name: "*default html view+*right+*default", type_code: :phrase
|
53
62
|
|
54
63
|
# retain old behavior (default view was content, now titled)
|
@@ -57,8 +66,9 @@ class ImportBootstrapLayout < Card::Migration::Core
|
|
57
66
|
# update layouts to have explicit views in nests
|
58
67
|
Card.search(type_id: Card::LayoutTypeID) do |lcard|
|
59
68
|
lcontent = Card::Content.new lcard.content, lcard
|
60
|
-
lcontent.find_chunks(Card::Content::Chunk::
|
61
|
-
nest.explicit_view =
|
69
|
+
lcontent.find_chunks(Card::Content::Chunk::Nest).each do |nest|
|
70
|
+
nest.explicit_view =
|
71
|
+
nest.options[:nest_name] == "_main" ? "open" : "core"
|
62
72
|
end
|
63
73
|
lcard.update_attributes! content: lcontent.to_s
|
64
74
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
|
3
|
+
class TweakRecaptchaSettingCards < Card::Migration::Core
|
4
|
+
def up
|
5
|
+
ensure_card name: "*recaptcha settings", type_id: Card::BasicID
|
6
|
+
ensure_card name: "*recaptcha settings+*self+*structure",
|
7
|
+
content: <<-STRING
|
8
|
+
{{+public key}}
|
9
|
+
{{+private key}}
|
10
|
+
{{+proxy}}
|
11
|
+
STRING
|
12
|
+
%w(public_key private_key proxy).each do |name|
|
13
|
+
ensure_card name: "#{Card[:recaptcha_settings].name}+#{name.tr('_', ' ')}",
|
14
|
+
type_id: Card::PhraseID
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
|
3
|
+
class UpdateKeys < Card::Migration::Core
|
4
|
+
def up
|
5
|
+
Card.pluck(:id, :name, :key).each do |id, name, key|
|
6
|
+
new_key = name.to_name.key
|
7
|
+
next if new_key == key
|
8
|
+
update_key id, key, new_key
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def update_key id, key, new_key
|
13
|
+
Card.where(id: id).update_all(key: new_key)
|
14
|
+
Card::Reference.where(referee_id: id).update_all(referee_key: new_key)
|
15
|
+
puts "updated key '#{key}' to '#{new_key}'"
|
16
|
+
rescue ActiveRecord::RecordNotUnique => e
|
17
|
+
resolve_conflict id, key, new_key
|
18
|
+
end
|
19
|
+
|
20
|
+
def resolve_conflict id, key, new_key
|
21
|
+
if walking_dead? key
|
22
|
+
Card.where(id: id).delete_all
|
23
|
+
# card wasn't reachable anyway
|
24
|
+
# (due to rails inflection update or smartname update)
|
25
|
+
else
|
26
|
+
# example:
|
27
|
+
# "Matthias Taxes" can be in the database with two keys:
|
28
|
+
# "matthia_taxis" and "matthia_tax".
|
29
|
+
# Their keys will both be updated to "matthias_tax".
|
30
|
+
# "matthia_taxis" is a walking dead since the last rails inflection
|
31
|
+
# update (it's in the db but you can only get to via its id; all requests via
|
32
|
+
# name find the other one). If we update the walking dead
|
33
|
+
# "matthia_taxis" first to "matthias_tax" we want to replace it with
|
34
|
+
# the living "matthia_tax".
|
35
|
+
# The living card is the one that has been updated more recently.
|
36
|
+
longer_untouched = [Card.find(id), Card.find_by_key(new_key)]
|
37
|
+
.min { |a, b| a.updated_at <=> b.updated_at}
|
38
|
+
Card.where(id: longer_untouched).delete_all
|
39
|
+
update_key id, key, new_key if longer_untouched != id
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def walking_dead? key
|
44
|
+
key.include?("taxis") || key[0] == " " || key[-1] == " "
|
45
|
+
end
|
46
|
+
end
|
data/lib/card.rb
CHANGED
@@ -1,13 +1,6 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
require "carrierwave"
|
3
3
|
|
4
|
-
# if Cardio.file_buckets.present?
|
5
|
-
# require "carrierwave/storage/fog"
|
6
|
-
# Cardio.file_buckets.each do |bucket, config|
|
7
|
-
# require config["provider"]
|
8
|
-
# end
|
9
|
-
# end
|
10
|
-
|
11
4
|
Object.const_remove_if_defined :Card
|
12
5
|
|
13
6
|
# Cards are wiki-inspired building blocks.
|
@@ -39,7 +32,7 @@ class Card < ActiveRecord::Base
|
|
39
32
|
require_dependency "card/change"
|
40
33
|
require_dependency "card/reference"
|
41
34
|
require_dependency "card/subcards"
|
42
|
-
require_dependency "card/
|
35
|
+
require_dependency "card/view"
|
43
36
|
require_dependency "card/act_manager"
|
44
37
|
require_dependency "card/act_manager/stage_director"
|
45
38
|
|
data/lib/card/act_manager.rb
CHANGED
@@ -99,6 +99,10 @@ class Card
|
|
99
99
|
directors[card] = new_director card, opts
|
100
100
|
end
|
101
101
|
|
102
|
+
def include? name
|
103
|
+
directors.keys.any? { |card| card.key == name.to_name.key }
|
104
|
+
end
|
105
|
+
|
102
106
|
def new_director card, opts={}
|
103
107
|
if opts[:parent]
|
104
108
|
StageSubdirector.new card, opts
|
@@ -51,9 +51,11 @@ class Card
|
|
51
51
|
# @param user_id [Integer]
|
52
52
|
# @return [true/false]
|
53
53
|
def admin? user_id
|
54
|
-
|
55
|
-
|
56
|
-
|
54
|
+
has_role? user_id, Card::AdministratorID
|
55
|
+
end
|
56
|
+
|
57
|
+
def has_role? user_id, role_id
|
58
|
+
Card[user_id].all_roles.include? role_id
|
57
59
|
end
|
58
60
|
end
|
59
61
|
end
|
data/lib/card/cache.rb
CHANGED
@@ -22,18 +22,9 @@ class Card
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def expire name
|
25
|
-
# note: calling instance method breaks on dirty names
|
26
25
|
key = name.to_name.key
|
27
26
|
return unless (card = Card.cache.read key)
|
28
|
-
|
29
|
-
Card.cache.delete "~#{card.id}" if card.id
|
30
|
-
end
|
31
|
-
|
32
|
-
def expire_hard name
|
33
|
-
return unless Card.cache.hard
|
34
|
-
key = name.to_name.key
|
35
|
-
Card.cache.hard.delete key
|
36
|
-
Card.cache.hard.delete "~#{card.id}" if card.id
|
27
|
+
card.expire
|
37
28
|
end
|
38
29
|
end
|
39
30
|
|
@@ -190,13 +181,3 @@ class Card
|
|
190
181
|
end
|
191
182
|
end
|
192
183
|
|
193
|
-
# ActiveSupport::Cache::FileStore.class_eval do
|
194
|
-
# # escape special symbols \*"<>| additionaly to :?.
|
195
|
-
# # All of them not allowed to use in ms windows file system
|
196
|
-
# def real_file_path name
|
197
|
-
# name = name.gsub("%", "%25").gsub("?", "%3F").gsub(":", "%3A")
|
198
|
-
# name = name.gsub('\\', "%5C").gsub("*", "%2A").gsub('"', "%22")
|
199
|
-
# name = name.gsub("<", "%3C").gsub(">", "%3E").gsub("|", "%7C")
|
200
|
-
# "%s/%s.cache" % [@cache_path, name]
|
201
|
-
# end
|
202
|
-
# end
|
@@ -101,6 +101,12 @@ class Card
|
|
101
101
|
write key, object
|
102
102
|
end
|
103
103
|
value
|
104
|
+
rescue
|
105
|
+
# FIXME: somehow read is finding Card objects with set_modules_loaded
|
106
|
+
# That shouldn't be possible (#fetch is designed to prevent it), and
|
107
|
+
# it immediately breaks write. Best guess is that #read is somehow
|
108
|
+
# shortcutting and returning current object. need to research!
|
109
|
+
Rails.logger.info "failed to write attribute: #{attribute}"
|
104
110
|
end
|
105
111
|
|
106
112
|
def write key, value
|
data/lib/card/content/chunk.rb
CHANGED
@@ -68,11 +68,12 @@ class Card
|
|
68
68
|
# Could really happen almost anywhere
|
69
69
|
# (even before chunk classes are loaded).
|
70
70
|
register_list :default, [
|
71
|
-
:URI, :HostURI, :EmailURI, :EscapedLiteral, :
|
71
|
+
:URI, :HostURI, :EmailURI, :EscapedLiteral, :Nest, :Link
|
72
72
|
]
|
73
|
-
register_list :references, [:EscapedLiteral, :
|
74
|
-
register_list :nest_only, [:
|
73
|
+
register_list :references, [:EscapedLiteral, :Nest, :Link]
|
74
|
+
register_list :nest_only, [:Nest]
|
75
75
|
register_list :query, [:QueryReference]
|
76
|
+
register_list :stub, [:ViewStub]
|
76
77
|
|
77
78
|
class Abstract
|
78
79
|
class_attribute :config
|
data/lib/card/content/diff.rb
CHANGED
@@ -22,7 +22,7 @@ class Card
|
|
22
22
|
end
|
23
23
|
|
24
24
|
attr_reader :result
|
25
|
-
delegate :summary, :complete, to: :result
|
25
|
+
delegate :summary, :complete, :summary_omits_content?, to: :result
|
26
26
|
|
27
27
|
# diff options
|
28
28
|
# :format => :html|:text|:pointer|:raw
|
@@ -59,7 +59,7 @@ class Card
|
|
59
59
|
opts[:reject] = /^</
|
60
60
|
opts[:postprocess] = proc { |word| word.gsub("\n", "<br>") }
|
61
61
|
when :pointer
|
62
|
-
opts[:preprocess] = proc { |word| word.gsub("[[", "").gsub("]]", "") }
|
62
|
+
opts[:preprocess] = proc { |word| word.gsub("[[", "").gsub("]]", "<br>") }
|
63
63
|
else # :raw
|
64
64
|
opts[:preprocess] = proc { |word| CGI.escapeHTML(word) }
|
65
65
|
end
|