card-mod-rules 0.16.0 → 0.18.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: 0dd8113a3ffd88b1ec7875889a5ff673a5a60dca9b37b983f2bffcdb6cbcdc28
4
+ data.tar.gz: 36b8212e3426a1757bb75b6650ee38aeb1d16222b0e48afa00b57270e16d948b
5
5
  SHA512:
6
- metadata.gz: d1b73b569ff7c5dfebd696da520d1d0f648a1193eefc3dafcb0a0e986181bf8e17550399647b50a0967e8bcbaca5b80a8ca3adf24182db3d48310f65a8f496b0
7
- data.tar.gz: 40225de175aec576bf19dd94447ea173b5e8476048bafcc333b3ac3b9d18151d4a9eca11668cad29d0f5668b6bd5a862752de3033e7f422790586b0c7df5af10
6
+ metadata.gz: bfbdba5d4fbad2554ebe204eb4e6e0cf38408f7da5a677d4c3e338375103add571c6b235c65bb968e0990b87e6df9f6c402990f6a0cd02ecfe73c5b7d88604ed
7
+ data.tar.gz: 074b00d49ce28046185d32066a8263797eb4153fd2230c2a0506a03ef57d18b4d24511d868e549ff0c5ea091b2541c8680398c326f20031c11563f6585ae5f7c
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/rule/rules.rb CHANGED
@@ -105,5 +105,5 @@ def state_of_nonexisting_set
105
105
  end
106
106
 
107
107
  def rule_for_set? set_name
108
- Card.exists?("#{set_name}+#{rule_user_setting_name}")
108
+ Card.exist?("#{set_name}+#{rule_user_setting_name}")
109
109
  end
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.18.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-10-31 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.108.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.108.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.18.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.18.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.18.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.18.0
57
57
  description: ''
58
58
  email:
59
59
  - info@decko.org
@@ -108,7 +108,7 @@ files:
108
108
  - set/type_plus_right/set/structure.rb
109
109
  homepage: https://decko.org
110
110
  licenses:
111
- - GPL-3.0
111
+ - GPL-3.0-or-later
112
112
  metadata:
113
113
  source_code_uri: https://github.com/decko-commons/decko
114
114
  homepage_uri: https://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.7
136
136
  signing_key:
137
137
  specification_version: 4
138
138
  summary: rules