card-mod-help 0.14.0 → 0.14.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/set/all/guide.rb +16 -8
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 34c82b6afeaa36195514e02ffc53f73d04da5ba94d98876a3a41fd4a3fc27c87
4
- data.tar.gz: 925182b7b96202b2ca5b1f84ed0fd987ea34bc2992be880a876bd2556c58538b
3
+ metadata.gz: 16e9b37580d88e9ad9641f8fd854078305a02f2973d649add6a3e0920dad6eb3
4
+ data.tar.gz: b60f0263979bb1cbd17f738da66a3e0b4b332470f56d44fc1b1a0ceba3bd6766
5
5
  SHA512:
6
- metadata.gz: 5789dfb38394a63a57a3413d5ac17bfa58fad5d26a1946dc93e4706ecb7cb7e30c9f44c8a0842085e72392374c14825abcfe69f178e849c25d044810edda5d54
7
- data.tar.gz: 2d7af35ca64f986ab1b8a842a92e474999b1cbfeabe911bdc79270f728d9cdf88d2a4cd5745016800a732f49db25effc2a3e7f04f6af2448a0f8c8411254432c
6
+ metadata.gz: a583f3e65bda3a2f69c8ea4e31582a63efc964f5829ffd4f2a5bdee87895687ac90766233430b0b4232ed20edae8910a4a5d21949e6ad3cc55509410907eb9ba
7
+ data.tar.gz: b45a9ae4afa42400d2c86d508279c3be52cf3a92f83d4a6d434b57b99e7288ad5eb79c230c2890580e5bc3d54b3ab3f10d75991bead59b2922ebeded7d738aab
data/set/all/guide.rb CHANGED
@@ -1,9 +1,5 @@
1
1
  def guide_card
2
- guide_card = rule_card :guide
3
- return unless guide_card
4
-
5
- guide_card = guide_card.first_card if guide_card.type_id == PointerID
6
- guide_card if guide_card.ok?(:read)
2
+ @guide_card ||= determine_guide_card
7
3
  end
8
4
 
9
5
  format :html do
@@ -29,17 +25,29 @@ format :html do
29
25
  private
30
26
 
31
27
  def prepend_guide_edit_link guide_text
32
- return unless (rule_card = card.help_rule_card)
28
+ return guide_text unless guide_card.ok?(:update)
33
29
 
34
- edit_link = with_nest_mode(:normal) { nest(rule_card, view: :edit_link) }
30
+ edit_link = with_nest_mode(:normal) { nest(guide_card, view: :edit_link) }
35
31
  "<span class='d-none'>#{edit_link}</span>#{guide_text}"
36
32
  end
37
33
 
38
34
  def guide_text
39
- return "" unless (guide_card = card.guide_card)
35
+ return "" unless guide_card
40
36
 
41
37
  with_nest_mode :normal do
42
38
  nest guide_card, view: :core
43
39
  end
44
40
  end
41
+
42
+ delegate :guide_card, to: :card
43
+ end
44
+
45
+ private
46
+
47
+ def determine_guide_card
48
+ guide_card = rule_card :guide
49
+ return unless guide_card
50
+
51
+ guide_card = guide_card.first_card if guide_card.type_id == PointerID
52
+ guide_card if guide_card.ok?(:read)
45
53
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card-mod-help
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-12-22 00:00:00.000000000 Z
13
+ date: 2022-01-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: card
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.104.0
21
+ version: 1.104.1
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 1.104.0
28
+ version: 1.104.1
29
29
  description: ''
30
30
  email:
31
31
  - info@decko.org