cb_nitride 0.1.22 → 0.1.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cb_nitride/title_formatter.rb +15 -3
- data/lib/cb_nitride/version.rb +1 -1
- data/test/unit/title_formatter_test.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6b494e27adcf878a9145ac4e22333026bec9189
|
4
|
+
data.tar.gz: cb2a3b2b03bc0d938d7ed2895901140807521ec1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1707bad69271bef8b1540058d546642a37c02e14c9e708b2dfbd0a98a3b915edc827d88c8627e71a923c0ac015d7926b2b62fb75c8d815f161f73d811f6286cd
|
7
|
+
data.tar.gz: 98ec263372161f6f5cc44bfa7ce6367a971890b51ffe320693436692668f24b64f968f5d8874f5c2f32f5fc16671f187f1e1dfb02e54f5ecbe0df341b40e508a
|
@@ -19,11 +19,23 @@ module CbNitride
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def special_number
|
22
|
-
@_special_number ||=
|
22
|
+
@_special_number ||=
|
23
|
+
match = clean_title.match(/#\S+/).to_s.gsub('#', '').strip
|
24
|
+
if match.empty?
|
25
|
+
nil
|
26
|
+
else
|
27
|
+
match
|
28
|
+
end
|
23
29
|
end
|
24
30
|
|
25
31
|
def issue_number
|
26
|
-
@_issue_number ||=
|
32
|
+
@_issue_number ||=
|
33
|
+
match = clean_title.match(/#\d+/).to_s.gsub('#', '').strip
|
34
|
+
if match.empty?
|
35
|
+
nil
|
36
|
+
else
|
37
|
+
match.to_i
|
38
|
+
end
|
27
39
|
end
|
28
40
|
|
29
41
|
def limited_series_max_issue
|
@@ -48,7 +60,7 @@ module CbNitride
|
|
48
60
|
end
|
49
61
|
|
50
62
|
def clean_title
|
51
|
-
@_clean_title ||=
|
63
|
+
@_clean_title ||=
|
52
64
|
raw_title.gsub(/[(][C].*[)]?/, '').gsub('(MR)', '').gsub('(NET)', '').strip
|
53
65
|
end
|
54
66
|
|
data/lib/cb_nitride/version.rb
CHANGED
@@ -6,6 +6,10 @@ class CbNitride::TitleFormatterTest < MiniTest::Unit::TestCase
|
|
6
6
|
@_issue ||= CbNitride::TitleFormatter.new('GREEN LANTERN #17')
|
7
7
|
end
|
8
8
|
|
9
|
+
def one_shot
|
10
|
+
@_one_shot ||= CbNitride::TitleFormatter.new('8BIT ZOMBIES ONE SHOT')
|
11
|
+
end
|
12
|
+
|
9
13
|
def variant
|
10
14
|
@_variant ||= CbNitride::TitleFormatter.new('GREEN LANTERN #17 CVR B ZAYAS')
|
11
15
|
end
|
@@ -27,6 +31,7 @@ class CbNitride::TitleFormatterTest < MiniTest::Unit::TestCase
|
|
27
31
|
end
|
28
32
|
|
29
33
|
def test_issue_number
|
34
|
+
assert_equal nil, one_shot.issue_number
|
30
35
|
assert_equal 17, issue.issue_number
|
31
36
|
assert_equal 17, variant.issue_number
|
32
37
|
assert_equal 10, special_number.issue_number
|
@@ -34,6 +39,7 @@ class CbNitride::TitleFormatterTest < MiniTest::Unit::TestCase
|
|
34
39
|
end
|
35
40
|
|
36
41
|
def test_special_number
|
42
|
+
assert_equal nil, one_shot.special_number
|
37
43
|
assert_equal '17', issue.special_number
|
38
44
|
assert_equal '17', variant.special_number
|
39
45
|
assert_equal '10AI', special_number.special_number
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cb_nitride
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Jarvis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|