cite-me 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cite_me.rb +11 -9
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8a124c30e7e900f661eabbc3c32119e89a71a631
4
- data.tar.gz: 8b78e4a5f899ed873cd7c8dacd0fc8285b7c1fc7
3
+ metadata.gz: 9f7332ba7339ac351690687825ee8fc59e2ef4d6
4
+ data.tar.gz: 212889b24118c86b6ab9dd229de8c95b0a03e334
5
5
  SHA512:
6
- metadata.gz: ff7c27c29bc092e82754f37ba48265e243f377128bc80b76c2400e852d75940a77ed41d694ad48d3c10f2b30eeb6f9ef3aeeb52dfc04a771191a58351a4d572f
7
- data.tar.gz: f679b1cc1fa7ba1eccdeee10729cd53e56ff28aec0291dec46f0671bbaae00aeb2cc33a8b7dccc7932ff0f2b1559f3de3d30d805bfda0c64a34f692e63a3cba6
6
+ metadata.gz: ca87b9765e9682f1f875bd74ebc2c3ccb2259ec6efa224ae62bce9263660ecb1cd7da0bd24d612b5465b9c88250c439c436c04e8acf8726beb4758cc7ef474bb
7
+ data.tar.gz: 1a73fae9bef0d358d38cafbc1cba3db4cf9952d081900612ee61be4d0abdebfe34a07a53eb8618ff18f6bb94beea65a8db54105a281816d3d1a9f5b15e0ad1e3
@@ -48,11 +48,11 @@ class Cite_Me
48
48
  def mla_magazine_generate_citation(clean_options)
49
49
  output = ''
50
50
  output << author_info(clean_options)
51
- output << %{"#{format_title clean_options[:title_of_article]}." }
52
- output << "<i>" + clean_options[:title_of_periodical] + "</i> "
53
- output << clean_options[:publication_date] + ": "
54
- output << clean_options[:pages] + ". "
55
- output << clean_options[:medium] + "."
51
+ output << %{"#{format_title clean_options[:title_of_article]}." } if clean_options[:title_of_article]
52
+ output << "<i>" + clean_options[:title_of_periodical] + "</i> " if clean_options[:title_of_periodical]
53
+ output << clean_options[:publication_date] + ": " if clean_options[:publication_date]
54
+ output << clean_options[:pages] + ". " if clean_options[:pages]
55
+ output << clean_options[:medium] + "." if clean_options[:medium]
56
56
 
57
57
  output
58
58
  end
@@ -60,11 +60,11 @@ class Cite_Me
60
60
  def mla_web_generate_citation(clean_options)
61
61
  output = ''
62
62
  output << author_info(clean_options)
63
- output << "<i>" + clean_options[:name_of_site] + "</i>. "
64
- output << clean_options[:name_of_organization] + ", "
65
- output << clean_options[:date_of_creation] + ". "
63
+ output << "<i>" + clean_options[:name_of_site] + "</i>. " if clean_options[:name_of_site]
64
+ output << clean_options[:name_of_organization] + ", " if clean_options[:name_of_organization]
65
+ output << clean_options[:date_of_creation] + ". " if clean_options[:date_of_creation]
66
66
  output << 'Web. '
67
- output << clean_options[:date_of_access] + "."
67
+ output << clean_options[:date_of_access] + "." if clean_options[:date_of_access]
68
68
 
69
69
  output
70
70
  end
@@ -89,6 +89,8 @@ class Cite_Me
89
89
  if author =~ /,/
90
90
  # Doe, John A.
91
91
  author_string += author
92
+ # option.length - 1 checks if last entry in array of authors
93
+ # if so, end with period, else, 'and , '
92
94
  author_string += index == option.length - 1 ? ". " : "and , "
93
95
  else
94
96
  # John Doe or John A. Doe
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.8
4
+ version: 0.0.9
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-03-17 00:00:00.000000000 Z
11
+ date: 2014-03-27 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.