card 1.103.1 → 1.104.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (193) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/config/environments/development.rb +4 -2
  4. data/config/environments/production.rb +9 -9
  5. data/config/environments/test.rb +1 -1
  6. data/config/initializers/01_core_extensions/array.rb +4 -1
  7. data/config/initializers/01_core_extensions/object.rb +1 -1
  8. data/config/initializers/02_patches/active_record.rb +16 -17
  9. data/config/locales/de.yml +8 -564
  10. data/config/locales/es.yml +2 -3
  11. data/db/migrate/20110511221913_require_earlier_migrations.rb +1 -1
  12. data/db/migrate/20120105203350_require_1_8_migrations.rb +1 -1
  13. data/db/migrate/20121111025347_require_1_10_migrations.rb +1 -1
  14. data/db/migrate/20211128040849_virtuals_updated_at.rb +11 -0
  15. data/db/migrate_core_cards/20130411191151_renaming_for_menu.rb +0 -1
  16. data/db/migrate_core_cards/20140317035504_account_requests_to_signups.rb +0 -2
  17. data/db/migrate_core_cards/20150202143810_import_bootstrap_layout.rb +0 -2
  18. data/db/migrate_core_cards/20190417142612_reorganize_scripts_2.rb +1 -3
  19. data/db/migrate_core_cards/20190502130029_add_shark_and_help_desk_role.rb +1 -2
  20. data/db/migrate_core_cards/20190710090209_homepage_tweaks.rb +3 -7
  21. data/db/migrate_core_cards/20190823220018_cleanup_for_decko_1_0.rb +2 -4
  22. data/db/migrate_core_cards/20190902193208_input_type.rb +3 -8
  23. data/db/migrate_core_cards/20190904174403_token_upgrade.rb +1 -1
  24. data/db/migrate_core_cards/data/1.12_stylesheets/traditional.scss +1 -2
  25. data/db/schema.rb +19 -16
  26. data/db/seed/new/card_actions.yml +2615 -3383
  27. data/db/seed/new/card_acts.yml +3 -3
  28. data/db/seed/new/card_references.yml +1588 -1707
  29. data/db/seed/new/cards.yml +5450 -8416
  30. data/db/seed/new/schema_migrations.yml +2 -0
  31. data/db/seed/new/schema_migrations_core_cards.yml +8 -0
  32. data/db/seed/test/fixtures/card_actions.yml +4304 -5144
  33. data/db/seed/test/fixtures/card_acts.yml +780 -840
  34. data/db/seed/test/fixtures/card_changes.yml +110 -110
  35. data/db/seed/test/fixtures/card_references.yml +2908 -2992
  36. data/db/seed/test/fixtures/cards.yml +8775 -11955
  37. data/db/seed/test/fixtures/schema_migrations.yml +2 -0
  38. data/db/seed/test/fixtures/schema_migrations_core_cards.yml +8 -0
  39. data/db/test_seed.rb +2 -5
  40. data/db/version.txt +1 -1
  41. data/db/version_core_cards.txt +1 -1
  42. data/lib/card/auth/current.rb +1 -1
  43. data/lib/card/auth/permissions.rb +37 -35
  44. data/lib/card/content/all.rb +3 -3
  45. data/lib/card/content/chunk.rb +1 -1
  46. data/lib/card/content/diff/summary.rb +14 -18
  47. data/lib/card/content.rb +9 -1
  48. data/lib/card/director/act_direction.rb +6 -6
  49. data/lib/card/director/card_methods.rb +0 -1
  50. data/lib/card/director/phases.rb +1 -0
  51. data/lib/card/director/stages.rb +2 -0
  52. data/lib/card/director.rb +1 -0
  53. data/lib/card/fetch/all.rb +3 -3
  54. data/lib/card/fetch/card_class.rb +5 -11
  55. data/lib/card/fetch/results.rb +8 -8
  56. data/lib/card/{tasks/card/file_card_creator → file_card_creator}/abstract_file_card/migration_file.rb +0 -0
  57. data/lib/card/{tasks/card/file_card_creator → file_card_creator}/abstract_file_card/ruby_file.rb +0 -0
  58. data/lib/card/{tasks/card/file_card_creator → file_card_creator}/abstract_file_card/source_file.rb +0 -0
  59. data/lib/card/{tasks/card/file_card_creator → file_card_creator}/abstract_file_card.rb +0 -5
  60. data/lib/card/{tasks/card/file_card_creator → file_card_creator}/haml_card.rb +0 -0
  61. data/lib/card/{tasks/card/file_card_creator → file_card_creator}/output_helper.rb +0 -0
  62. data/lib/card/{tasks/card/file_card_creator → file_card_creator}/script_card.rb +0 -0
  63. data/lib/card/{tasks/card/file_card_creator → file_card_creator}/style_card.rb +0 -0
  64. data/lib/card/{tasks/card/file_card_creator.rb → file_card_creator.rb} +0 -5
  65. data/lib/card/format/content.rb +5 -7
  66. data/lib/card/format/render.rb +10 -10
  67. data/lib/card/format.rb +3 -8
  68. data/lib/card/lexicon.rb +30 -7
  69. data/lib/card/model/save_helper.rb +3 -3
  70. data/lib/card/name/all/descendants.rb +9 -7
  71. data/lib/card/name/all/parts.rb +1 -1
  72. data/lib/card/name/all.rb +4 -3
  73. data/lib/card/name/card_class.rb +2 -1
  74. data/lib/card/name/fields_and_traits.rb +6 -30
  75. data/lib/card/name/name_variants.rb +5 -1
  76. data/lib/card/name.rb +6 -14
  77. data/lib/card/query/abstract_query/tie.rb +2 -3
  78. data/lib/card/query/card_query/normalization.rb +1 -1
  79. data/lib/card/query/sql_statement/order.rb +5 -6
  80. data/lib/card/query/value.rb +10 -7
  81. data/lib/card/reference/all.rb +9 -7
  82. data/lib/card/reference.rb +36 -41
  83. data/lib/card/rule/all.rb +3 -3
  84. data/lib/card/set/advanced_api.rb +5 -0
  85. data/lib/card/set/card_methods.rb +13 -0
  86. data/lib/card/set/event/delayed_event.rb +8 -1
  87. data/lib/card/set/event/skip_and_trigger.rb +8 -0
  88. data/lib/card/set/event.rb +1 -0
  89. data/lib/card/set/format/abstract_format/wrapper.rb +1 -1
  90. data/lib/card/set/format/abstract_format.rb +2 -1
  91. data/lib/card/set/format.rb +2 -3
  92. data/lib/card/set/helpers.rb +68 -0
  93. data/lib/card/set/inheritance.rb +1 -1
  94. data/lib/card/set/pattern/all.rb +20 -10
  95. data/lib/card/set/pattern/base.rb +12 -18
  96. data/lib/card/set/pattern/class_methods.rb +13 -13
  97. data/lib/card/set/pattern.rb +46 -24
  98. data/lib/card/set/registrar.rb +8 -2
  99. data/lib/card/set/trait.rb +16 -1
  100. data/lib/card/set/type.rb +3 -0
  101. data/lib/card/set.rb +14 -7
  102. data/lib/card/subcards/add.rb +1 -3
  103. data/lib/card/subcards/all.rb +30 -56
  104. data/lib/card/view/classy.rb +15 -27
  105. data/lib/card/view/options/voo_api.rb +3 -1
  106. data/lib/card/view/options.rb +7 -5
  107. data/lib/card/view.rb +1 -0
  108. data/lib/card.rb +9 -11
  109. data/lib/cardio/cli.rb +1 -0
  110. data/lib/cardio/commands/custom.rb +60 -0
  111. data/lib/cardio/commands/rake_command/parser.rb +49 -48
  112. data/lib/cardio/commands/rake_command.rb +17 -15
  113. data/lib/cardio/commands/rspec_command.rb +2 -0
  114. data/lib/cardio/commands.rb +69 -69
  115. data/lib/cardio/generators/deck_helper.rb +0 -4
  116. data/lib/cardio/generators.rb +56 -3
  117. data/lib/cardio/migration/deck.rb +0 -0
  118. data/lib/cardio/migration/deck_structure.rb +2 -0
  119. data/lib/cardio/migration/import/import_data/card_content.rb +1 -1
  120. data/lib/cardio/migration/import.rb +2 -2
  121. data/lib/cardio/migration.rb +26 -2
  122. data/lib/cardio/mod/class_methods.rb +112 -0
  123. data/lib/cardio/mod/dirs.rb +15 -11
  124. data/lib/cardio/mod/eat/edibles.rb +92 -0
  125. data/lib/cardio/mod/eat.rb +81 -0
  126. data/lib/cardio/mod/load_strategy/set_tmp_files.rb +10 -4
  127. data/lib/cardio/mod/load_strategy/tmp_files.rb +1 -1
  128. data/lib/cardio/mod/load_strategy.rb +3 -4
  129. data/lib/cardio/mod/loader/set_loader.rb +13 -13
  130. data/lib/cardio/mod/loader.rb +1 -1
  131. data/lib/cardio/mod/modfile_api.rb +5 -0
  132. data/lib/cardio/mod/poop.rb +135 -0
  133. data/lib/cardio/mod.rb +20 -80
  134. data/lib/cardio/railtie.rb +21 -5
  135. data/lib/cardio/schema.rb +11 -10
  136. data/lib/cardio/version.rb +35 -0
  137. data/lib/cardio.rb +4 -0
  138. data/lib/generators/deck/templates/Gemfile.erb +1 -5
  139. data/lib/generators/deck/templates/Rakefile.erb +6 -2
  140. data/lib/generators/deck/templates/rspec.erb +1 -1
  141. data/lib/generators/deck/templates/simplecov.rb.erb +7 -11
  142. data/lib/generators/deck/templates/spec/javascripts/support/decko_jasmine.yml.erb +0 -1
  143. data/lib/generators/mod/USAGE +1 -0
  144. data/lib/{card/tasks → tasks}/card/create.rake +0 -0
  145. data/lib/{card/tasks → tasks}/card/migrate.rake +41 -1
  146. data/lib/{card/tasks → tasks}/card/mod.rake +15 -8
  147. data/lib/tasks/card.rake +65 -0
  148. data/mod/admin/locales/de.yml +4 -0
  149. data/mod/admin/set/all/admin.rb +16 -0
  150. data/mod/admin/set/self/admin.rb +12 -14
  151. data/mod/admin/set/self/admin_info.rb +2 -5
  152. data/mod/core/data/production.yml +7 -0
  153. data/mod/core/data/test.yml +30 -0
  154. data/mod/core/locales/de.yml +28 -0
  155. data/mod/core/locales/en.yml +4 -5
  156. data/mod/core/set/all/assign_attributes.rb +1 -33
  157. data/mod/core/set/all/content.rb +3 -1
  158. data/mod/core/set/all/initialize.rb +1 -4
  159. data/mod/core/set/all/name_events.rb +3 -18
  160. data/mod/core/set/all/reference_events.rb +32 -36
  161. data/mod/core/set/all/subcards.rb +6 -2
  162. data/mod/core/set/all/trash.rb +4 -6
  163. data/mod/core/set/all/type.rb +67 -18
  164. data/mod/core/set/self/version.rb +1 -1
  165. data/mod/core/spec/set/all/name_events_spec.rb +10 -10
  166. data/mod/core/spec/set/all/trash_spec.rb +1 -1
  167. data/mod/core/spec/set/self/trash_spec.rb +1 -1
  168. data/mod/standard/{file → data/files}/favicon/image-icon.png +0 -0
  169. data/mod/standard/{file → data/files}/favicon/image-large.png +0 -0
  170. data/mod/standard/{file → data/files}/favicon/image-medium.png +0 -0
  171. data/mod/standard/{file → data/files}/favicon/image-original.png +0 -0
  172. data/mod/standard/{file → data/files}/favicon/image-small.png +0 -0
  173. data/mod/standard/{file → data/files}/logo/image-original.svg +0 -0
  174. metadata +66 -56
  175. data/db/migrate_core_cards/20150605115802_add_performance_log_card.rb +0 -7
  176. data/lib/card/set/basket.rb +0 -59
  177. data/lib/card/set/code_nest.rb +0 -15
  178. data/lib/card/tasks/card/asset.rake +0 -22
  179. data/lib/card/tasks/card.rake +0 -105
  180. data/lib/card/version.rb +0 -11
  181. data/lib/cardio/commands/USAGE +0 -28
  182. data/lib/cardio/generators/class_methods.rb +0 -35
  183. data/mod/core/spec/set/all/clean_me_spec.rb +0 -258
  184. data/mod/core/spec/set/all/export_spec.rb +0 -71
  185. data/tmpsets/set_pattern/100-all.rb +0 -22
  186. data/tmpsets/set_pattern/101-all_plus.rb +0 -24
  187. data/tmpsets/set_pattern/102-type.rb +0 -40
  188. data/tmpsets/set_pattern/103-star.rb +0 -26
  189. data/tmpsets/set_pattern/104-rstar.rb +0 -28
  190. data/tmpsets/set_pattern/105-rule.rb +0 -28
  191. data/tmpsets/set_pattern/106-right.rb +0 -35
  192. data/tmpsets/set_pattern/107-type_plus_right.rb +0 -43
  193. data/tmpsets/set_pattern/108-self.rb +0 -34
