card 1.93.3 → 1.93.4
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/db/migrate/20170908114452_increase_text_size_for_delayed_jobs.rb +9 -0
- data/db/migrate_core_cards/data/cards/*header +2 -2
- data/lib/card/format/nest.rb +12 -5
- data/lib/card/format/nest/fetch.rb +1 -2
- data/lib/card/format/render.rb +2 -2
- data/lib/card/model/save_helper.rb +1 -1
- data/lib/card/set/format/haml_views.rb +7 -3
- data/lib/card/subcards.rb +27 -228
- data/lib/card/subcards/add.rb +121 -0
- data/lib/card/subcards/relate.rb +27 -0
- data/lib/card/subcards/remove.rb +42 -0
- data/lib/card/tasks/card/create.rake +35 -132
- data/lib/card/tasks/card/file_card_creator.rb +25 -0
- data/lib/card/tasks/card/file_card_creator/abstract_file_card.rb +44 -0
- data/lib/card/tasks/card/file_card_creator/abstract_file_card/migration_file.rb +49 -0
- data/lib/card/tasks/card/file_card_creator/abstract_file_card/ruby_file.rb +30 -0
- data/lib/card/tasks/card/file_card_creator/abstract_file_card/source_file.rb +36 -0
- data/lib/card/tasks/card/file_card_creator/haml_card.rb +42 -0
- data/lib/card/tasks/card/file_card_creator/output_helper.rb +50 -0
- data/lib/card/tasks/card/file_card_creator/script_card.rb +33 -0
- data/lib/card/tasks/card/file_card_creator/style_card.rb +25 -0
- data/lib/generators/card/template/template_generator.rb +1 -1
- data/mod/account/set/self/account_links.rb +1 -1
- data/mod/basic_formats/set/all/all_csv.rb +63 -0
- data/mod/basic_formats/set/all/json.rb +4 -1
- data/mod/bootstrap/db/migrate_cards/20170719163733_update_bootswatch_themes_to_4_beta.rb +5 -2
- data/mod/carrierwave/set/abstract/attachment.rb +1 -2
- data/mod/core/set/abstract/haml_file.rb +20 -0
- data/mod/core/set/all/chunk.rb +125 -0
- data/mod/core/set/all/collection.rb +2 -351
- data/mod/core/set/all/content.rb +26 -7
- data/mod/core/set/all/extended.rb +45 -0
- data/mod/core/set/all/haml.rb +3 -7
- data/mod/core/set/all/item.rb +92 -0
- data/mod/core/set/all/name.rb +36 -0
- data/mod/core/set/all/subcards.rb +21 -12
- data/mod/core/set/all/tabs.rb +50 -0
- data/mod/core/set/all/trash.rb +4 -0
- data/mod/core/spec/set/all/chunk_spec.rb +45 -0
- data/mod/core/spec/set/all/collection_spec.rb +6 -6
- data/mod/history/set/all/action_view.rb +1 -1
- data/mod/machines/lib/javascript/decko.js.coffee +3 -0
- data/mod/pointer/set/abstract/02_pointer/edit.rb +0 -2
- data/mod/search/set/abstract/search.rb +1 -1
- data/mod/search/set/all/filter.rb +0 -2
- data/mod/search/template/all/filter/_filter_input.haml +1 -1
- data/mod/search/template/all/filter/filter_form.haml +1 -1
- data/mod/standard/set/all/rich_html/editing.rb +1 -1
- data/mod/standard/set/all/rich_html/form.rb +6 -7
- data/mod/standard/set/all/rich_html/menu.rb +2 -3
- data/mod/standard/set/all/rich_html/toolbar.rb +3 -4
- data/mod/standard/set/type/cardtype.rb +1 -1
- data/mod/standard/spec/set/all/rich_html/editing_spec.rb +15 -4
- data/mod/tinymce_editor/db/migrate_cards/{20171113233150_update_tinymce_config.rb → 20171113233151_update_tinymce_config.rb} +1 -0
- metadata +25 -161
- data/.rspec +0 -4
- data/card.gemspec +0 -87
- data/db/seed/test/fixtures/.gitkeep +0 -0
- data/mod/bootstrap/vendor/bootstrap/.babelrc.js +0 -16
- data/mod/bootstrap/vendor/bootstrap/.editorconfig +0 -17
- data/mod/bootstrap/vendor/bootstrap/.eslintignore +0 -3
- data/mod/bootstrap/vendor/bootstrap/.gitattributes +0 -16
- data/mod/bootstrap/vendor/bootstrap/.github/CONTRIBUTING.md +0 -252
- data/mod/bootstrap/vendor/bootstrap/.github/ISSUE_TEMPLATE.md +0 -22
- data/mod/bootstrap/vendor/bootstrap/.gitignore +0 -46
- data/mod/bootstrap/vendor/bootstrap/.hound.yml +0 -19
- data/mod/bootstrap/vendor/bootstrap/.houndignore +0 -4
- data/mod/bootstrap/vendor/bootstrap/.travis.yml +0 -32
- data/mod/bootstrap/vendor/bootstrap/build/.htmllintrc +0 -19
- data/mod/bootstrap/vendor/bootstrap/build/.stylelintrc +0 -248
- data/mod/bootstrap/vendor/bootstrap/docs/4.0/examples/.stylelintrc +0 -12
- data/mod/bootstrap/vendor/bootstrap/js/.eslintrc.json +0 -240
- data/mod/bootstrap/vendor/bootstrap/js/tests/.eslintrc.json +0 -46
- data/mod/bootstrap/vendor/bootswatch/.gitignore +0 -7
- data/mod/bootstrap/vendor/bootswatch/.npmignore +0 -12
- data/mod/bootstrap/vendor/bootswatch/.travis.yml +0 -21
- data/mod/bootstrap/vendor/bootswatch/docs/.nojekyll +0 -0
- data/mod/bootstrap/vendor/bootswatch/docs/2/.travis.yml +0 -15
- data/mod/bootstrap/vendor/bootswatch/docs/2/bower_components/bootstrap/.bower.json +0 -20
- data/mod/bootstrap/vendor/bootswatch/docs/2/bower_components/bootstrap/.gitignore +0 -37
- data/mod/bootstrap/vendor/bootswatch/docs/2/bower_components/bootstrap/.travis.yml +0 -3
- data/mod/bootstrap/vendor/bootswatch/docs/2/bower_components/bootstrap/js/.jshintrc +0 -12
- data/mod/bootstrap/vendor/bootswatch/docs/2/bower_components/jquery/.bower.json +0 -20
- data/mod/bootstrap/vendor/bootswatch/docs/2/bower_components/jquery/.gitignore +0 -1
- data/mod/bootstrap/vendor/bootswatch/docs/2/swatchmaker/.gitignore +0 -1
- data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap-sass-official/.bower.json +0 -45
- data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/.bower.json +0 -44
- data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/grunt/.jshintrc +0 -7
- data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/js/.jscsrc +0 -42
- data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/js/.jshintrc +0 -15
- data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/less/.csscomb.json +0 -304
- data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/less/.csslintrc +0 -19
- data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/font-awesome/.bower.json +0 -14
- data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/font-awesome/.gitignore +0 -32
- data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/html5shiv/.bower.json +0 -25
- data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/jquery/.bower.json +0 -38
- data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/respond/.bower.json +0 -20
- data/mod/bootstrap/vendor/select2/.editorconfig +0 -6
- data/mod/bootstrap/vendor/select2/.github/CONTRIBUTING.md +0 -204
- data/mod/bootstrap/vendor/select2/.github/ISSUE_TEMPLATE.md +0 -46
- data/mod/bootstrap/vendor/select2/.github/PULL_REQUEST_TEMPLATE.md +0 -13
- data/mod/bootstrap/vendor/select2/.gitignore +0 -3
- data/mod/bootstrap/vendor/select2/.jshintignore +0 -4
- data/mod/bootstrap/vendor/select2/.jshintrc +0 -25
- data/mod/bootstrap/vendor/select2/.travis.yml +0 -22
- data/script/fetch_bootswatch_themes.rb +0 -38
- data/spec/config/initializers/core_extensions_spec.rb +0 -47
- data/spec/config/initializers/patches/active_job_spec.rb +0 -7
- data/spec/lib/card/action_spec.rb +0 -15
- data/spec/lib/card/auth_spec.rb +0 -58
- data/spec/lib/card/cache_spec.rb +0 -116
- data/spec/lib/card/chunk_spec.rb +0 -18
- data/spec/lib/card/codename_spec.rb +0 -66
- data/spec/lib/card/content_spec.rb +0 -428
- data/spec/lib/card/diff_spec.rb +0 -208
- data/spec/lib/card/format/nest_spec.rb +0 -13
- data/spec/lib/card/format/render_spec.rb +0 -26
- data/spec/lib/card/format_spec.rb +0 -117
- data/spec/lib/card/i18n_spec.rb +0 -24
- data/spec/lib/card/loader/Modfile +0 -2
- data/spec/lib/card/loader_spec.rb +0 -98
- data/spec/lib/card/migration/import_spec.rb +0 -80
- data/spec/lib/card/mod/loader/mod_dirs.rb +0 -8
- data/spec/lib/card/mod/loader/set_loader_spec.rb +0 -19
- data/spec/lib/card/mod/loader/set_pattern_loader_spec.rb +0 -19
- data/spec/lib/card/name/fields_and_traits_spec.rb +0 -18
- data/spec/lib/card/name_spec.rb +0 -70
- data/spec/lib/card/query/sorting_spec.rb +0 -68
- data/spec/lib/card/query_spec.rb +0 -574
- data/spec/lib/card/reference_spec.rb +0 -212
- data/spec/lib/card/set/event_spec.rb +0 -22
- data/spec/lib/card/set/trait_spec.rb +0 -80
- data/spec/lib/card/set_pattern_spec.rb +0 -59
- data/spec/lib/card/set_spec.rb +0 -89
- data/spec/lib/card/stage_director_spec.rb +0 -482
- data/spec/lib/card/subcards_spec.rb +0 -177
- data/spec/lib/card/success_spec.rb +0 -148
- data/spec/lib/card/view_cache_spec.rb +0 -27
- data/spec/mailers/mailer_spec.rb +0 -62
- data/spec/models/card/create_spec.rb +0 -119
- data/spec/models/card/trash_spec.rb +0 -189
- data/spec/models/card_spec.rb +0 -136
- data/spec/spec_helper.rb +0 -45
- data/spec/support/card_spec_helper.rb +0 -74
- data/spec/support/card_spec_loader.rb +0 -112
- data/spec/support/helper/card_helper.rb +0 -58
- data/spec/support/helper/event_helper.rb +0 -94
- data/spec/support/helper/render_helper.rb +0 -44
- data/spec/support/helper/save_helper.rb +0 -30
- data/spec/support/helper/set_helper.rb +0 -80
- data/spec/support/matchers/card_matchers.rb +0 -160
- data/spec/support/matchers/expectations.rb +0 -5
- data/spec/support/matchers/file_matchers.rb +0 -71
- data/spec/support/matchers/html_matchers.rb +0 -29
- data/spec/support/matchers/negated_matchers.rb +0 -2
- data/spec/support/simplecov_helper.rb +0 -70
- data/spec/support/test_mods/mod1/set/all/test_set.rb +0 -3
- data/spec/support/test_mods/mod2/set_pattern/test_pattern.rb +0 -0
@@ -1,71 +0,0 @@
|
|
1
|
-
RSpec::Matchers.define :have_file do |trait|
|
2
|
-
match do |card|
|
3
|
-
(@file = card.file) && file_size_matches
|
4
|
-
end
|
5
|
-
|
6
|
-
description do
|
7
|
-
"have a file attached #{"of size #{@size}" if @size}"
|
8
|
-
end
|
9
|
-
|
10
|
-
chain(:of_size) { |size| @size = size }
|
11
|
-
|
12
|
-
failure_message do |_actual|
|
13
|
-
if @size
|
14
|
-
"#{super()} but file size is #{@file.size}"
|
15
|
-
else
|
16
|
-
"#{super()} but found no file"
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
failure_message_when_negated do |_actual|
|
21
|
-
if @size
|
22
|
-
"#{super()} but file size is #{@file.size}"
|
23
|
-
else
|
24
|
-
"#{super()} but found a file"
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
private
|
29
|
-
|
30
|
-
def file_size_matches
|
31
|
-
return true unless @size
|
32
|
-
@size === @file.size
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
# TODO: use :have_file for this
|
37
|
-
RSpec::Matchers.define :have_file_trait do |trait|
|
38
|
-
match do |card|
|
39
|
-
trait ||= :file
|
40
|
-
(@file = card.fetch(trait: trait)) && file_size_matches
|
41
|
-
end
|
42
|
-
|
43
|
-
description do
|
44
|
-
"have a file attached #{"of size #{@size}" if @size}"
|
45
|
-
end
|
46
|
-
|
47
|
-
chain(:of_size) { |size| @size = size }
|
48
|
-
|
49
|
-
failure_message do |_actual|
|
50
|
-
if @size
|
51
|
-
"#{super()} but file size is #{@file.file.size}"
|
52
|
-
else
|
53
|
-
"#{super()} but found no file"
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
failure_message_when_negated do |_actual|
|
58
|
-
if @size
|
59
|
-
"#{super()} but file size is #{@file.file.size}"
|
60
|
-
else
|
61
|
-
"#{super()} but found a file"
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
private
|
66
|
-
|
67
|
-
def file_size_matches
|
68
|
-
return true unless @size
|
69
|
-
@size === @file.file.size
|
70
|
-
end
|
71
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
module RSpecHtmlMatchers
|
2
|
-
module SyntaxHighlighting
|
3
|
-
%i[tag_presents? text_right? count_right?].each do |method_name|
|
4
|
-
define_method method_name do
|
5
|
-
with_sytnax_highlighting { super() }
|
6
|
-
end
|
7
|
-
end
|
8
|
-
|
9
|
-
def with_sytnax_highlighting
|
10
|
-
doc = @document
|
11
|
-
tag = @tag
|
12
|
-
@document = hightlight_syntax @document
|
13
|
-
@tag = hightlight_syntax @tag, :css
|
14
|
-
yield
|
15
|
-
ensure
|
16
|
-
@document = doc
|
17
|
-
@tag = tag
|
18
|
-
end
|
19
|
-
|
20
|
-
def hightlight_syntax text, syntax = :html
|
21
|
-
text = Nokogiri::XML(text, &:noblanks).root.to_s if syntax == :html
|
22
|
-
CodeRay.scan(text, syntax).term
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
class HaveTag
|
27
|
-
prepend SyntaxHighlighting
|
28
|
-
end
|
29
|
-
end
|
@@ -1,70 +0,0 @@
|
|
1
|
-
def is_in_mod? file, mod_path
|
2
|
-
mod_msg = "below pulled from #{Rails.root}/mod/#{mod_path}/"
|
3
|
-
file.src.join("") =~ /#{mod_msg}/
|
4
|
-
end
|
5
|
-
|
6
|
-
def card_simplecov_filters
|
7
|
-
add_filter "spec/"
|
8
|
-
add_filter "/config/"
|
9
|
-
add_filter "/tasks/"
|
10
|
-
# filter all card mods
|
11
|
-
add_filter do |src_file|
|
12
|
-
src_file.filename =~ /tmp\// && !/\d+-(.+\.rb)/.match(src_file.filename) do |m|
|
13
|
-
Dir["mod/**/#{m[1].tr('-', '/').sub('/', '/set/')}"].present?
|
14
|
-
end
|
15
|
-
end
|
16
|
-
# add group for each deck mod
|
17
|
-
Dir["mod/*"].map { |path| path.sub("mod/", "") }.each do |mod|
|
18
|
-
add_group mod.capitalize do |src_file|
|
19
|
-
src_file.filename =~ /mod\/#{mod}\// ||
|
20
|
-
(
|
21
|
-
src_file.filename =~ /tmp\// &&
|
22
|
-
(match = /\d+-(.+\.rb)/.match(src_file.filename) do |m|
|
23
|
-
# '/set' is not in the path anymore after some updates
|
24
|
-
# but `set` exists in the path of the source files
|
25
|
-
Dir["mod/**/#{m[1].tr('-', '/').sub('/', '/set/')}"].present?
|
26
|
-
end) &&
|
27
|
-
is_in_mod?(src_file, mod)
|
28
|
-
)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
add_group "Sets" do |src_file|
|
33
|
-
src_file.filename =~ /tmp\/set\// &&
|
34
|
-
/\d+-(.+\.rb)/.match(src_file.filename) { |m| Dir["mod/**/#{m[1]}"].present? }
|
35
|
-
end
|
36
|
-
add_group "Set patterns" do |src_file|
|
37
|
-
src_file.filename =~ /tmp\/set_pattern\// &&
|
38
|
-
/\d+-(.+\.rb)/.match(src_file.filename) { |m| Dir["mod/**/#{m[1]}"].present? }
|
39
|
-
end
|
40
|
-
add_group "Formats" do |src_file|
|
41
|
-
src_file.filename =~ /mod\/[^\/]+\/formats/
|
42
|
-
end
|
43
|
-
add_group "Chunks" do |src_file|
|
44
|
-
src_file.filename =~ /mod\/[^\/]+\/chunks/
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
def card_core_dev_simplecov_filters
|
49
|
-
filters.clear # This will remove the :root_filter that comes via simplecov's defaults
|
50
|
-
add_filter do |src|
|
51
|
-
!(src.filename =~ /^#{SimpleCov.root}/) unless src.filename =~ /card|wagn/
|
52
|
-
end
|
53
|
-
|
54
|
-
add_filter "/spec/"
|
55
|
-
add_filter "/features/"
|
56
|
-
add_filter "/config/"
|
57
|
-
add_filter "/tasks/"
|
58
|
-
add_filter "/generators/"
|
59
|
-
add_filter "lib/card"
|
60
|
-
|
61
|
-
add_group "Card", "lib/card"
|
62
|
-
add_group "Set Patterns", "tmp/set_pattern/"
|
63
|
-
add_group "Sets", "tmp/set/"
|
64
|
-
add_group "Formats" do |src_file|
|
65
|
-
src_file.filename =~ /mod\/[^\/]+\/format/
|
66
|
-
end
|
67
|
-
add_group "Chunks" do |src_file|
|
68
|
-
src_file.filename =~ /mod\/[^\/]+\/chunk/
|
69
|
-
end
|
70
|
-
end
|
File without changes
|