amakanize 0.1.1 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c1826d336d43549a750c59f725183e70e8826a55
4
- data.tar.gz: ee2be56691fd527ab658aca825937a41d7c7d825
3
+ metadata.gz: 17a6271952f1edde3b07502566120537099420de
4
+ data.tar.gz: 76dc9cb6a20b8423f0709d38a05437bf72cfd243
5
5
  SHA512:
6
- metadata.gz: b5045e80b12ba75b012c16d76f3b5b735d2ba5723f0cf762dc1ecd4a17e08a004ff8f78783396060580500dc94d22909ea55b06ed5d0f30edb3e9bb6bca735b3
7
- data.tar.gz: 9191e457ac554fdd9bfd9dd12ce84624b5e4509334e65698e460cf3002cec49c069b9f1c05b46c8b12d1e3e21b7c8b1a3a675e4e2ac6379aedff23a04fc293cf
6
+ metadata.gz: e4dd61963d97238e02e98e080304500a8378d844ccb45e8b2210373b02615fb6a6f6e040d084d5505bc021324f08ab9738b941be0d34768b91e449fa7c904f58
7
+ data.tar.gz: eb6311e059c4fe61fd0e17bcd3361982eaf060d0edc2f3988a3e6df08fca391d1370f17e94b11f2bbe9bd45aaadbbd0a59cb3f2f687a192cf501b597d46906bc
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.1.2
2
+ - Add AuthorNames class
3
+
1
4
  ## 0.1.1
2
5
  - Support x and X as roman numeric
3
6
 
data/README.md CHANGED
@@ -11,6 +11,10 @@ Amakanize::AuthorName.new("ぽんかん(8)").to_s #=> "ぽんかん8"
11
11
  Amakanize::AuthorName.new("ぽんかん8").to_s #=> "ぽんかん8"
12
12
  Amakanize::AuthorName.new("ぽんかん⑧").to_s #=> "ぽんかん8"
13
13
 
14
+ Amakanize::AuthorNames.new("ぽんかん⑧,渡 航").map(&:to_s) #=> ["ぽんかん8", "渡航"],
15
+ Amakanize::AuthorNames.new("ぽんかん⑧,渡 航").map(&:to_s) #=> ["ぽんかん8", "渡航"],
16
+ Amakanize::AuthorNames.new("ぽんかん⑧、渡 航").map(&:to_s) #=> ["ぽんかん8", "渡航"],
17
+
14
18
  Amaakanize::SeriesName.new("やはり俺の青春ラブコメはまちがっている。4").to_s #=> "やはり俺の青春ラブコメはまちがっている。"
15
19
  Amaakanize::SeriesName.new("ラブライブ! School idol diary ~星空凛~".to_s #=> "ラブライブ! School idol diary"
16
20
  Amaakanize::SeriesName.new("僕だけがいない街 (1) (カドカワコミックス・エース)").to_s #=> "僕だけがいない街"
data/lib/amakanize.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require "amakanize/author_name"
2
+ require "amakanize/author_names"
2
3
  require "amakanize/filters/base_filter"
3
4
  require "amakanize/filters/html_unescape_filter"
4
5
  require "amakanize/filters/normalization_filter"
@@ -0,0 +1,22 @@
1
+ module Amakanize
2
+ class AuthorNames
3
+ include ::Enumerable
4
+
5
+ AUTHOR_NAME_SEPARATORS = %w(
6
+ ,
7
+
8
+
9
+ )
10
+
11
+ # @param raw [String]
12
+ def initialize(raw)
13
+ @raw = raw
14
+ end
15
+
16
+ def each(&block)
17
+ @raw.split(::Regexp.union(AUTHOR_NAME_SEPARATORS)).map do |author_name|
18
+ ::Amakanize::AuthorName.new(author_name)
19
+ end.each(&block)
20
+ end
21
+ end
22
+ end
@@ -1,3 +1,3 @@
1
1
  module Amakanize
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amakanize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - r7kamura
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-07-22 00:00:00.000000000 Z
11
+ date: 2016-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -86,6 +86,7 @@ files:
86
86
  - bin/setup
87
87
  - lib/amakanize.rb
88
88
  - lib/amakanize/author_name.rb
89
+ - lib/amakanize/author_names.rb
89
90
  - lib/amakanize/filters/base_filter.rb
90
91
  - lib/amakanize/filters/html_unescape_filter.rb
91
92
  - lib/amakanize/filters/normalization_filter.rb