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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1505bd7c43be4b042d57778ccadb05f86311d7b7
4
- data.tar.gz: cb126319a021176b2644df55eb71aa6ff8f34cf5
3
+ metadata.gz: d7e27a2fa38bed79e8ede700e8c56dcdf3c85385
4
+ data.tar.gz: e3dca73a24fe2e19af75a443c3ab421a648840d0
5
5
  SHA512:
6
- metadata.gz: 6f0a3026648a2821fe49f07b2f31a0a6dca24c42b591c3a082fdfd7cc6437b3b7955e61f0a9e9dd8beb7d9649338abd65fb99564e8350750d7b2c436fd9a8f5c
7
- data.tar.gz: 9d8688729edc61ca7830ac472f7e5b56cdcfd95f077636d9ea6428a88e348a34413df3aa7358014b172cecba36f6acb72e849eae527ae22f8f005e0b636a049e
6
+ metadata.gz: 0378f97fc8968a919bea8128dfba1552b1dd4142a344fcff8ff79317868205f6978594efa870736436278748eee0f7e5a9816e80e07657351fb5a6f5421d0998
7
+ data.tar.gz: 8f008779a3f1d1aa21025daf6d24aa3ea288ad38b4961458c9a631ecaa51549fe01c5210fe0ce9106527dbfb5edbbfa96648089982377fa951c3c8bb50061298
data/Gemfile CHANGED
@@ -6,7 +6,7 @@ gemspec
6
6
 
7
7
  group :development, :test do
8
8
  gem 'rake', '~>10.0'
9
- gem 'rspec', '~>3.0'
9
+ gem 'rspec', '~>3.0', '<3.2.0'
10
10
  gem 'cucumber', '~>1.2'
11
11
  gem 'simplecov', '~>0.8'
12
12
  gem 'rubinius-coverage', :platforms => :rbx
@@ -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{Ll})(\p{L}+)\b/) do |word|
235
- if Format.stopword?(word) and not first
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
- first = false
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
 
@@ -1,5 +1,5 @@
1
1
  module CiteProc
2
2
  module Ruby
3
- VERSION = '1.1.0'
3
+ VERSION = '1.1.1'
4
4
  end
5
5
  end
@@ -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.0
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: 2015-05-16 00:00:00.000000000 Z
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.4.5
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