google-book 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -0
- data/lib/google/book/entry.rb +14 -10
- data/lib/google/book/version.rb +1 -1
- data/spec/google/book/entry_spec.rb +4 -0
- metadata +1 -1
data/README.md
CHANGED
data/lib/google/book/entry.rb
CHANGED
@@ -39,16 +39,20 @@ module Google
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def publisher
|
42
|
-
@hash['dc:publisher']
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
42
|
+
publisher = @hash['dc:publisher']
|
43
|
+
|
44
|
+
if publisher
|
45
|
+
publisher.
|
46
|
+
gsub(/[ ,]+Inc.?$/, '').
|
47
|
+
gsub(/[ ,]+Llc.?$/i, '').
|
48
|
+
gsub(/[ ,]+Ltd.?$/, '').
|
49
|
+
gsub(/Intl( |$)/) { "International#{$1}" }.
|
50
|
+
gsub(/Pr( |$)/) { "Press#{$1}" }.
|
51
|
+
gsub(/ Pub$/, ' Publishers').
|
52
|
+
gsub(/ Pubns$/, ' Publications').
|
53
|
+
gsub('Pub Group', 'Publishing Group').
|
54
|
+
gsub(/Univ( |$)/) { "University#{$1}" }
|
55
|
+
end
|
52
56
|
end
|
53
57
|
|
54
58
|
def subjects
|
data/lib/google/book/version.rb
CHANGED