@@ -1,258 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
-
3
- # FIXME: - this seems like a LOT of testing but it doesn't cover a ton of ground
4
- # I think we should move the rendering tests into basic and trim this to about
5
- # a quarter of its current length
6
-
7
- RSpec.describe Card do
8
- RSpec::Matchers.define :have_toc do
9
- match do |card|
10
- values_match?(/Table of Contents/, card.format.render_open_content)
11
- end
12
- end
13
-
14
- let(:c1) { described_class["Onne Heading"] }
15
- let(:c2) { described_class["Twwo Heading"] }
16
- let(:c3) { described_class["Three Heading"] }
17
- let(:rule_card) { c1.rule_card(:table_of_contents) }
18
-
19
- context "when there is a general toc rule of 2" do
20
- before do
21
- Card::Auth.as_bot do
22
- create %i[basic type table_of_contents], "2"
23
- end
24
- end
25
-
26
- specify do
27
- expect(c1.type_id).to eq(Card::BasicID)
28
- expect(rule_card).to be_a described_class
29
- end
30
-
31
- describe ".rule" do
32
- it "has a value of 2" do
33
- expect(rule_card.content).to eq("2")
34
- expect(c1.rule(:table_of_contents)).to eq("2")
35
- end
36
- end
37
-
38
- describe "renders with/without toc" do
39
- it "does not render for 'Onne Heading'" do
40
- expect(c1).not_to have_toc
41
- end
42
-
43
- it "renders for 'Twwo Heading'" do
44
- expect(c2).to have_toc
45
- end
46
-
47
- it "renders for 'Three Heading'" do
48
- expect(c3).to have_toc
49
- end
50
- end
51
-
52
- describe ".related_sets" do
53
- it "has 1 set (right) for a simple card" do
54
- sets = described_class["A"].related_sets.map { |s| s[0] }
55
- expect(sets).to eq(["A+*right"])
56
- end
57
-
58
- it "has 2 sets (type, and right) for a cardtype card" do
59
- sets = described_class["Cardtype A"].related_sets.map { |s| s[0] }
60
- expect(sets).to eq(["Cardtype A+*type", "Cardtype A+*right"])
61
- end
62
- # it "shows type plus right sets when they exist" do
63
- # Card::Auth.as_bot do
64
- # Card.create name: 'RichText+A+*type plus right', content: ''
65
- # end
66
- # sets = Card['A'].related_sets
67
- # sets.should == ['A+*self', 'A+*right', 'RichText+A+*type plus right']
68
- # end
69
- # it "shows type plus right sets when they exist, and type" do
70
- # Card::Auth.as_bot do
71
- # Card.create name: 'RichText+Cardtype A+*type plus right', content: ''
72
- # end
73
- # sets = Card['Cardtype A'].related_sets
74
- # sets.should == ['Cardtype A+*self', 'Cardtype A+*type',
75
- # 'Cardtype A+*right', 'RichText+Cardtype A+*type plus right']
76
- # end
77
-
78
- it "is empty for a non-simple card" do
79
- sets = described_class["A+B"].related_sets.map { |s| s[0] }
80
- expect(sets).to eq([])
81
- end
82
- end
83
- # # class methods
84
- # describe ".default_rule" do
85
- # it 'has default rule' do
86
- # Card.default_rule(:table_of_contents).should == '0'
87
- # end
88
- # end
89
- end
90
-
91
- context "when I change the general toc setting to 1" do
92
- before do
93
- rule_card.content = "1"
94
- end
95
-
96
- describe ".rule" do
97
- it "has a value of 1" do
98
- expect(c1.rule(:table_of_contents)).to eq("1")
99
- end
100
- end
101
-
102
- describe "renders with/without toc" do
103
- it "does not render toc for 'Onne Heading'" do
104
- expect(c1).to have_toc
105
- end
106
-
107
- it "renders toc for 'Twwo Heading'" do
108
- expect(c2).to have_toc
109
- end
110
-
111
- it "does not render for 'Twwo Heading' when changed to 3" do
112
- rule_card.content = "3"
113
- expect(c2.rule(:table_of_contents)).to eq("3")
114
- expect(c2).not_to have_toc
115
- end
116
- end
117
- end
118
-
119
- context "when I use CardtypeE cards" do
120
- before do
121
- Card::Auth.as_bot do
122
- @c1 = described_class.create name: "toc1", type: "CardtypeE",
123
- content: described_class["Onne Heading"].content
124
- @c2 = described_class.create name: "toc2", type: "CardtypeE",
125
- content: described_class["Twwo Heading"].content
126
- @c3 = described_class.create name: "toc3", type: "CardtypeE",
127
- content: described_class["Three Heading"].content
128
- end
129
- expect(@c1.type_name).to eq("Cardtype E")
130
- @rule_card = @c1.rule_card(:table_of_contents)
131
-
132
- expect(@c1).to be
133
- expect(@c2).to be
134
- expect(@c3).to be
135
- expect(@rule_card).to be
136
- end
137
-
138
- describe ".rule" do
139
- it "has a value of 0" do
140
- expect(@c1.rule(:table_of_contents)).to eq("0")
141
- expect(@rule_card.content).to eq("0")
142
- end
143
- end
144
-
145
- describe "renders without toc" do
146
- it "does not render for 'Onne Heading'" do
147
- expect(@c1).not_to have_toc
148
- end
149
-
150
- it "renders for 'Twwo Heading'" do
151
- expect(@c2).not_to have_toc
152
- end
153
-
154
- it "renders for 'Three Heading'" do
155
- expect(@c3).not_to have_toc
156
- end
157
- end
158
-
159
- describe ".rule_card" do
160
- it "doesn't have a type rule" do
161
- expect(@rule_card).to be
162
- expect(@rule_card.name).to eq("*all+*table of contents")
163
- end
164
-
165
- it "get the same card without the * and singular" do
166
- expect(@c1.rule_card(:table_of_contents)).to eq(@rule_card)
167
- end
168
- end
169
-
170
- # # class methods
171
- # describe ".default_rule" do
172
- # it 'has default rule' do
173
- # Card.default_rule(:table_of_contents).should == '0'
174
- # end
175
- # end
176
- end
177
-
178
- context "when I create a new rule" do
179
- before do
180
- Card::Auth.as_bot do
181
- described_class.create! name: "RichText+*type+*table of contents", content: "2"
182
- @c1 = described_class.create! name: "toc1", type: "CardtypeE",
183
- content: described_class["Onne Heading"].content
184
- @c2 = described_class.create! name: "toc2",
185
- content: described_class["Twwo Heading"].content
186
- @c3 = described_class.create! name: "toc3",
187
- content: described_class["Three Heading"].content
188
- expect(@c1.type_name).to eq("Cardtype E")
189
- @rule_card = @c1.rule_card(:table_of_contents)
190
-
191
- expect(@c1).to be
192
- expect(@c2).to be
193
- expect(@c3).to be
194
- expect(@rule_card.name).to eq("*all+*table of contents")
195
- if (c = described_class["CardtypeE+*type+*table of content"])
196
- c.content = "2"
197
- c.save!
198
- else
199
- described_class.create! name: "CardtypeE+*type+*table of content", content: "2"
200
- end
201
- end
202
- end
203
-
204
- it "takes on new setting value" do
205
- c = described_class["toc1"]
206
- expect(c.rule_card(:table_of_contents).name)
207
- .to eq("CardtypeE+*type+*table of content")
208
- expect(c.rule(:table_of_contents)).to eq("2")
209
- end
210
-
211
- describe "renders with/without toc" do
212
- it "does not render for 'Onne Heading'" do
213
- expect(@c1).not_to have_toc
214
- end
215
-
216
- it "renders for 'Twwo Heading'" do
217
- expect(@c2.rule(:table_of_contents)).to eq("2")
218
- expect(@c2).to have_toc
219
- end
220
-
221
- it "renders for 'Three Heading'" do
222
- expect(@c3).to have_toc
223
- end
224
- end
225
- end
226
-
227
- context "when I change the general toc setting to 1" do
228
- let(:c1) { described_class["Onne Heading"] }
229
- let(:c2) { described_class["Twwo Heading"] }
230
- let(:rule_card) { c1.rule_card(:table_of_contents) }
231
-
232
- before do
233
- rule_card.content = "1"
234
- end
235
-
236
- describe ".rule" do
237
- it "has a value of 1" do
238
- expect(rule_card.content).to eq("1")
239
- expect(c1.rule(:table_of_contents)).to eq("1")
240
- end
241
- end
242
-
243
- describe "renders with/without toc" do
244
- it "does not render toc for 'Onne Heading'" do
245
- expect(c1).to have_toc
246
- end
247
-
248
- it "renders toc for 'Twwo Heading'" do
249
- expect(c2).to have_toc
250
- end
251
-
252
- it "does not render for 'Twwo Heading' when changed to 3" do
253
- rule_card.content = "3"
254
- expect(c2).not_to have_toc
255
- end
256
- end
257
- end
258
- end
@@ -1,71 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
-
3
- RSpec.describe Card::Set::All::Export do
4
- describe "rendering json in export mode" do
5
- before do
6
- Card::Env.params[:max_export_depth] = 4
7
- end
8
-
9
- def export_pointer content, type=:pointer
10
- export_name = "#{type} export card"
11
- create export_name, type: type, content: content
12
-
13
- create("export pointer", type_id: Card::PointerID, content: export_name)
14
- .format(:json).render_export
15
- end
16
-
17
- context "pointer card" do
18
- it "contains cards in the pointer card and its children" do
19
- expect(export_pointer(%w[T A+B])).to include(
20
- a_hash_including(name: "pointer export card", type: "Pointer",
21
- content: "[[T]]\n[[A+B]]"),
22
- a_hash_including(name: "T", type: "RichText", content: "Theta"),
23
- a_hash_including(name: "A+B", type: "RichText", content: "AlphaBeta")
24
- )
25
- end
26
-
27
- it "handles multi levels pointer cards" do
28
- inner_pointer = create "inner pointer", type: :pointer, content: "T"
29
- expect(export_pointer([inner_pointer.name, "A+B"])).to include(
30
- a_hash_including(name: "pointer export card", type: "Pointer",
31
- content: "[[inner pointer]]\n[[A+B]]"),
32
- a_hash_including(name: "inner pointer", type: "Pointer",
33
- content: "[[T]]"),
34
- a_hash_including(name: "T", type: "RichText", content: "Theta"),
35
- a_hash_including(name: "A+B", type: "RichText", content: "AlphaBeta")
36
- )
37
- end
38
-
39
- it "stops while the depth count > 10" do
40
- expect(export_pointer("pointer export card"))
41
- .to include(
42
- a_hash_including(name: "pointer export card",
43
- type: "Pointer",
44
- content: "[[pointer export card]]")
45
- )
46
- end
47
- end
48
-
49
- context "skin card" do
50
- it "contains cards in the pointer card and its children" do
51
- export = export_pointer("[[T]]", :skin)
52
- expect(export).to include(
53
- a_hash_including(name: "skin export card", type: "Skin",
54
- content: "[[T]]"),
55
- a_hash_including(name: "T", type: "RichText", content: "Theta")
56
- )
57
- end
58
- end
59
-
60
- context "search card" do
61
- it "contains cards from search card and its children" do
62
- expect(export_pointer('{"left":"A"}', :search_type)).to include(
63
- a_hash_including(name: "search_type export card", type: "Search",
64
- content: '{"left":"A"}'),
65
- a_hash_including(name: "A+B", content: "AlphaBeta", type: "RichText"),
66
- a_hash_including(name: "A+C", type: "RichText")
67
- )
68
- end
69
- end
70
- end
71
- end
@@ -1,22 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
- # Set Pattern: All
3
- #
4
- class Card::Set::All < Card::Set::Pattern::Base
5
- cattr_accessor :options
6
- class << self
7
- def label _name
8
- "All cards"
9
- end
10
-
11
- def short_label _name
12
- "everything"
13
- end
14
-
15
- def prototype_args _anchor
16
- {}
17
- end
18
- end
19
- register "All".underscore.to_sym, (options || {})
20
- end
21
-
22
- # ~~ generated from /Users/philipp/dev/decko/gem/card/mod/core/set_pattern/01_all.rb ~~
@@ -1,24 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
- # Set Pattern: AllPlus
3
- #
4
- class Card::Set::AllPlus < Card::Set::Pattern::Base
5
- cattr_accessor :options
6
- class << self
7
- @@options = { junction_only: true }
8
-
9
- def label _name
10
- 'All "+" cards'
11
- end
12
-
13
- def short_label _name
14
- 'all "+" cards'
15
- end
16
-
17
- def prototype_args _anchor
18
- { name: "+" }
19
- end
20
- end
21
- register "AllPlus".underscore.to_sym, (options || {})
22
- end
23
-
24
- # ~~ generated from /Users/philipp/dev/decko/gem/card/mod/core/set_pattern/02_all_plus.rb ~~
@@ -1,40 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
- # Set Pattern: Type
3
- #
4
- class Card::Set::Type < Card::Set::Pattern::Base
5
- cattr_accessor :options
6
- class << self
7
- load "card/set/type.rb" # "load" not "require" so pattern reloads properly
8
-
9
- def label name
10
- %(All "#{name}" cards)
11
- end
12
-
13
- def short_label name
14
- %(all "#{name}s")
15
- end
16
-
17
- def generic_label
18
- "cards of a given type"
19
- end
20
-
21
- def prototype_args anchor
22
- { type: anchor }
23
- end
24
-
25
- def pattern_applies? card
26
- !!card.type_id
27
- end
28
-
29
- def anchor_name card
30
- card.type_name
31
- end
32
-
33
- def anchor_id card
34
- card.type_id
35
- end
36
- end
37
- register "Type".underscore.to_sym, (options || {})
38
- end
39
-
40
- # ~~ generated from /Users/philipp/dev/decko/gem/card/mod/core/set_pattern/03_type.rb ~~
@@ -1,26 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
- # Set Pattern: Star
3
- #
4
- class Card::Set::Star < Card::Set::Pattern::Base
5
- cattr_accessor :options
6
- class << self
7
- def label _name
8
- 'All "*" cards'
9
- end
10
-
11
- def short_label _name
12
- 'all "*" cards'
13
- end
14
-
15
- def prototype_args _anchor
16
- { name: "*dummy" }
17
- end
18
-
19
- def pattern_applies? card
20
- card.name.star?
21
- end
22
- end
23
- register "Star".underscore.to_sym, (options || {})
24
- end
25
-
26
- # ~~ generated from /Users/philipp/dev/decko/gem/card/mod/core/set_pattern/04_star.rb ~~
@@ -1,28 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
- # Set Pattern: Rstar
3
- #
4
- class Card::Set::Rstar < Card::Set::Pattern::Base
5
- cattr_accessor :options
6
- class << self
7
- @@options = { junction_only: true }
8
-
9
- def label _name
10
- 'All "+*" cards'
11
- end
12
-
13
- def short_label _name
14
- 'all "+*" cards'
15
- end
16
-
17
- def prototype_args _anchor
18
- { name: "*dummy+*dummy" }
19
- end
20
-
21
- def pattern_applies? card
22
- card.name.rstar?
23
- end
24
- end
25
- register "Rstar".underscore.to_sym, (options || {})
26
- end
27
-
28
- # ~~ generated from /Users/philipp/dev/decko/gem/card/mod/core/set_pattern/05_rstar.rb ~~
@@ -1,28 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
- # Set Pattern: Rule
3
- #
4
- class Card::Set::Rule < Card::Set::Pattern::Base
5
- cattr_accessor :options
6
- class << self
7
- @@options = { junction_only: true }
8
-
9
- def label _name
10
- "All rule cards"
11
- end
12
-
13
- def short_label _name
14
- "all rule cards"
15
- end
16
-
17
- def prototype_args _anchor
18
- { name: "*all+*create" }
19
- end
20
-
21
- def pattern_applies? card
22
- card.rule?
23
- end
24
- end
25
- register "Rule".underscore.to_sym, (options || {})
26
- end
27
-
28
- # ~~ generated from /Users/philipp/dev/decko/gem/card/mod/core/set_pattern/06_rule.rb ~~
@@ -1,35 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
- # Set Pattern: Right
3
- #
4
- class Card::Set::Right < Card::Set::Pattern::Base
5
- cattr_accessor :options
6
- class << self
7
- @@options = {
8
- junction_only: true,
9
- assigns_type: true
10
- }
11
-
12
- def label name
13
- %(All "+#{name}" cards)
14
- end
15
-
16
- def short_label name
17
- %(all "+#{name}s")
18
- end
19
-
20
- def generic_label
21
- "given field cards"
22
- end
23
-
24
- def prototype_args anchor
25
- { name: "*dummy+#{anchor}" }
26
- end
27
-
28
- def anchor_name card
29
- card.name.tag
30
- end
31
- end
32
- register "Right".underscore.to_sym, (options || {})
33
- end
34
-
35
- # ~~ generated from /Users/philipp/dev/decko/gem/card/mod/core/set_pattern/07_right.rb ~~
@@ -1,43 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
- # Set Pattern: TypePlusRight
3
- #
4
- # Patterned field names on a specific type
5
- class Card::Set::TypePlusRight < Card::Set::Pattern::Base
6
- cattr_accessor :options
7
- class << self
8
-
9
- @@options = {
10
- junction_only: true,
11
- assigns_type: true,
12
- anchor_parts_count: 2
13
- }
14
-
15
- def label name
16
- name = name.to_name
17
- %(All "+#{name.tag}" cards on "#{name.left}" cards)
18
- end
19
-
20
- def short_label name
21
- name = name.to_name
22
- %(all "+#{name.tag}" on "#{name.left}s")
23
- end
24
-
25
- def generic_label
26
- "given field cards on a given type"
27
- end
28
-
29
- def prototype_args anchor
30
- {
31
- name: "+#{anchor.tag}",
32
- supercard: Card.new(name: "*dummy", type: anchor.trunk_name)
33
- }
34
- end
35
-
36
- def anchor_name card
37
- "#{left_type(card)}+#{card.name.tag}"
38
- end
39
- end
40
- register "TypePlusRight".underscore.to_sym, (options || {})
41
- end
42
-
43
- # ~~ generated from /Users/philipp/dev/decko/gem/card/mod/core/set_pattern/08_type_plus_right.rb ~~
@@ -1,34 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
- # Set Pattern: Self
3
- #
4
- class Card::Set::Self < Card::Set::Pattern::Base
5
- cattr_accessor :options
6
- class << self
7
- def label name
8
- %(The card "#{name}")
9
- end
10
-
11
- def short_label name
12
- name
13
- end
14
-
15
- def generic_label
16
- "a single card"
17
- end
18
-
19
- def prototype_args anchor
20
- { name: anchor }
21
- end
22
-
23
- def anchor_name card
24
- card.name
25
- end
26
-
27
- def anchor_id card
28
- card.id
29
- end
30
- end
31
- register "Self".underscore.to_sym, (options || {})
32
- end
33
-
34
- # ~~ generated from /Users/philipp/dev/decko/gem/card/mod/core/set_pattern/09_self.rb ~~