card-mod-rules 0.16.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 884774bab048758ddfb8c40dbd82fec91daf150667fb42b02b7925c093ced7bf
4
- data.tar.gz: 23527e79a471cb8d076152904c9119dce28e13e1d49641c2ae20a7743e754dfe
3
+ metadata.gz: e1d5b16be933300849a53f9ee7f3b0ff204541b6b4f9c7b395c50018db122b8a
4
+ data.tar.gz: 8f21676966452f825a54512ddad0a7ea26ddc7c19ac663717a8b466d0f4e5b99
5
5
  SHA512:
6
- metadata.gz: d1b73b569ff7c5dfebd696da520d1d0f648a1193eefc3dafcb0a0e986181bf8e17550399647b50a0967e8bcbaca5b80a8ca3adf24182db3d48310f65a8f496b0
7
- data.tar.gz: 40225de175aec576bf19dd94447ea173b5e8476048bafcc333b3ac3b9d18151d4a9eca11668cad29d0f5668b6bd5a862752de3033e7f422790586b0c7df5af10
6
+ metadata.gz: e0441a6f90c3f7862773b1aa403f6c2befb5a7d83f3aac95795a245d1617ed7a8ef1ba975a685315be59e9b79da8bf963cbef96d39c8353296e1f20403faf023
7
+ data.tar.gz: c4046d4da43c583395d702532e79ee834b4c9444275c3cf58bc6b66b7ab1537e13c481141dfde3a78708a65f05ffe5d3a223d5eec5ba6f4672a03e749273961b
data/set/rule/bar_view.rb CHANGED
@@ -3,7 +3,7 @@ format :html do
3
3
  bar_cols 5, 4, 3
4
4
 
5
5
  def existing_rule_card
6
- @existing_rule_card ||= find_existing_rule_card
6
+ @existing_rule_card ||= card.find_existing_rule_card
7
7
  end
8
8
 
9
9
  view :bar, unknown: true do
@@ -46,7 +46,6 @@ format :html do
46
46
 
47
47
  def rule_short_content
48
48
  return "" unless existing_rule_card
49
-
50
49
  nest existing_rule_card,
51
50
  { view: :one_line_content },
52
51
  { set_context: card.name.trunk_name }
data/set/rule/editor.rb CHANGED
@@ -71,7 +71,7 @@ format :html do
71
71
  def current_rule
72
72
  if params[:assign]
73
73
  card
74
- elsif (existing = find_existing_rule_card)
74
+ elsif (existing = card.find_existing_rule_card)
75
75
  existing
76
76
  else
77
77
  card
@@ -114,19 +114,17 @@ format :html do
114
114
  def current_set_key
115
115
  card.new_card? ? Card.quick_fetch(:all).name.key : card.rule_set_key
116
116
  end
117
+ end
117
118
 
118
- private
119
-
120
- def find_existing_rule_card
121
- card.new_card? ? existing_rule_from_prototype : card
122
- end
119
+ def find_existing_rule_card
120
+ new_card? ? existing_rule_from_prototype : self
121
+ end
123
122
 
124
- # self.card is a POTENTIAL rule; it quacks like a rule but may or may not exist.
125
- # This generates a prototypical member of the POTENTIAL rule's set
126
- # and returns that member's ACTUAL rule for the POTENTIAL rule's setting
127
- def existing_rule_from_prototype
128
- return unless (setting = card.right)
123
+ # self.card is a POTENTIAL rule; it quacks like a rule but may or may not exist.
124
+ # This generates a prototypical member of the POTENTIAL rule's set
125
+ # and returns that member's ACTUAL rule for the POTENTIAL rule's setting
126
+ def existing_rule_from_prototype
127
+ return unless (setting = right)
129
128
 
130
- card.set_prototype.rule_card setting.codename, user: card.rule_user
131
- end
129
+ set_prototype.rule_card setting.codename, user: rule_user
132
130
  end
@@ -2,7 +2,7 @@
2
2
  %label
3
3
  Set
4
4
  %p.text-muted
5
- = find_existing_rule_card&.left&.label || "--"
5
+ = card.find_existing_rule_card&.left&.label || "--"
6
6
  - if notify_change
7
7
  %p.autosubmit-success-notification
8
8
  %span.text-success
data/set/type/setting.rb CHANGED
@@ -20,6 +20,10 @@ def set_classes_with_rules
20
20
  end.compact
21
21
  end
22
22
 
23
+ def scoping_rule_card
24
+ Card.fetch([self, :right, :update], new: {})
25
+ end
26
+
23
27
  def rules_for_set_class set_class
24
28
  cql = { left: { type: SetID }, right: id, sort_by: %w[content name], limit: 0 }
25
29
  cql[:left][(set_class.anchorless? ? :id : :right_id)] = set_class.pattern_id
@@ -1,8 +1,5 @@
1
1
  assign_type :list
2
2
 
3
- format :html do
4
- end
5
-
6
3
  def item_cards args={}
7
4
  left.setting_list(args[:setting_list] || :all).map(&method(:rule_item_card))
8
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card-mod-rules
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.17.0
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: 2023-11-18 00:00:00.000000000 Z
13
+ date: 2024-06-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: card
@@ -18,42 +18,42 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.106.0
21
+ version: 1.107.0
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.106.0
28
+ version: 1.107.0
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: card-mod-format
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.16.0
35
+ version: 0.17.0
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 0.16.0
42
+ version: 0.17.0
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: card-mod-search
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - '='
48
48
  - !ruby/object:Gem::Version
49
- version: 0.16.0
49
+ version: 0.17.0
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - '='
55
55
  - !ruby/object:Gem::Version
56
- version: 0.16.0
56
+ version: 0.17.0
57
57
  description: ''
58
58
  email:
59
59
  - info@decko.org
@@ -125,14 +125,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
125
125
  requirements:
126
126
  - - ">="
127
127
  - !ruby/object:Gem::Version
128
- version: '2.5'
128
+ version: '3.0'
129
129
  required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  requirements:
131
131
  - - ">="
132
132
  - !ruby/object:Gem::Version
133
133
  version: '0'
134
134
  requirements: []
135
- rubygems_version: 3.4.10
135
+ rubygems_version: 3.5.10
136
136
  signing_key:
137
137
  specification_version: 4
138
138
  summary: rules