csl 1.4.5 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/ci.yml +26 -0
  3. data/BSDL +1 -1
  4. data/Gemfile +9 -30
  5. data/README.md +1 -5
  6. data/Rakefile +0 -8
  7. data/csl.gemspec +10 -13
  8. data/cucumber.yml +1 -1
  9. data/lib/csl/locale.rb +4 -4
  10. data/lib/csl/locale/term.rb +1 -1
  11. data/lib/csl/node.rb +2 -2
  12. data/lib/csl/treelike.rb +11 -7
  13. data/lib/csl/version.rb +1 -1
  14. metadata +30 -92
  15. data/.rspec +0 -3
  16. data/.simplecov +0 -4
  17. data/Guardfile +0 -15
  18. data/features/locales/loading.feature +0 -57
  19. data/features/locales/ordinalize.feature +0 -713
  20. data/features/parser/choose.feature +0 -16
  21. data/features/parser/info.feature +0 -27
  22. data/features/parser/localized_dates.feature +0 -35
  23. data/features/parser/terms.feature +0 -28
  24. data/features/step_definitions/locale_steps.rb +0 -36
  25. data/features/step_definitions/parser_steps.rb +0 -40
  26. data/features/step_definitions/style_steps.rb +0 -16
  27. data/features/style/loading.feature +0 -53
  28. data/features/support/env.rb +0 -24
  29. data/spec/csl/info_spec.rb +0 -278
  30. data/spec/csl/locale/date_spec.rb +0 -63
  31. data/spec/csl/locale/style_options_spec.rb +0 -19
  32. data/spec/csl/locale/term_spec.rb +0 -255
  33. data/spec/csl/locale_spec.rb +0 -245
  34. data/spec/csl/node_spec.rb +0 -273
  35. data/spec/csl/parser_spec.rb +0 -112
  36. data/spec/csl/schema_spec.rb +0 -112
  37. data/spec/csl/style/bibliography_spec.rb +0 -7
  38. data/spec/csl/style/choose_spec.rb +0 -66
  39. data/spec/csl/style/citation_spec.rb +0 -7
  40. data/spec/csl/style/date_spec.rb +0 -21
  41. data/spec/csl/style/group_spec.rb +0 -7
  42. data/spec/csl/style/label_spec.rb +0 -44
  43. data/spec/csl/style/layout_spec.rb +0 -7
  44. data/spec/csl/style/macro_spec.rb +0 -7
  45. data/spec/csl/style/names_spec.rb +0 -36
  46. data/spec/csl/style/number_spec.rb +0 -85
  47. data/spec/csl/style/sort_spec.rb +0 -11
  48. data/spec/csl/style/text_spec.rb +0 -7
  49. data/spec/csl/style_spec.rb +0 -137
  50. data/spec/csl/treelike_spec.rb +0 -151
  51. data/spec/fixtures/locales/locales-de-DE.xml +0 -298
  52. data/spec/fixtures/locales/locales-en-GB.xml +0 -304
  53. data/spec/fixtures/locales/locales-en-US.xml +0 -304
  54. data/spec/fixtures/styles/apa.csl +0 -443
  55. data/spec/spec_helper.rb +0 -57
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0713aebef8b4b19124d4c66d1e676fcad67f00f6
4
- data.tar.gz: cdf39965329842bca3883f1990f5e274af212576
2
+ SHA256:
3
+ metadata.gz: fb03f0268591576f09ecfcdae39744460bc1b9d35b9b63f186e1c5dee8e131d8
4
+ data.tar.gz: b633824d0f2bc138f74a8747a1785edf2194a6eb2013daa3bac57469474de1c4
5
5
  SHA512:
6
- metadata.gz: dec7d5d77b9b9e480cf8bb7adcc626054a8702cfb4733a1fb084dd00f09e5acaf141b71da301f21021bf5c0667afc6479f101a39b7a7bd3c8dcff7f9f138f7e9
7
- data.tar.gz: e59701c6f0016b4610429df1a4c17edc201dad11efd416c92134e6f22a23abd55d62a58cd5fd25b9987644f93012b331229562dbf0e0968532f206d7577b6e25
6
+ metadata.gz: 41a71ce9c56b13f24c1713c237e90a555113c5a06ec0800e71c53750aa3c9048c1582b1aa3f09ce86d9b964dd84bdca94a9439f84cbc51f35654b1abc6b5a5e1
7
+ data.tar.gz: 4fbe146239c6afc00e3f52768a09758549e0c6c92ed386a9a4c7b97dc1e784564773bca261f4bf848e202ccce31406604db8560fc3573c2b6746e4817c84637a
@@ -0,0 +1,26 @@
1
+ name: CI
2
+ on:
3
+ push:
4
+ branches:
5
+ - master
6
+ pull_request:
7
+ branches:
8
+ - master
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+ env:
13
+ BUNDLE_WITHOUT: debug:extra
14
+ strategy:
15
+ matrix:
16
+ ruby-version:
17
+ - 3.0
18
+ - 2.7
19
+ - 2.6
20
+ steps:
21
+ - uses: actions/checkout@v2
22
+ - uses: ruby/setup-ruby@v1
23
+ with:
24
+ ruby-version: ${{ matrix.ruby-version }}
25
+ bundler-cache: true
26
+ - run: bundle exec rake
data/BSDL CHANGED
@@ -1,7 +1,7 @@
1
1
  CSL-Ruby. A Ruby CSL parser and library.
2
2
 
3
3
  Copyright 2012 President and Fellows of Harvard College.
4
- Copyright 2009-2014 Sylvester Keil. All rights reserved.
4
+ Copyright 2009-2020 Sylvester Keil. All rights reserved.
5
5
 
6
6
  Redistribution and use in source and binary forms, with or without
7
7
  modification, are permitted provided that the following conditions are met:
data/Gemfile CHANGED
@@ -2,50 +2,29 @@ source 'https://rubygems.org'
2
2
  gemspec
3
3
 
4
4
  group :development, :test do
5
- gem 'rake', '~>10.0'
6
- gem 'rspec', '~>3.0'
7
- gem 'cucumber', '~>1.2'
5
+ gem 'rake'
6
+ gem 'rspec'
7
+ gem 'cucumber'
8
8
  end
9
9
 
10
10
  group :debug do
11
- if RUBY_VERSION >= '2.0'
12
- gem 'byebug', :require => false, :platforms => :mri
13
- else
14
- gem 'debugger', :require => false, :platforms => :mri
15
- end
16
-
17
- gem 'ruby-debug', :require => false, :platforms => :jruby
18
-
19
- gem 'rubinius-debugger', :require => false, :platforms => :rbx
20
- gem 'rubinius-compiler', :require => false, :platforms => :rbx
11
+ gem 'byebug', require: false, platforms: :mri
12
+ gem 'ruby-debug', require: false, platforms: :jruby
21
13
  end
22
14
 
23
15
  group :optional do
24
- gem 'nokogiri', '~> 1.6'
16
+ gem 'nokogiri'
25
17
  end
26
18
 
27
19
  group :extra do
28
- gem 'guard', '~>2.2'
29
- gem 'guard-rspec'
30
- gem 'guard-cucumber'
31
- gem 'bond'
32
20
  gem 'diff-lcs'
33
21
  gem 'pry'
34
- gem 'rb-fsevent', '~>0.9', :platforms => :ruby
35
- gem 'yard', '~>0.8', :platforms => :mri
36
- gem 'redcarpet', '~>3.0', :platforms => :mri
22
+ gem 'yard', platforms: :mri
23
+ gem 'redcarpet', platforms: :mri
37
24
  end
38
25
 
39
26
  group :coverage do
40
- gem 'coveralls', :require => false
41
- gem 'simplecov', '~>0.8', :require => false
42
- gem 'rubinius-coverage', :platform => :rbx
43
- end
44
-
45
- group :rbx do
46
- gem 'rubysl', '~>2.0', :platforms => :rbx
47
- gem 'racc', :platforms => :rbx
48
- gem 'json', '~>1.8', :platforms => :rbx
27
+ gem 'simplecov', require: false
49
28
  end
50
29
 
51
30
  # vim: syntax=ruby
