citeproc-ruby 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/citeproc/ruby/format.rb +19 -6
- data/lib/citeproc/ruby/version.rb +1 -1
- data/spec/citeproc/ruby/formats/default_spec.rb +6 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7e27a2fa38bed79e8ede700e8c56dcdf3c85385
|
4
|
+
data.tar.gz: e3dca73a24fe2e19af75a443c3ab421a648840d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0378f97fc8968a919bea8128dfba1552b1dd4142a344fcff8ff79317868205f6978594efa870736436278748eee0f7e5a9816e80e07657351fb5a6f5421d0998
|
7
|
+
data.tar.gz: 8f008779a3f1d1aa21025daf6d24aa3ea288ad38b4961458c9a631ecaa51549fe01c5210fe0ce9106527dbfb5edbbfa96648089982377fa951c3c8bb50061298
|
data/Gemfile
CHANGED
data/lib/citeproc/ruby/format.rb
CHANGED
@@ -231,16 +231,29 @@ module CiteProc
|
|
231
231
|
|
232
232
|
# TODO exceptions: word followed by colon
|
233
233
|
first = true
|
234
|
-
output.gsub!(/\b(\p{
|
235
|
-
|
234
|
+
output.gsub!(/\b(\p{L})([\p{L}\.]+)\b/) do |word|
|
235
|
+
first_letter = $1
|
236
|
+
rest_of_word = $2
|
237
|
+
result = word
|
238
|
+
|
239
|
+
if first_letter.match(/^\p{Ll}/) && (!Format.stopword?(word) || first)
|
240
|
+
result = "#{CiteProc.upcase(first_letter)}#{rest_of_word}"
|
241
|
+
end
|
242
|
+
first = false
|
243
|
+
result
|
244
|
+
end
|
245
|
+
|
246
|
+
output.gsub!(/(\.|\b)(\p{Ll})([\p{L}\.]+)\b$/) do |word|
|
247
|
+
word_boundary = $1
|
248
|
+
first_letter = $2
|
249
|
+
rest_of_word = $3
|
250
|
+
|
251
|
+
if word_boundary == '.'
|
236
252
|
word
|
237
253
|
else
|
238
|
-
|
239
|
-
"#{CiteProc.upcase($1)}#{$2}"
|
254
|
+
"#{CiteProc.upcase($2)}#{$3}"
|
240
255
|
end
|
241
256
|
end
|
242
|
-
output.gsub!(/\b(\p{Ll})(\p{L}+)\b$/) { "#{CiteProc.upcase($1)}#{$2}" }
|
243
|
-
|
244
257
|
end
|
245
258
|
end
|
246
259
|
|
@@ -111,6 +111,12 @@ module CiteProc
|
|
111
111
|
expect(format.apply('history of the word the', node)).to eq('History of the Word The')
|
112
112
|
expect(format.apply('faster than the speed of sound', node)).to eq('Faster than the Speed of Sound')
|
113
113
|
expect(format.apply('on the drug-resistance of enteric bacteria', node)).to eq('On the Drug-Resistance of Enteric Bacteria')
|
114
|
+
expect(format.apply("The Mote in God's eye", node)).to eq("The Mote in God's Eye")
|
115
|
+
expect(format.apply("The Mote in God eye", node)).to eq("The Mote in God Eye")
|
116
|
+
expect(format.apply("Music community mourns death of one of its leaders", node)).to eq("Music Community Mourns Death of One of Its Leaders")
|
117
|
+
expect(format.apply("Pride and Prejudice", node)).to eq("Pride and Prejudice")
|
118
|
+
expect(format.apply("Check the page: easybib.com", node)).to eq("Check the Page: Easybib.com")
|
119
|
+
expect(format.apply("Dogs life.obviously the best guide for pet owners", node)).to eq("Dogs Life.obviously the Best Guide for Pet Owners")
|
114
120
|
end
|
115
121
|
end
|
116
122
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: citeproc-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylvester Keil
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: citeproc
|
@@ -117,7 +117,7 @@ files:
|
|
117
117
|
- spec/spec_helper.rb
|
118
118
|
homepage: https://github.com/inukshuk/citeproc-ruby
|
119
119
|
licenses:
|
120
|
-
- AGPL
|
120
|
+
- AGPL-3.0
|
121
121
|
metadata: {}
|
122
122
|
post_install_message:
|
123
123
|
rdoc_options: []
|
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
135
|
version: '0'
|
136
136
|
requirements: []
|
137
137
|
rubyforge_project:
|
138
|
-
rubygems_version: 2.
|
138
|
+
rubygems_version: 2.5.1
|
139
139
|
signing_key:
|
140
140
|
specification_version: 4
|
141
141
|
summary: A Citation Style Language (CSL) cite processor
|