card-mod-content 0.18.1 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d2834e3ed3b2ef3826a9aeea160e69f7b26e3ddc54974734a8d4e87bcb57a215
4
- data.tar.gz: 6f258da06b1bd5e56a910cca202bc3bf5256ee045050ee4816523fc60b1b5c3a
3
+ metadata.gz: c5d06413f220c184bef8bfddba6524083e1e4f614924bbe4750acf30e33ccbb4
4
+ data.tar.gz: 530211a8c3f4bfd6305159188e33adbe72722c57beff4cc1c6a27e41d078774f
5
5
  SHA512:
6
- metadata.gz: 0d691b0051c0618fdacf7492d5e32c671873ce244653a4e64b7dc550a0ea0d10b99098b06c8708ce897ba4c7325917d3fe7d97eaf5c087ff81481e59ed3aab13
7
- data.tar.gz: 77e3b95433996cad93e6081ab629ff2254dcfb43bb98c9974d8b8d0c37bbf393e6ceb38e70058a1653fe81da20f7b735ac001ccc3141a043401b179ab3957efc
6
+ metadata.gz: 1c736c037a08cee3d738c17243cd1ce8e82574bcd7484008db1c9c99e07f396d1b5387d3b725ccb456402e43339b7f94b2388d40d347f64d94f226a00fce6288
7
+ data.tar.gz: d7dc18f96dc4c968470cd6c9705a9f1047e1904c2b490cd32ed26000cdf1dda4e053a5e3ef41bd4e59c375667a39cdb2d2e570e74e9490f04d83a43bf4b1c928
@@ -5,6 +5,7 @@ load File.expand_path("reference.rb", __dir__)
5
5
  class Card
6
6
  class Content
7
7
  module Chunk
8
+ # handle chunks of card content that are links
8
9
  class Link < Reference
9
10
  CODE = "L".freeze # L for "Link"
10
11
  attr_reader :link_text
@@ -23,7 +24,7 @@ class Card
23
24
 
24
25
  def inspect
25
26
  "<##{self.class}:e[#{@explicit_link}]n[#{@name}]l[#{@link_text}]" \
26
- "p[#{@process_chunk}] txt:#{@text}>"
27
+ "p[#{@process_chunk}] txt:#{@text}>"
27
28
  end
28
29
 
29
30
  # view options
@@ -89,7 +90,7 @@ class Card
89
90
  return unless raw_syntax
90
91
 
91
92
  if (i = divider_index raw_syntax) # if [[A | B]]
92
- [raw_syntax[0..(i - 1)], raw_syntax[(i + 1)..-1]] # [A, B]
93
+ [raw_syntax[0..(i - 1)], raw_syntax[(i + 1)..]] # [A, B]
93
94
  else # else must be [[ A ]]
94
95
  [raw_syntax, nil] # [A, nil]
95
96
  end
@@ -16,6 +16,8 @@ class Card
16
16
  # query keywords as name
17
17
 
18
18
  require File.expand_path("reference", __dir__)
19
+
20
+ # handle chunks of CQL query content that refer to other cards
19
21
  class QueryReference < Reference
