cite-me 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cite_me.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e450fd5b48929fcf3c1f7ff87869f995f21b5b7
|
4
|
+
data.tar.gz: 7cad700f7d59cfac7a8d5e82b562bd8a29d19908
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 401c99db199e8a5a847d39cc3c2d7e1f340a1c028c48c45c1551bd14a9803cfdd4b3e5a9a6bfc18fe8acb79b03f7bfed23887a0581bbe97b474698c69f07dc5f
|
7
|
+
data.tar.gz: 59e3c002be13de426fca20c672b9a8ec441ee444a53f5512b4390bb6dedc5e8ce2ec37c04be5114547d60b0d4f3359f4073fb6b7c9e79005b4b57681da4e44ad
|
data/lib/cite_me.rb
CHANGED
@@ -88,7 +88,7 @@ class Cite_Me
|
|
88
88
|
option.each_with_index do |author, index|
|
89
89
|
if author =~ /,/
|
90
90
|
# Doe, John A.
|
91
|
-
author_string += author
|
91
|
+
author_string += author.to_s
|
92
92
|
# option.length - 1 checks if last entry in array of authors
|
93
93
|
# if so, end with period, else, 'and , '
|
94
94
|
author_string += index == option.length - 1 ? ". " : "and , "
|
@@ -96,7 +96,7 @@ class Cite_Me
|
|
96
96
|
# John Doe or John A. Doe
|
97
97
|
name = author.split(" ")
|
98
98
|
middle_initial = author.scan(/ \w\. /)
|
99
|
-
author_string += name.last.
|
99
|
+
author_string += name.last.to_s + ", " + name.first.to_s + middle_initial.first.to_s
|
100
100
|
# add a period if it's the last entry and NOT a name with a middle initial
|
101
101
|
author_string += index == option.length - 1 ? ". " : ", and " if middle_initial.empty?
|
102
102
|
end
|