texstyles 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/texstyles/style.rb +5 -4
- data/texstyles.gemspec +1 -1
- 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: 9025e4823886d88868c345453223241c4efdf271
|
4
|
+
data.tar.gz: 56cfe60c20c149d388370b36999165357e372a01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f6fa85b6a4ed09dd8be11dce387085855f8fec712a4e18e9553c2ad155c18dcb17a35bb0c9deabaedb74fb0582104ed11905b913c5babd950d87ffd51819459
|
7
|
+
data.tar.gz: bac35af4bf71ca82fd4fdba12bfdf25ad686ca73ca43031d688968ecea255d459e4d4f5e6cd5b5afd3269857744c6c39e41f247ae753373a5a4685fcd5575670
|
data/lib/texstyles/style.rb
CHANGED
@@ -36,8 +36,7 @@ module Texstyles
|
|
36
36
|
@short_title = options["short_title"].to_s
|
37
37
|
|
38
38
|
@authors = options["authors"] || []
|
39
|
-
@affiliations = options["affiliations"] ||
|
40
|
-
|
39
|
+
@affiliations = options["affiliations"] || {}
|
41
40
|
# TODO: Refactor these together with the templates into a more elegant workflow,
|
42
41
|
# more aware of multiple affiliations
|
43
42
|
@authors.each do |data|
|
@@ -46,9 +45,11 @@ module Texstyles
|
|
46
45
|
end
|
47
46
|
@first_author_data = @authors[0] || {}
|
48
47
|
@first_author = @first_author_data["name"].to_s
|
49
|
-
@first_affiliation = @first_author_data["affiliation"].to_s
|
48
|
+
@first_affiliation = @first_author_data["affiliation"] && @affiliations[@first_author_data["affiliation"]].to_s
|
50
49
|
@coauthor_list = @authors[1..-1].to_a.map{|data| data["name"]}
|
51
|
-
@coauthor_affiliations = @authors[1..-1].to_a.map
|
50
|
+
@coauthor_affiliations = @authors[1..-1].to_a.map do |data|
|
51
|
+
data["affiliation"] && @affiliations[data["affiliation"]].to_s
|
52
|
+
end
|
52
53
|
|
53
54
|
@abstract = options["abstract"].to_s
|
54
55
|
if !@abstract.empty?
|
data/texstyles.gemspec
CHANGED