20
22
  QUERY_KEYWORDS = ::Set.new(
21
23
  (
@@ -56,14 +58,14 @@ class Card
56
58
  def full_match content, prefix
57
59
  # matches cardnames that are not keywords
58
60
  # FIXME: would not match cardnames that are keywords
59
- match, offset = super(content, prefix)
61
+ match, offset = super
60
62
  return if !match || keyword?(match[1])
61
63
 
62
64
  [match, offset]
63
65
  end
64
66
 
65
67
  def keyword? str
66
- return unless str
68
+ return false unless str
67
69
 
68
70
  QUERY_KEYWORDS.include?(str.tr(" ", "_").downcase)
69
71
  end
@@ -3,6 +3,7 @@
3
3
  class Card
4
4
  class Content
5
5
  module Chunk
6
+ # handle chunks of card content that refer to other cards
6
7
  class Reference < Abstract
7
8
  attr_writer :referee_name
8
9
  attr_accessor :name
@@ -45,7 +45,7 @@ class Card
45
45
  ""
46
46
  end
47
47
  content = prepend_str + content
48
- match = super content, prefix
48
+ match = super
49
49
  [match, prepend_str.length]
50
50
  end
51
51
 
@@ -90,6 +90,7 @@ class Card
90
90
  end
91
91
 
92
92
  # FIXME: DRY, merge these two into one class
93
+ # handle chunks of card content that refer to email addresses
93
94
  class EmailUri < Uri
94
95
  PREPEND_STR = "mailto:".freeze
95
96
  EMAIL = '[a-zA-Z\\d](?:[-a-zA-Z\\d.]*[a-zA-Z\\d])?\\@'.freeze
@@ -107,6 +108,7 @@ class Card
107
108
  end
108
109
  end
109
110
 
111
+ # handle chunks of card content that refer to web hosts
110
112
  class HostUri < Uri
111
113
  GENERIC = "aero|biz|com|coop|edu|gov|info|int|mil|" \
112
114
  "museum|name|net|org".freeze
@@ -1,6 +1,8 @@
1
1
  class Card
2
2
  class Content
3
3
  module Chunk
4
+ # handle chunks of card content that are "stubbed" versions of views
5
+ # (stubs allow caching of containers)
4
6
  class ViewStub < Abstract
5
7
  Chunk.register_class(
6
8
  self,
@@ -32,7 +32,7 @@ def assigns_type?
32
32
  # for example, X+*type+*structure governs all cards of type X,
33
33
  # but the content rule does not (in fact cannot) have the type X.
34
34
  pattern_code = Card.quick_fetch(name.trunk_name.tag_name)&.codename
35
- return unless pattern_code && (set_class = Set::Pattern.find pattern_code)
35
+ return false unless pattern_code && (set_class = Set::Pattern.find pattern_code)
36
36
 
37
37
  set_class.assigns_type
38
38
  end
data/set/right/default.rb CHANGED
@@ -8,8 +8,8 @@ format :html do
8
8
 
9
9
  def quick_form_opts
10
10
  super.merge "data-update-foreign-slot":
11
- ".card-slot.quick_edit-view.RIGHT-Xinput_type,"\
12
- ".card-slot.quick_edit-view.RIGHT-Xcontent_option"\
11
+ ".card-slot.quick_edit-view.RIGHT-Xinput_type," \
12
+ ".card-slot.quick_edit-view.RIGHT-Xcontent_option" \
13
13
  ".card-slot.quick_edit-view.RIGHT-Xcontent_option_view"
14
14
  end
15
15
 
@@ -1,4 +1,4 @@
1
1
  setting_opts group: :templating, position: 2, rule_type_editable: true,
2
2
  short_help_text: "control card's content / structure",
3
- help_text: "Controls cards' content / structure. "\
3
+ help_text: "Controls cards' content / structure. " \
4
4
  "[[http://decko.org/formatting|more]]"
metadata CHANGED
@@ -1,16 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card-mod-content
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.1
4
+ version: 0.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
8
8
  - Philipp Kühl
9
9
  - Gerry Gleason
10
- autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2024-11-22 00:00:00.000000000 Z
12
+ date: 1980-01-02 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: card
@@ -18,14 +17,14 @@ dependencies:
18
17
  requirements:
19
18
  - - '='
20
19
  - !ruby/object:Gem::Version
21
- version: 1.108.1
20
+ version: 1.109.0
22
21
  type: :runtime
23
22
  prerelease: false
24
23
  version_requirements: !ruby/object:Gem::Requirement
25
24
  requirements:
26
25
  - - '='
27
26
  - !ruby/object:Gem::Version
28
- version: 1.108.1
27
+ version: 1.109.0
29
28
  description: ''
30
29
  email:
31
30
  - info@decko.org
@@ -70,7 +69,6 @@ metadata:
70
69
  documentation_url: http://docs.decko.org/
71
70
  card-mod: content
72
71
  card-mod-group: gem-defaults
73
- post_install_message:
74
72
  rdoc_options: []
75
73
  require_paths:
76
74
  - lib
@@ -78,15 +76,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
78
76
  requirements:
79
77
  - - ">="
80
78
  - !ruby/object:Gem::Version
81
- version: '3.0'
79
+ version: '3.2'
82
80
  required_rubygems_version: !ruby/object:Gem::Requirement
83
81
  requirements:
84
82
  - - ">="
85
83
  - !ruby/object:Gem::Version
86
84
  version: '0'
87
85
  requirements: []
88
- rubygems_version: 3.5.10
89
- signing_key:
86
+ rubygems_version: 3.6.8
90
87
  specification_version: 4
91
88
  summary: card content handling
92
89
  test_files: []