citero 1.0.0.alpha → 1.0.0.alpha2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/citero.rb +2 -0
- data/lib/citero/csf.rb +4 -2
- data/lib/citero/inputs/readers/pnx_reader.rb +3 -1
- data/lib/citero/outputs/bibtex.rb +5 -2
- data/lib/citero/version.rb +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: 50f0b73776691252a7f3bfc0ee4aaca8a2db0a38
|
4
|
+
data.tar.gz: 952b09dba40b178bb5f6dd88eafc9f16f5c95a13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aaecd9a89c67cbedec54da979d8510629649dae12dc92569c09ee6a0057217b463129aca6e357edcfe72ee87e0aa50cce6dae44bdeef28a0f1d3549457a3a452
|
7
|
+
data.tar.gz: 237304a7c1c66cef113c5e06d3d739448670c2f5795eba98e293c4116ed9afd5e92d21277579980f82c6b8da5db046c6f606db16af53532af8e2c674885ce173
|
data/lib/citero.rb
CHANGED
@@ -46,6 +46,7 @@ module Citero
|
|
46
46
|
|
47
47
|
def self.to_(format)
|
48
48
|
@to_format = format.to_sym
|
49
|
+
return @input if @from_format.eql?(@to_format)
|
49
50
|
|
50
51
|
case @from_format
|
51
52
|
when :csf
|
@@ -74,6 +75,7 @@ module Citero
|
|
74
75
|
when :csf
|
75
76
|
str = ""
|
76
77
|
from.csf.each do |k,v|
|
78
|
+
next if v.nil?
|
77
79
|
if v.kind_of?(Array)
|
78
80
|
v.each do |va|
|
79
81
|
str = "#{str}#{k}: #{va.gsub('.','\.').gsub(',','\,')}\n"
|
data/lib/citero/csf.rb
CHANGED
@@ -22,8 +22,10 @@ module Citero
|
|
22
22
|
end
|
23
23
|
|
24
24
|
private
|
25
|
-
def element_or_list(
|
26
|
-
|
25
|
+
def element_or_list(old_value, new_value)
|
26
|
+
return old_value if new_value.nil?
|
27
|
+
temp_arr = [old_value, new_value].flatten.compact
|
28
|
+
return nil if temp_arr.empty?
|
27
29
|
return temp_arr.first if temp_arr.size == 1
|
28
30
|
return temp_arr
|
29
31
|
end
|
@@ -122,7 +122,9 @@ module Citero
|
|
122
122
|
end
|
123
123
|
|
124
124
|
def get_all_values_from_pnx(path)
|
125
|
-
@data.locate(path).flatten.collect(&:text)
|
125
|
+
return_val = @data.locate(path).flatten.collect(&:text)
|
126
|
+
return if return_val.nil?
|
127
|
+
return_val
|
126
128
|
end
|
127
129
|
|
128
130
|
def method_missing(method_sym, *arguments, &block)
|
@@ -29,7 +29,7 @@ module Citero
|
|
29
29
|
start << publicationTitle
|
30
30
|
start << pages
|
31
31
|
start << webpage
|
32
|
-
start.compact.join(",\n
|
32
|
+
start.compact.join(",\n")
|
33
33
|
end
|
34
34
|
|
35
35
|
def publisher
|
@@ -85,7 +85,10 @@ module Citero
|
|
85
85
|
end
|
86
86
|
|
87
87
|
def add_to_bibtex_output(key,value)
|
88
|
-
return if value.nil?
|
88
|
+
return if value.nil?
|
89
|
+
return if value.class.eql?(String) && value.strip.empty?
|
90
|
+
return if value.class.eql?(Array) && value.empty?
|
91
|
+
return if value.class.eql?(Hash) && value.empty?
|
89
92
|
value = value.join(', ') if value.class.eql?(Array)
|
90
93
|
output = "#{key} = "
|
91
94
|
value = "{#{value}}" unless expects_number_value?(key,value)
|
data/lib/citero/version.rb
CHANGED