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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cite_me.rb +8 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 144f2e5f846be3678036287b251b3da27b390d3a
4
- data.tar.gz: 22c5cda12c1bf9902c4f2c993f588251470a376d
3
+ metadata.gz: 8a124c30e7e900f661eabbc3c32119e89a71a631
4
+ data.tar.gz: 8b78e4a5f899ed873cd7c8dacd0fc8285b7c1fc7
5
5
  SHA512:
6
- metadata.gz: 64aabc5a1ec8a731b944dff9d0a11a8c9349900bb67cdb4a85d6f05e243de5953974161bc8bb2e8360ca68bc7ab48135c9f84d045efb5054d8d59ebe82ee385b
7
- data.tar.gz: aedae4ec1d453417408c94b60b792b6626736b674e520c9a6082abd2e52a4541e6df093c6b4d7fb5abf724b9ce7cbb5a161adb8c501791eadd970b36f8081c22
6
+ metadata.gz: ff7c27c29bc092e82754f37ba48265e243f377128bc80b76c2400e852d75940a77ed41d694ad48d3c10f2b30eeb6f9ef3aeeb52dfc04a771191a58351a4d572f
7
+ data.tar.gz: f679b1cc1fa7ba1eccdeee10729cd53e56ff28aec0291dec46f0671bbaae00aeb2cc33a8b7dccc7932ff0f2b1559f3de3d30d805bfda0c64a34f692e63a3cba6
@@ -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.7
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-02-07 00:00:00.000000000 Z
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.