card-mod-collection 0.11.4 → 0.11.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/set/abstract/items.rb +5 -1
- data/set/abstract/paging.rb +1 -0
- data/set/abstract/paging/paging_links.rb +1 -0
- data/set/abstract/paging/paging_views.rb +1 -0
- data/set/all/extended.rb +2 -1
- data/set/all/item.rb +7 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5e6bf795ac20543ea08a1a314403ba786b9f9d804c34c8ef6dd441b9be3ed6e
|
4
|
+
data.tar.gz: 3648dfe6efdbc140d08de0cd44b8a0aedc9fca72034d6b3008b0c88c197ae806
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 555d446ceebd021ba5bb241808cc91725f39c70a4c7f57852358d13900c7a4f2a1e5eb044e4522896e41024f7932f67e82a2aaa490343f8c7f219f64d0aa6b22
|
7
|
+
data.tar.gz: 97639c731fe09e03b860bb05e779bf038c2b71803b57f8eebc7ffa1d60c123606fd0c8a11d9e7ca77b6b2b42d26396b8c987bce8d22e82ff85285fbe0ec5a759
|
data/set/abstract/items.rb
CHANGED
@@ -25,6 +25,7 @@ end
|
|
25
25
|
|
26
26
|
def first_card args={}
|
27
27
|
return unless (name = first_name)
|
28
|
+
|
28
29
|
fetch_item_card name, args
|
29
30
|
end
|
30
31
|
|
@@ -39,7 +40,7 @@ end
|
|
39
40
|
# @return [Array] list of integers (card ids of items)
|
40
41
|
# @param args [Hash] see #item_names
|
41
42
|
def item_ids args={}
|
42
|
-
item_names(args).map
|
43
|
+
item_names(args).map(&:card_id).compact
|
43
44
|
end
|
44
45
|
|
45
46
|
# @return [Array] list of Card objects
|
@@ -50,6 +51,7 @@ end
|
|
50
51
|
def item_cards args={}
|
51
52
|
return item_cards_search(args) if args[:complete]
|
52
53
|
return known_item_cards(args) if args[:known_only]
|
54
|
+
|
53
55
|
all_item_cards args
|
54
56
|
end
|
55
57
|
|
@@ -153,6 +155,7 @@ def item_type
|
|
153
155
|
opt = options_rule_card
|
154
156
|
# FIXME: need better recursion prevention
|
155
157
|
return if !opt || opt == self
|
158
|
+
|
156
159
|
opt.item_type
|
157
160
|
end
|
158
161
|
|
@@ -189,6 +192,7 @@ end
|
|
189
192
|
def clean_item_name item, context
|
190
193
|
item = item.to_name
|
191
194
|
return item if context == :raw
|
195
|
+
|
192
196
|
context ||= context_card.name
|
193
197
|
item.absolute_name context
|
194
198
|
rescue Card::Error::NotFound
|
data/set/abstract/paging.rb
CHANGED
data/set/all/extended.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
def extended_item_cards context=nil
|
3
2
|
items = item_cards limit: "", context: (context || self).name
|
4
3
|
list = []
|
@@ -20,6 +19,7 @@ private
|
|
20
19
|
def extend_item_list items, list, book
|
21
20
|
item = items.shift
|
22
21
|
return if already_extended? item, book
|
22
|
+
|
23
23
|
if item.collection?
|
24
24
|
# keep items in order
|
25
25
|
items.unshift(*item.item_cards)
|
@@ -30,6 +30,7 @@ end
|
|
30
30
|
|
31
31
|
def already_extended? item, book
|
32
32
|
return true if book.include? item
|
33
|
+
|
33
34
|
book << item
|
34
35
|
false
|
35
36
|
end
|
data/set/all/item.rb
CHANGED
@@ -2,7 +2,8 @@ def item_names _args={}
|
|
2
2
|
format._render_raw.split(/[,\n]/)
|
3
3
|
end
|
4
4
|
|
5
|
-
|
5
|
+
# FIXME: this is inconsistent with item_names
|
6
|
+
def item_cards _args={}
|
6
7
|
[self]
|
7
8
|
end
|
8
9
|
|
@@ -35,12 +36,14 @@ end
|
|
35
36
|
|
36
37
|
def add_item item
|
37
38
|
return if include_item? item
|
39
|
+
|
38
40
|
items_to_content(items_strings << item)
|
39
41
|
end
|
40
42
|
|
41
43
|
def drop_item item
|
42
44
|
item = Card::Name[item]
|
43
45
|
return unless include_item? item
|
46
|
+
|
44
47
|
items_to_content(item_names.reject { |i| i == item })
|
45
48
|
end
|
46
49
|
|
@@ -53,6 +56,7 @@ end
|
|
53
56
|
|
54
57
|
def replace_item old, new
|
55
58
|
return unless include_item? old
|
59
|
+
|
56
60
|
drop_item old
|
57
61
|
add_item new
|
58
62
|
end
|
@@ -89,6 +93,7 @@ format do
|
|
89
93
|
|
90
94
|
def voo_items_view
|
91
95
|
return unless voo && (items = voo.items)
|
96
|
+
|
92
97
|
items[:view]
|
93
98
|
end
|
94
99
|
|
@@ -106,6 +111,7 @@ format do
|
|
106
111
|
|
107
112
|
def determine_item_view_options_type options
|
108
113
|
return if options[:type]
|
114
|
+
|
109
115
|
type_from_rule = card.item_type
|
110
116
|
options[:type] = type_from_rule if type_from_rule
|
111
117
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: card-mod-collection
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.5
|
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-05-
|
13
|
+
date: 2021-05-10 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.
|
21
|
+
version: 1.101.5
|
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.
|
28
|
+
version: 1.101.5
|
29
29
|
description: ''
|
30
30
|
email:
|
31
31
|
- info@decko.org
|