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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 99d4fbe3c33352cc9143a0b84fc7840e97fb7360
4
- data.tar.gz: ae94ede681d49dbd1855e36e9b6706a95671d52f
3
+ metadata.gz: d6b494e27adcf878a9145ac4e22333026bec9189
4
+ data.tar.gz: cb2a3b2b03bc0d938d7ed2895901140807521ec1
5
5
  SHA512:
6
- metadata.gz: 6be57ca2aa97c4ba9e0280a616d2cc7a4e239800199ce18d6d198837289f7432b0667f53ad2419d2aef14068b586424f6cf08da7112115deb5a0d410cab6b825
7
- data.tar.gz: 695a6ed092bb4d81bc10dcb691aa58f4f419dbcbbd06f480a585050fa310d8699eff1b7ad6684e65b0a6d05ab8531fbbb274db6a5cecafa4918fa2b79f7dac92
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 ||= clean_title.match(/#\S+/).to_s.gsub('#', '').strip
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 ||= clean_title.match(/#\d+/).to_s.gsub('#', '').strip.to_i
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
 
@@ -1,3 +1,3 @@
1
1
  module CbNitride
2
- VERSION = "0.1.22"
2
+ VERSION = "0.1.23"
3
3
  end
@@ -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.22
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-15 00:00:00.000000000 Z
11
+ date: 2013-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler