csl 1.4.4 → 1.4.5

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: 3e9a04436494ad7b0835b2ad4047f4c0619e2ed9
4
- data.tar.gz: e45ef6316ed80e5df5e384172a79ba312c12cb1b
3
+ metadata.gz: 0713aebef8b4b19124d4c66d1e676fcad67f00f6
4
+ data.tar.gz: cdf39965329842bca3883f1990f5e274af212576
5
5
  SHA512:
6
- metadata.gz: f0c793a99ea9fcb56bb0a13d07a3e20fe9a754dd986f4a052a91fc5f0c0886d0b8f9f958882a9dc50f9ee2e5053005070f96476fba228951ec409487a8a1f279
7
- data.tar.gz: 6aceddaa4130fd9d8031c4c295eb1c19dd44f362bad9abe5a2b5459e35d20db98933a34f0fd24eaed1dd872edf8850305beb42d4f1d80ee349a8066fb703efe5
6
+ metadata.gz: dec7d5d77b9b9e480cf8bb7adcc626054a8702cfb4733a1fb084dd00f09e5acaf141b71da301f21021bf5c0667afc6479f101a39b7a7bd3c8dcff7f9f138f7e9
7
+ data.tar.gz: e59701c6f0016b4610429df1a4c17edc201dad11efd416c92134e6f22a23abd55d62a58cd5fd25b9987644f93012b331229562dbf0e0968532f206d7577b6e25
data/Gemfile CHANGED
@@ -5,9 +5,6 @@ group :development, :test do
5
5
  gem 'rake', '~>10.0'
6
6
  gem 'rspec', '~>3.0'
7
7
  gem 'cucumber', '~>1.2'
8
- gem 'simplecov', '~>0.8', :require => false
9
- gem 'rubinius-coverage', :platform => :rbx
10
- gem 'coveralls', :require => false
11
8
  end
12
9
 
13
10
  group :debug do
@@ -39,12 +36,16 @@ group :extra do
39
36
  gem 'redcarpet', '~>3.0', :platforms => :mri
40
37
  end
41
38
 
39
+ group :coverage do
40
+ gem 'coveralls', :require => false
41
+ gem 'simplecov', '~>0.8', :require => false
42
+ gem 'rubinius-coverage', :platform => :rbx
43
+ end
44
+
42
45
  group :rbx do
43
- platform :rbx do
44
- gem 'rubysl', '~>2.0'
45
- gem 'json', '~>1.8'
46
- gem 'racc'
47
- end
46
+ gem 'rubysl', '~>2.0', :platforms => :rbx
47
+ gem 'racc', :platforms => :rbx
48
+ gem 'json', '~>1.8', :platforms => :rbx
48
49
  end
49
50
 
50
51
  # vim: syntax=ruby
data/Rakefile CHANGED
@@ -34,9 +34,13 @@ Cucumber::Rake::Task.new(:cucumber) do |t|
34
34
  t.profile = 'default'
35
35
  end
36
36
 
37
- require 'coveralls/rake/task'
38
- Coveralls::RakeTask.new
39
- task :test_with_coveralls => [:spec, :cucumber, 'coveralls:push']
37
+ begin
38
+ require 'coveralls/rake/task'
39
+ Coveralls::RakeTask.new
40
+ task :test_with_coveralls => [:spec, :cucumber, 'coveralls:push']
41
+ rescue LoadError => e
42
+ # ignore
43
+ end
40
44
 
41
45
  task :release do |t|
42
46
  system "gem build csl.gemspec"
@@ -88,32 +88,32 @@ module CSL
88
88
  def truncate?(names, subsequent = false)
89
89
  names = names.length if names.respond_to?(:length)
90
90
  limit = truncate_when(subsequent)
91
+ count = truncate_at(subsequent)
91
92
 
92
- !limit.zero? && names.to_i >= limit
93
+ !count.nil? && !limit.nil? && names.to_i >= limit.to_i
93
94
  end
94
95
 
95
96
  # @param [Enumerable] names
96
97
  # @return [Array] the truncated list of names
97
98
  def truncate(names, subsequent = false)
98
- limit = truncate_at(subsequent)
99
-
100
- return [] if limit.zero?
101
- names.take limit
99
+ count = truncate_at(subsequent)
100
+ count = names.length if count.nil?
101
+ names.take count.to_i
102
102
  end
103
103
 
104
104
  def truncate_when(subsequent = false)
105
105
  if subsequent && attribute?(:'et-al-subsequent-min')
106
- attributes[:'et-al-subsequent-min'].to_i
106
+ attributes[:'et-al-subsequent-min']
107
107
  else
108
- attributes[:'et-al-min'].to_i
108
+ attributes[:'et-al-min']
109
109
  end
110
110
  end
111
111
 
112
112
  def truncate_at(subsequent = false)
113
113
  if subsequent && attribute?(:'et-al-subsequent-use-first')
114
- attributes.fetch(:'et-al-subsequent-use-first', 1).to_i
114
+ attributes.fetch(:'et-al-subsequent-use-first')
115
115
  else
116
- attributes.fetch(:'et-al-use-first', 1).to_i
116
+ attributes.fetch(:'et-al-use-first')
117
117
  end
118
118
  end
119
119
 
@@ -1,3 +1,3 @@
1
1
  module CSL
2
- VERSION = '1.4.4'.freeze
2
+ VERSION = '1.4.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.4
4
+ version: 1.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvester Keil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-22 00:00:00.000000000 Z
11
+ date: 2016-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: namae
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  version: '0'
140
140
  requirements: []
141
141
  rubyforge_project:
142
- rubygems_version: 2.5.1
142
+ rubygems_version: 2.6.3
143
143
  signing_key:
144
144
  specification_version: 4
145
145
  summary: A Ruby CSL parser and library
@@ -182,4 +182,3 @@ test_files:
182
182
  - spec/fixtures/locales/locales-en-US.xml
183
183
  - spec/fixtures/styles/apa.csl
184
184
  - spec/spec_helper.rb
185
- has_rdoc: yard