bibtex-ruby 4.0.9 → 4.0.10

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of bibtex-ruby might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2f2055578c69cdfb2aa719688639882a4d68932a
4
- data.tar.gz: 8c7bd4bd76d72e4ed17ce9389cfb4909021295b9
3
+ metadata.gz: bd0b7ed6fae8b54fe92038e224573b83cc8c1457
4
+ data.tar.gz: 307152a43c8441177761785ff7c111da8dc1264a
5
5
  SHA512:
6
- metadata.gz: cf24c8ee4bb399cfe75a8a095dc121183c1ba0ee0c34bfc80897a875dac1c9258c26c75daddc18bc2b0e8b5f5e8171e7b030b78b71fdc1d0db3f246849a09696
7
- data.tar.gz: 846351ae31be705763d67ea66ccc460769d0781d0451b16dc6d2cf1949cddcece14649b2d961ee15f7cc9ee9b3ae2d5f78ef66b6fe746fa451d3abf6c5f11380
6
+ metadata.gz: a2a9dad80be0fb13d3df9aa82a7a450ed368700e5d8c9e67201f07cd2c094d7fecc2125df34253a6ce4cd57a5189ccc25be8649f74b7747112c4eb8aceace979
7
+ data.tar.gz: e39ab150cc93ccd7be0b498d73cc0e1097f53f3378faab7b04dd6a13ffe0d557cdd649a0c590518c0c26e58bccec3bc2634a756f08494659da4dfca600970165
@@ -182,7 +182,7 @@ module BibTeX
182
182
  def to_s(options = {})
183
183
  return convert(options.delete(:filter)).to_s(options) if options.has_key?(:filter)
184
184
  return value.to_s unless options.has_key?(:quotes) && atomic?
185
- q = [options[:quotes]].flatten
185
+ q = Array(options[:quotes])
186
186
  [q[0], value, q[-1]].compact.join
187
187
  end
188
188
 
@@ -191,10 +191,7 @@ module BibTeX
191
191
  # joined by a '#', additionally, all string tokens will be turned into
192
192
  # string literals (i.e., delimitted by quotes).
193
193
  def value
194
- case
195
- when numeric?
196
- to_i
197
- when atomic?
194
+ if atomic?
198
195
  @tokens[0]
199
196
  else
200
197
  @tokens.map { |v| v.is_a?(::String) ? v.inspect : v }.join(' # ')
@@ -238,7 +235,7 @@ module BibTeX
238
235
 
239
236
  # Returns true if the Value's content is numeric.
240
237
  def numeric?
241
- atomic? && @tokens[0] =~ /^\s*[+-]?\d+[\/\.]?\d*\s*$/
238
+ atomic? && @tokens[0] =~ /^\s*[+-]?\d+\s*$/
242
239
  end
243
240
 
244
241
  def to_i
@@ -20,7 +20,7 @@ module BibTeX
20
20
  module Version
21
21
  MAJOR = 4
22
22
  MINOR = 0
23
- PATCH = 9
23
+ PATCH = 10
24
24
  BUILD = nil
25
25
 
26
26
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.').freeze
@@ -170,9 +170,9 @@ module BibTeX
170
170
  end
171
171
 
172
172
  describe "value" do
173
- it 'returns numbers as numbers' do
174
- assert Value.new('42').v.is_a?(::Fixnum)
175
- assert Value.new('-42').v.is_a?(::Fixnum)
173
+ it 'returns numbers as strings' do
174
+ assert Value.new(42).v.is_a?(::String)
175
+ assert Value.new(-42).v.is_a?(::String)
176
176
  assert Value.new('a42').v.is_a?(::String)
177
177
  end
178
178
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bibtex-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.9
4
+ version: 4.0.10
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-01-20 00:00:00.000000000 Z
11
+ date: 2015-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: latex-decode