data/README.md CHANGED
@@ -4,10 +4,6 @@ CSL-Ruby provides a Ruby parser and a comprehensive API for the
4
4
  [Citation Style Language](http://citationstyles.org) (CSL), an XML-based
5
5
  format to describe the formatting of citations, notes and bibliographies.
6
6
 
7
- [![Build Status](https://secure.travis-ci.org/inukshuk/csl-ruby.png)](http://travis-ci.org/inukshuk/csl-ruby)
8
- [![Coverage Status](https://coveralls.io/repos/inukshuk/csl-ruby/badge.png?branch=master)](https://coveralls.io/r/inukshuk/csl-ruby?branch=master)
9
- [![Dependency Status](https://gemnasium.com/inukshuk/csl-ruby.png)](https://gemnasium.com/inukshuk/csl-ruby)
10
-
11
7
  Styles and Locales
12
8
  ------------------
13
9
  You can load CSL styles and locales by passing a respective XML string, file
@@ -139,7 +135,7 @@ this project as part of [Google Summer of Code](https://developers.google.com/op
139
135
 
140
136
  Copyright
141
137
  ---------
142
- Copyright 2009-2015 Sylvester Keil. All rights reserved.
138
+ Copyright 2009-2020 Sylvester Keil. All rights reserved.
143
139
 
144
140
  Copyright 2012 President and Fellows of Harvard College.
145
141
 
data/Rakefile CHANGED
@@ -34,14 +34,6 @@ Cucumber::Rake::Task.new(:cucumber) do |t|
34
34
  t.profile = 'default'
35
35
  end
36
36
 
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
44
-
45
37
  task :release do |t|
46
38
  system "gem build csl.gemspec"
47
39
  system "git tag #{CSL::VERSION}"
data/csl.gemspec CHANGED
@@ -8,7 +8,9 @@ EXCLUDES = %w{
8
8
  .coveralls.yml
9
9
  .travis.yml
10
10
  .csl.gemspec
11
- }
11
+ .simplecov
12
+ .rspec
13
+ } | `git ls-files -- {spec,features}/*`.split("\n")
12
14
 
13
15
  Gem::Specification.new do |s|
14
16
  s.name = 'csl'
@@ -17,27 +19,22 @@ Gem::Specification.new do |s|
17
19
  s.authors = ['Sylvester Keil']
18
20
  s.email = ['http://sylvester.keil.or.at']
19
21
  s.homepage = 'https://github.com/inukshuk/csl-ruby'
22
+ s.licenses = ['AGPL-3.0','BSD-2-Clause']
23
+ s.date = Time.now.strftime('%Y-%m-%d')
20
24
  s.summary = 'A Ruby CSL parser and library'
21
- s.description =
22
- """
25
+ s.description = <<~EOS
23
26
  A Ruby parser and full API for the Citation Style Language (CSL),
24
27
  an open XML-based language to describe the formatting of citations
25
28
  and bibliographies.
26
- """
27
-
28
- s.license = 'AGPL-3.0'
29
- s.date = Time.now.strftime('%Y-%m-%d')
29
+ EOS
30
30
 
31
- s.required_ruby_version = '>= 1.9.3'
32
31
 
33
- s.add_dependency('namae', ['~>0.7'])
32
+ s.required_ruby_version = '>= 2.2'
33
+ s.add_runtime_dependency('namae', ['~>1.0'])
34
+ s.add_runtime_dependency('rexml')
34
35
 
35
36
  s.files = `git ls-files`.split("\n") - EXCLUDES
36
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
37
- s.executables = []
38
37
  s.require_path = 'lib'
39
-
40
- s.has_rdoc = 'yard'
41
38
  end
42
39
 
43
40
  # vim: syntax=ruby
data/cucumber.yml CHANGED
@@ -1 +1 @@
1
- default: --format progress --require features --color
1
+ default: --format progress --require features --color --publish-quiet
data/lib/csl/locale.rb CHANGED
@@ -330,9 +330,9 @@ module CSL
330
330
  #
331
331
  # Calls block once for each term defined by the locale. If no block is
332
332
  # given, an enumerator is returned instead.
333
- def each_term
333
+ def each_term(&block)
334
334
  if block_given?
335
- terms.each(&Proc.new)
335
+ terms.each(&block)
336
336
  self
337
337
  else
338
338
  enum_for :each_term
@@ -345,12 +345,12 @@ module CSL
345
345
  #
346
346
  # Calls block once for each date format defined by the locale. If no
347
347
  # block is given, an enumerator is returned instead.
348
- def each_date
348
+ def each_date(&block)
349
349
  if block_given?
350
350
  if date.is_a? CSL::Node
351
351
  yield date
352
352
  else
353
- date.each(&Proc.new)
353
+ date.each(&block)
354
354
  end
355
355
  else
356
356
  enum_for :each_date
@@ -441,7 +441,7 @@ module CSL
441
441
  when options.key?(:number) || options.key?('number')
442
442
  key = options[:number] || options['number']
443
443
 
444
- if key.is_a?(Fixnum) || key.to_s =~ /^[+-]?\d+$/
444
+ if key.is_a?(Integer) || key.to_s =~ /^[+-]?\d+$/
445
445
  key.to_i > 1
446
446
  else
447
447
  !key.blank? && key.to_s =~ /^plural/i
data/lib/csl/node.rb CHANGED
@@ -268,9 +268,9 @@ module CSL
268
268
  alias has_defaults? has_default_attributes?
269
269
 
270
270
  # Iterates through the Node's attributes
271
- def each
271
+ def each(&block)
272
272
  if block_given?
273
- attributes.each_pair(&Proc.new)
273
+ attributes.each_pair(&block)
274
274
  self
275
275
  else
276
276
  to_enum
data/lib/csl/treelike.rb CHANGED
@@ -17,9 +17,9 @@ module CSL
17
17
  @nodename ||= self.class.name.split(/::/)[-1].gsub(/([[:lower:]])([[:upper:]])/, '\1-\2').downcase
18
18
  end
19
19
 
20
- def each_child
20
+ def each_child(&block)
21
21
  if block_given?
22
- children.each(&Proc.new)
22
+ children.each(&block)
23
23
  self
24
24
  else
25
25
  enum_for :each_child
@@ -167,11 +167,11 @@ module CSL
167
167
  end
168
168
 
169
169
  # Traverses the node's sub-tree in depth-first order.
170
- def each_descendant
170
+ def each_descendant(&block)
171
171
  if block_given?
172
172
  each_child do |child|
173
173
  yield child
174
- child.each_descendant(&Proc.new)
174
+ child.each_descendant(&block)
175
175
  end
176
176
 
177
177
  self
@@ -230,7 +230,11 @@ module CSL
230
230
  %w{ ancestors descendants siblings root depth }.each do |name|
231
231
  ivar = "@#{name}"
232
232
  define_method("#{name}!") do
233
- instance_variable_get(ivar) || send(name)
233
+ if instance_variable_defined?(ivar)
234
+ instance_variable_get(ivar)
235
+ else
236
+ send(name)
237
+ end
234
238
  end
235
239
  end
236
240
 
@@ -376,9 +380,9 @@ module CSL
376
380
 
377
381
  # Iterates through all children. Nil values are skipped and Arrays
378
382
  # expanded.
379
- def each
383
+ def each(&block)
380
384
  if block_given?
381
- order.each(&Proc.new)
385
+ order.each(&block)
382
386
  self
383
387
  else
384
388
  to_enum
data/lib/csl/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module CSL
2
- VERSION = '1.4.5'.freeze
2
+ VERSION = '1.6.0'.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.5
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvester Keil
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-05 00:00:00.000000000 Z
11
+ date: 2021-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: namae
@@ -16,16 +16,32 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.7'
19
+ version: '1.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.7'
27
- description: "\n\t\tA Ruby parser and full API for the Citation Style Language (CSL),\n\t\tan
28
- open XML-based language to describe the formatting of citations\n\t\tand bibliographies.\n\t\t"
26
+ version: '1.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rexml
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: |
42
+ A Ruby parser and full API for the Citation Style Language (CSL),
43
+ an open XML-based language to describe the formatting of citations
44
+ and bibliographies.
29
45
  email:
30
46
  - http://sylvester.keil.or.at
31
47
  executables: []
@@ -33,29 +49,16 @@ extensions: []
33
49
  extra_rdoc_files: []
34
50
  files:
35
51
  - ".document"
52
+ - ".github/workflows/ci.yml"
36
53
  - ".gitignore"
37
- - ".rspec"
38
- - ".simplecov"
39
54
  - ".yardopts"
40
55
  - AGPL
41
56
  - BSDL
42
57
  - Gemfile
43
- - Guardfile
44
58
  - README.md
45
59
  - Rakefile
46
60
  - csl.gemspec
47
61
  - cucumber.yml
48
- - features/locales/loading.feature
49
- - features/locales/ordinalize.feature
50
- - features/parser/choose.feature
51
- - features/parser/info.feature
52
- - features/parser/localized_dates.feature
53
- - features/parser/terms.feature
54
- - features/step_definitions/locale_steps.rb
55
- - features/step_definitions/parser_steps.rb
56
- - features/step_definitions/style_steps.rb
57
- - features/style/loading.feature
58
- - features/support/env.rb
59
62
  - lib/csl.rb
60
63
  - lib/csl/compatibility.rb
61
64
  - lib/csl/date_part.rb
@@ -87,33 +90,6 @@ files:
87
90
  - lib/csl/style/text.rb
88
91
  - lib/csl/treelike.rb
89
92
  - lib/csl/version.rb
90
- - spec/csl/info_spec.rb
91
- - spec/csl/locale/date_spec.rb
92
- - spec/csl/locale/style_options_spec.rb
93
- - spec/csl/locale/term_spec.rb
94
- - spec/csl/locale_spec.rb
95
- - spec/csl/node_spec.rb
96
- - spec/csl/parser_spec.rb
97
- - spec/csl/schema_spec.rb
98
- - spec/csl/style/bibliography_spec.rb
99
- - spec/csl/style/choose_spec.rb
100
- - spec/csl/style/citation_spec.rb
101
- - spec/csl/style/date_spec.rb
102
- - spec/csl/style/group_spec.rb
103
- - spec/csl/style/label_spec.rb
104
- - spec/csl/style/layout_spec.rb
105
- - spec/csl/style/macro_spec.rb
106
- - spec/csl/style/names_spec.rb
107
- - spec/csl/style/number_spec.rb
108
- - spec/csl/style/sort_spec.rb
109
- - spec/csl/style/text_spec.rb
110
- - spec/csl/style_spec.rb
111
- - spec/csl/treelike_spec.rb
112
- - spec/fixtures/locales/locales-de-DE.xml
113
- - spec/fixtures/locales/locales-en-GB.xml
114
- - spec/fixtures/locales/locales-en-US.xml
115
- - spec/fixtures/styles/apa.csl
116
- - spec/spec_helper.rb
117
93
  - vendor/schema/csl-categories.rng
118
94
  - vendor/schema/csl-terms.rng
119
95
  - vendor/schema/csl-types.rng
@@ -122,8 +98,9 @@ files:
122
98
  homepage: https://github.com/inukshuk/csl-ruby
123
99
  licenses:
124
100
  - AGPL-3.0
101
+ - BSD-2-Clause
125
102
  metadata: {}
126
- post_install_message:
103
+ post_install_message:
127
104
  rdoc_options: []
128
105
  require_paths:
129
106
  - lib
@@ -131,54 +108,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
131
108
  requirements:
132
109
  - - ">="
133
110
  - !ruby/object:Gem::Version
134
- version: 1.9.3
111
+ version: '2.2'
135
112
  required_rubygems_version: !ruby/object:Gem::Requirement
136
113
  requirements:
137
114
  - - ">="
138
115
  - !ruby/object:Gem::Version
139
116
  version: '0'
140
117
  requirements: []
141
- rubyforge_project:
142
- rubygems_version: 2.6.3
143
- signing_key:
118
+ rubygems_version: 3.2.15
119
+ signing_key:
144
120
  specification_version: 4
145
121
  summary: A Ruby CSL parser and library
146
- test_files:
147
- - features/locales/loading.feature
148
- - features/locales/ordinalize.feature
149
- - features/parser/choose.feature
150
- - features/parser/info.feature
151
- - features/parser/localized_dates.feature
152
- - features/parser/terms.feature
153
- - features/step_definitions/locale_steps.rb
154
- - features/step_definitions/parser_steps.rb
155
- - features/step_definitions/style_steps.rb
156
- - features/style/loading.feature
157
- - features/support/env.rb
158
- - spec/csl/info_spec.rb
159
- - spec/csl/locale/date_spec.rb
160
- - spec/csl/locale/style_options_spec.rb
161
- - spec/csl/locale/term_spec.rb
162
- - spec/csl/locale_spec.rb
163
- - spec/csl/node_spec.rb
164
- - spec/csl/parser_spec.rb
165
- - spec/csl/schema_spec.rb
166
- - spec/csl/style/bibliography_spec.rb
167
- - spec/csl/style/choose_spec.rb
168
- - spec/csl/style/citation_spec.rb
169
- - spec/csl/style/date_spec.rb
170
- - spec/csl/style/group_spec.rb
171
- - spec/csl/style/label_spec.rb
172
- - spec/csl/style/layout_spec.rb
173
- - spec/csl/style/macro_spec.rb
174
- - spec/csl/style/names_spec.rb
175
- - spec/csl/style/number_spec.rb
176
- - spec/csl/style/sort_spec.rb
177
- - spec/csl/style/text_spec.rb
178
- - spec/csl/style_spec.rb
179
- - spec/csl/treelike_spec.rb
180
- - spec/fixtures/locales/locales-de-DE.xml
181
- - spec/fixtures/locales/locales-en-GB.xml
182
- - spec/fixtures/locales/locales-en-US.xml
183
- - spec/fixtures/styles/apa.csl
184
- - spec/spec_helper.rb
122
+ test_files: []