card-mod-virtual 0.11.1 → 0.11.6

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/lib/card/virtual.rb +9 -8
  3. metadata +11 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: befb229f3375c80e64a2a1be87f3663693748d0bedc20f129ec3eeb51c7ec50c
4
- data.tar.gz: 1deaf404df813a37fcaf550d4a5bbecd108debc638a6518bfd46f81d56993992
3
+ metadata.gz: 98263f0ffca9bd2c9d1d41eed3620a0ee9dd0c946f1cac35d27a2ac89810226a
4
+ data.tar.gz: d36fe66700ba44acf6375facffd8c473f78b3660edb47e846f83d932c8771584
5
5
  SHA512:
6
- metadata.gz: 449b177fbb588344767a43d18c096584cf7846759dc465679dee3970017b5cbf994c49fd7221ee70a0153355516b6bff30797c07ee57b6d3de2c13147c28e68d
7
- data.tar.gz: f1fef8234b91feca1224c5da7531de4948e4f3c24dc21d3c99a3584c4ba2bd477bb98875216cd32d1a5d5d9af0fb65e97b2f630dfe6ee032c954e3c8f68b0ebb
6
+ metadata.gz: 74ac37e447eff48e63654fa3a0303fc2236735d086f2991bd6cc723ae9ca97650aabe58c8a03e9b379e4371424405a27972d7f55d3fce815a47fdb24fb1cafdc
7
+ data.tar.gz: dd3ac23c3b57e992c2fc736444afba74c51da494c5e3e2f104e44ef2c6ce61b9a3138b38a21b27b508ffcff4e4a387a3166021f65fca0f7cf56657cab7c07497
data/lib/card/virtual.rb CHANGED
@@ -14,11 +14,10 @@ class Card
14
14
  def create card, virtual_content=nil
15
15
  validate_card card
16
16
  virtual_content ||= block_given? ? yield : card.generate_virtual_content
17
- virtual = new left_id: left_id(card), right_id: right_id(card),
18
- left_key: card.name.left_key,
19
- content: virtual_content
20
- virtual.save!
21
- virtual
17
+ create! left_id: left_id(card),
18
+ right_id: right_id(card),
19
+ left_key: card.name.left_key,
20
+ content: virtual_content
22
21
  end
23
22
 
24
23
  def create_or_update card, virtual_content
@@ -40,6 +39,7 @@ class Card
40
39
  def refresh card
41
40
  virtual = find_by_card(card)
42
41
  return create(card) unless virtual
42
+
43
43
  virtual.update card.generate_virtual_content
44
44
  end
45
45
 
@@ -64,7 +64,7 @@ class Card
64
64
  end
65
65
 
66
66
  def left_id card
67
- if card.junction?
67
+ if card.compound?
68
68
  card.left_id&.positive? ? card.left_id : card.left&.id
69
69
  else
70
70
  card.id
@@ -72,7 +72,7 @@ class Card
72
72
  end
73
73
 
74
74
  def right_id card
75
- if card.junction?
75
+ if card.compound?
76
76
  card.right_id&.positive? ? card.right_id : card.right&.id
77
77
  else
78
78
  -2
@@ -81,13 +81,14 @@ class Card
81
81
 
82
82
  def validate_card card
83
83
  reason ||=
84
- if card.junction?
84
+ if card.compound?
85
85
  "needs left_id" unless left_id(card)
86
86
  "needs right_id" unless right_id(card)
87
87
  elsif !card.id
88
88
  "needs id"
89
89
  end
90
90
  return unless reason
91
+
91
92
  raise Card::Error, card.name, "count not cacheable: card #{card.name} #{reason}"
92
93
  end
93
94
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card-mod-virtual
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.11.6
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-03-02 00:00:00.000000000 Z
13
+ date: 2021-05-21 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.101.1
21
+ version: 1.101.6
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.101.1
28
+ version: 1.101.6
29
29
  description: ''
30
30
  email:
31
31
  - info@decko.org
@@ -35,10 +35,15 @@ extra_rdoc_files: []
35
35
  files:
36
36
  - lib/card/virtual.rb
37
37
  - set/abstract/virtual_cache.rb
38
- homepage: http://decko.org
38
+ homepage: https://decko.org
39
39
  licenses:
40
40
  - GPL-3.0
41
41
  metadata:
42
+ source_code_uri: https://github.com/decko-commons/decko
43
+ homepage_uri: https://decko.org
44
+ bug_tracker_uri: https://github.com/decko-commons/decko/issues
45
+ wiki_uri: https://decko.org
46
+ documentation_url: http://docs.decko.org/
42
47
  card-mod: virtual
43
48
  post_install_message:
44
49
  rdoc_options: []
@@ -55,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
55
60
  - !ruby/object:Gem::Version
56
61
  version: '0'
57
62
  requirements: []
58
- rubygems_version: 3.0.3
63
+ rubygems_version: 3.1.4
59
64
  signing_key:
60
65
  specification_version: 4
61
66
  summary: virtual