cardname 0.19.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/cardname/class_methods.rb +1 -1
- data/lib/cardname/contextual.rb +7 -2
- data/lib/cardname.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4554fac83c97dbabe65daf057f2ab45d5e0481b01a8a56571047ec03df42ffa3
|
|
4
|
+
data.tar.gz: 895485075abc1149b92e1e4248430c60d326450274ca78c63cf612e463b81358
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 15dbcff6e39af5bb20d21a551c9616f019c00162d79cac2842268299e209ee6817ce4c4c939ed6db61255e797c4a503a4ff005867696695c4ad4bd851a401c86
|
|
7
|
+
data.tar.gz: 0db218f98faddefa247844ab2626a9cd78e46861a0d330f22513beef955e75a5f5386efea94bb6622d0c794e62e3dd94beb88a26a80b113e537064391b91126b
|
|
@@ -38,7 +38,7 @@ class Cardname
|
|
|
38
38
|
# regular expression for detecting banned characters
|
|
39
39
|
# @return [Regexp]
|
|
40
40
|
def banned_re
|
|
41
|
-
@banned_re ||= /[#{Regexp.escape(
|
|
41
|
+
@banned_re ||= /[#{Regexp.escape(banned_array + [joint]).join}]/
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
# split string on joint into parts
|
data/lib/cardname/contextual.rb
CHANGED
|
@@ -14,13 +14,18 @@ class Cardname
|
|
|
14
14
|
|
|
15
15
|
# @return [Boolean]
|
|
16
16
|
def relative?
|
|
17
|
-
starts_with_joint? || (
|
|
17
|
+
starts_with_joint? || s.match?(RELATIVE_REGEXP)
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
# starts with joint, no other contextual element
|
|
21
21
|
# @return [Boolean]
|
|
22
22
|
def simple_relative?
|
|
23
|
-
starts_with_joint? && (
|
|
23
|
+
starts_with_joint? && !s.match?(RELATIVE_REGEXP)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# _left, _right, _self or any other name fragment referring to a relative part
|
|
27
|
+
def relative_fragment?
|
|
28
|
+
s.match?(/^#{RELATIVE_REGEXP}$/)
|
|
24
29
|
end
|
|
25
30
|
|
|
26
31
|
# not relative
|
data/lib/cardname.rb
CHANGED
|
@@ -40,7 +40,7 @@ class Cardname < String
|
|
|
40
40
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
41
41
|
# ~~~~~~~~~~~~~~~~~~~~~~ INSTANCE ~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
42
42
|
def initialize str
|
|
43
|
-
super
|
|
43
|
+
super
|
|
44
44
|
strip!
|
|
45
45
|
encode! "UTF-8"
|
|
46
46
|
part_names # populates @part_names and @simple
|
|
@@ -86,8 +86,8 @@ class Cardname < String
|
|
|
86
86
|
|
|
87
87
|
# cardname based on part index
|
|
88
88
|
# @return [Cardname]
|
|
89
|
-
def []
|
|
90
|
-
self.class.new part_names[*
|
|
89
|
+
def [](*)
|
|
90
|
+
self.class.new part_names[*]
|
|
91
91
|
end
|
|
92
92
|
|
|
93
93
|
# @see #parts
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cardname
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.20.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ethan McCutchen
|
|
@@ -81,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
82
|
version: '0'
|
|
83
83
|
requirements: []
|
|
84
|
-
rubygems_version: 3.
|
|
84
|
+
rubygems_version: 3.7.2
|
|
85
85
|
specification_version: 4
|
|
86
86
|
summary: Card names without all the cards
|
|
87
87
|
test_files: []
|