card 1.93.3 → 1.93.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/db/migrate/20170908114452_increase_text_size_for_delayed_jobs.rb +9 -0
  4. data/db/migrate_core_cards/data/cards/*header +2 -2
  5. data/lib/card/format/nest.rb +12 -5
  6. data/lib/card/format/nest/fetch.rb +1 -2
  7. data/lib/card/format/render.rb +2 -2
  8. data/lib/card/model/save_helper.rb +1 -1
  9. data/lib/card/set/format/haml_views.rb +7 -3
  10. data/lib/card/subcards.rb +27 -228
  11. data/lib/card/subcards/add.rb +121 -0
  12. data/lib/card/subcards/relate.rb +27 -0
  13. data/lib/card/subcards/remove.rb +42 -0
  14. data/lib/card/tasks/card/create.rake +35 -132
  15. data/lib/card/tasks/card/file_card_creator.rb +25 -0
  16. data/lib/card/tasks/card/file_card_creator/abstract_file_card.rb +44 -0
  17. data/lib/card/tasks/card/file_card_creator/abstract_file_card/migration_file.rb +49 -0
  18. data/lib/card/tasks/card/file_card_creator/abstract_file_card/ruby_file.rb +30 -0
  19. data/lib/card/tasks/card/file_card_creator/abstract_file_card/source_file.rb +36 -0
  20. data/lib/card/tasks/card/file_card_creator/haml_card.rb +42 -0
  21. data/lib/card/tasks/card/file_card_creator/output_helper.rb +50 -0
  22. data/lib/card/tasks/card/file_card_creator/script_card.rb +33 -0
  23. data/lib/card/tasks/card/file_card_creator/style_card.rb +25 -0
  24. data/lib/generators/card/template/template_generator.rb +1 -1
  25. data/mod/account/set/self/account_links.rb +1 -1
  26. data/mod/basic_formats/set/all/all_csv.rb +63 -0
  27. data/mod/basic_formats/set/all/json.rb +4 -1
  28. data/mod/bootstrap/db/migrate_cards/20170719163733_update_bootswatch_themes_to_4_beta.rb +5 -2
  29. data/mod/carrierwave/set/abstract/attachment.rb +1 -2
  30. data/mod/core/set/abstract/haml_file.rb +20 -0
  31. data/mod/core/set/all/chunk.rb +125 -0
  32. data/mod/core/set/all/collection.rb +2 -351
  33. data/mod/core/set/all/content.rb +26 -7
  34. data/mod/core/set/all/extended.rb +45 -0
  35. data/mod/core/set/all/haml.rb +3 -7
  36. data/mod/core/set/all/item.rb +92 -0
  37. data/mod/core/set/all/name.rb +36 -0
  38. data/mod/core/set/all/subcards.rb +21 -12
  39. data/mod/core/set/all/tabs.rb +50 -0
  40. data/mod/core/set/all/trash.rb +4 -0
  41. data/mod/core/spec/set/all/chunk_spec.rb +45 -0
  42. data/mod/core/spec/set/all/collection_spec.rb +6 -6
  43. data/mod/history/set/all/action_view.rb +1 -1
  44. data/mod/machines/lib/javascript/decko.js.coffee +3 -0
  45. data/mod/pointer/set/abstract/02_pointer/edit.rb +0 -2
  46. data/mod/search/set/abstract/search.rb +1 -1
  47. data/mod/search/set/all/filter.rb +0 -2
  48. data/mod/search/template/all/filter/_filter_input.haml +1 -1
  49. data/mod/search/template/all/filter/filter_form.haml +1 -1
  50. data/mod/standard/set/all/rich_html/editing.rb +1 -1
  51. data/mod/standard/set/all/rich_html/form.rb +6 -7
  52. data/mod/standard/set/all/rich_html/menu.rb +2 -3
  53. data/mod/standard/set/all/rich_html/toolbar.rb +3 -4
  54. data/mod/standard/set/type/cardtype.rb +1 -1
  55. data/mod/standard/spec/set/all/rich_html/editing_spec.rb +15 -4
  56. data/mod/tinymce_editor/db/migrate_cards/{20171113233150_update_tinymce_config.rb → 20171113233151_update_tinymce_config.rb} +1 -0
  57. metadata +25 -161
  58. data/.rspec +0 -4
  59. data/card.gemspec +0 -87
  60. data/db/seed/test/fixtures/.gitkeep +0 -0
  61. data/mod/bootstrap/vendor/bootstrap/.babelrc.js +0 -16
  62. data/mod/bootstrap/vendor/bootstrap/.editorconfig +0 -17
  63. data/mod/bootstrap/vendor/bootstrap/.eslintignore +0 -3
  64. data/mod/bootstrap/vendor/bootstrap/.gitattributes +0 -16
  65. data/mod/bootstrap/vendor/bootstrap/.github/CONTRIBUTING.md +0 -252
  66. data/mod/bootstrap/vendor/bootstrap/.github/ISSUE_TEMPLATE.md +0 -22
  67. data/mod/bootstrap/vendor/bootstrap/.gitignore +0 -46
  68. data/mod/bootstrap/vendor/bootstrap/.hound.yml +0 -19
  69. data/mod/bootstrap/vendor/bootstrap/.houndignore +0 -4
  70. data/mod/bootstrap/vendor/bootstrap/.travis.yml +0 -32
  71. data/mod/bootstrap/vendor/bootstrap/build/.htmllintrc +0 -19
  72. data/mod/bootstrap/vendor/bootstrap/build/.stylelintrc +0 -248
  73. data/mod/bootstrap/vendor/bootstrap/docs/4.0/examples/.stylelintrc +0 -12
  74. data/mod/bootstrap/vendor/bootstrap/js/.eslintrc.json +0 -240
  75. data/mod/bootstrap/vendor/bootstrap/js/tests/.eslintrc.json +0 -46
  76. data/mod/bootstrap/vendor/bootswatch/.gitignore +0 -7
  77. data/mod/bootstrap/vendor/bootswatch/.npmignore +0 -12
  78. data/mod/bootstrap/vendor/bootswatch/.travis.yml +0 -21
  79. data/mod/bootstrap/vendor/bootswatch/docs/.nojekyll +0 -0
  80. data/mod/bootstrap/vendor/bootswatch/docs/2/.travis.yml +0 -15
  81. data/mod/bootstrap/vendor/bootswatch/docs/2/bower_components/bootstrap/.bower.json +0 -20
  82. data/mod/bootstrap/vendor/bootswatch/docs/2/bower_components/bootstrap/.gitignore +0 -37
  83. data/mod/bootstrap/vendor/bootswatch/docs/2/bower_components/bootstrap/.travis.yml +0 -3
  84. data/mod/bootstrap/vendor/bootswatch/docs/2/bower_components/bootstrap/js/.jshintrc +0 -12
  85. data/mod/bootstrap/vendor/bootswatch/docs/2/bower_components/jquery/.bower.json +0 -20
  86. data/mod/bootstrap/vendor/bootswatch/docs/2/bower_components/jquery/.gitignore +0 -1
  87. data/mod/bootstrap/vendor/bootswatch/docs/2/swatchmaker/.gitignore +0 -1
  88. data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap-sass-official/.bower.json +0 -45
  89. data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/.bower.json +0 -44
  90. data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/grunt/.jshintrc +0 -7
  91. data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/js/.jscsrc +0 -42
  92. data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/js/.jshintrc +0 -15
  93. data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/less/.csscomb.json +0 -304
  94. data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/bootstrap/less/.csslintrc +0 -19
  95. data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/font-awesome/.bower.json +0 -14
  96. data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/font-awesome/.gitignore +0 -32
  97. data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/html5shiv/.bower.json +0 -25
  98. data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/jquery/.bower.json +0 -38
  99. data/mod/bootstrap/vendor/bootswatch/docs/3/bower_components/respond/.bower.json +0 -20
  100. data/mod/bootstrap/vendor/select2/.editorconfig +0 -6
  101. data/mod/bootstrap/vendor/select2/.github/CONTRIBUTING.md +0 -204
  102. data/mod/bootstrap/vendor/select2/.github/ISSUE_TEMPLATE.md +0 -46
  103. data/mod/bootstrap/vendor/select2/.github/PULL_REQUEST_TEMPLATE.md +0 -13
  104. data/mod/bootstrap/vendor/select2/.gitignore +0 -3
  105. data/mod/bootstrap/vendor/select2/.jshintignore +0 -4
  106. data/mod/bootstrap/vendor/select2/.jshintrc +0 -25
  107. data/mod/bootstrap/vendor/select2/.travis.yml +0 -22
  108. data/script/fetch_bootswatch_themes.rb +0 -38
  109. data/spec/config/initializers/core_extensions_spec.rb +0 -47
  110. data/spec/config/initializers/patches/active_job_spec.rb +0 -7
  111. data/spec/lib/card/action_spec.rb +0 -15
  112. data/spec/lib/card/auth_spec.rb +0 -58
  113. data/spec/lib/card/cache_spec.rb +0 -116
  114. data/spec/lib/card/chunk_spec.rb +0 -18
  115. data/spec/lib/card/codename_spec.rb +0 -66
  116. data/spec/lib/card/content_spec.rb +0 -428
  117. data/spec/lib/card/diff_spec.rb +0 -208
  118. data/spec/lib/card/format/nest_spec.rb +0 -13
  119. data/spec/lib/card/format/render_spec.rb +0 -26
  120. data/spec/lib/card/format_spec.rb +0 -117
  121. data/spec/lib/card/i18n_spec.rb +0 -24
  122. data/spec/lib/card/loader/Modfile +0 -2
  123. data/spec/lib/card/loader_spec.rb +0 -98
  124. data/spec/lib/card/migration/import_spec.rb +0 -80
  125. data/spec/lib/card/mod/loader/mod_dirs.rb +0 -8
  126. data/spec/lib/card/mod/loader/set_loader_spec.rb +0 -19
  127. data/spec/lib/card/mod/loader/set_pattern_loader_spec.rb +0 -19
  128. data/spec/lib/card/name/fields_and_traits_spec.rb +0 -18
  129. data/spec/lib/card/name_spec.rb +0 -70
  130. data/spec/lib/card/query/sorting_spec.rb +0 -68
  131. data/spec/lib/card/query_spec.rb +0 -574
  132. data/spec/lib/card/reference_spec.rb +0 -212
  133. data/spec/lib/card/set/event_spec.rb +0 -22
  134. data/spec/lib/card/set/trait_spec.rb +0 -80
  135. data/spec/lib/card/set_pattern_spec.rb +0 -59
  136. data/spec/lib/card/set_spec.rb +0 -89
  137. data/spec/lib/card/stage_director_spec.rb +0 -482
  138. data/spec/lib/card/subcards_spec.rb +0 -177
  139. data/spec/lib/card/success_spec.rb +0 -148
  140. data/spec/lib/card/view_cache_spec.rb +0 -27
  141. data/spec/mailers/mailer_spec.rb +0 -62
  142. data/spec/models/card/create_spec.rb +0 -119
  143. data/spec/models/card/trash_spec.rb +0 -189
  144. data/spec/models/card_spec.rb +0 -136
  145. data/spec/spec_helper.rb +0 -45
  146. data/spec/support/card_spec_helper.rb +0 -74
  147. data/spec/support/card_spec_loader.rb +0 -112
  148. data/spec/support/helper/card_helper.rb +0 -58
  149. data/spec/support/helper/event_helper.rb +0 -94
  150. data/spec/support/helper/render_helper.rb +0 -44
  151. data/spec/support/helper/save_helper.rb +0 -30
  152. data/spec/support/helper/set_helper.rb +0 -80
  153. data/spec/support/matchers/card_matchers.rb +0 -160
  154. data/spec/support/matchers/expectations.rb +0 -5
  155. data/spec/support/matchers/file_matchers.rb +0 -71
  156. data/spec/support/matchers/html_matchers.rb +0 -29
  157. data/spec/support/matchers/negated_matchers.rb +0 -2
  158. data/spec/support/simplecov_helper.rb +0 -70
  159. data/spec/support/test_mods/mod1/set/all/test_set.rb +0 -3
  160. data/spec/support/test_mods/mod2/set_pattern/test_pattern.rb +0 -0
@@ -1,5 +0,0 @@
1
- module CardExpectations
2
- def expect_content_of name
3
- expect(Card.fetch(name).content)
4
- end
5
- end
@@ -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,2 +0,0 @@
1
- RSpec::Matchers.define_negated_matcher :not_include, :include
2
- RSpec::Matchers.define_negated_matcher :be_not_virtual, :be_virtual
@@ -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
@@ -1,3 +0,0 @@
1
- def test_method
2
- "works"
3
- end