cite-me 0.0.7 → 0.0.8
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 +4 -4
- data/lib/cite_me.rb +8 -3
- 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: 8a124c30e7e900f661eabbc3c32119e89a71a631
|
4
|
+
data.tar.gz: 8b78e4a5f899ed873cd7c8dacd0fc8285b7c1fc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff7c27c29bc092e82754f37ba48265e243f377128bc80b76c2400e852d75940a77ed41d694ad48d3c10f2b30eeb6f9ef3aeeb52dfc04a771191a58351a4d572f
|
7
|
+
data.tar.gz: f679b1cc1fa7ba1eccdeee10729cd53e56ff28aec0291dec46f0671bbaae00aeb2cc33a8b7dccc7932ff0f2b1559f3de3d30d805bfda0c64a34f692e63a3cba6
|
data/lib/cite_me.rb
CHANGED
@@ -36,7 +36,7 @@ class Cite_Me
|
|
36
36
|
def mla_book_generate_citation(clean_options)
|
37
37
|
output = ''
|
38
38
|
output << author_info(clean_options)
|
39
|
-
output << "<i>" + clean_options[:title] + "</i>. " if clean_options[:title]
|
39
|
+
output << "<i>" + format_title(clean_options[:title]) + "</i>. " if clean_options[:title]
|
40
40
|
output << clean_options[:city_of_publication] + ": " if clean_options[:city_of_publication]
|
41
41
|
output << clean_options[:publisher] + ", " if clean_options[:publisher]
|
42
42
|
output << year_of_publication(clean_options[:year_of_publication])
|
@@ -48,7 +48,7 @@ class Cite_Me
|
|
48
48
|
def mla_magazine_generate_citation(clean_options)
|
49
49
|
output = ''
|
50
50
|
output << author_info(clean_options)
|
51
|
-
output << %{"#{clean_options[:title_of_article]}." }
|
51
|
+
output << %{"#{format_title clean_options[:title_of_article]}." }
|
52
52
|
output << "<i>" + clean_options[:title_of_periodical] + "</i> "
|
53
53
|
output << clean_options[:publication_date] + ": "
|
54
54
|
output << clean_options[:pages] + ". "
|
@@ -68,7 +68,12 @@ class Cite_Me
|
|
68
68
|
|
69
69
|
output
|
70
70
|
end
|
71
|
-
|
71
|
+
|
72
|
+
def format_title(title)
|
73
|
+
# If the entry ends in '?', '!', or '.', do not add a '.' to the end
|
74
|
+
%w[? ! .].include?(title[-1]) ? title[0..(title.length-2)] : title
|
75
|
+
end
|
76
|
+
|
72
77
|
def authors(option)
|
73
78
|
author_string = ''
|
74
79
|
if option.is_a? String
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cite-me
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jacob Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Properly MLA formatted citations (suitable for a bibliography) from ActiveRecord
|
14
14
|
Object or hash.
|