bibtex-ruby 5.1.4 → 5.1.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
  SHA256:
3
- metadata.gz: 980c5b47dd86c02f33fa428d64a71b1743912452b464b71d4f9eda7a9960fbc7
4
- data.tar.gz: 60bddbfcaf99d248a5ee893495a63106ead7712fe861b13137ef7e34aaedc584
3
+ metadata.gz: 6856304b07fca1f55d4f88bbf72876e38438016762854b4ba6131a49c53d1f5c
4
+ data.tar.gz: 617f34575c3276fb79986b4d724726beb3b5aba5fc82d712f39c867084e7c56b
5
5
  SHA512:
6
- metadata.gz: 4fdcba9e792dbe07ba3787b356858e5b75f3a5c8fcc0fb716f33ba4868637efc3a574edffe7ca59445c0e5dc71e8d5a1ec718d5fec642ac66cbcb0e973e44781
7
- data.tar.gz: 63eb1cd74717a63df3772ade0d2526cfd1e14a9e87aa98f628cb247208a139c80c467dee7e981561228e50eaa8483937b94f52c74cd5162c39e86da2d547cc20
6
+ metadata.gz: d8803ce4b87cba0939eb1586fdb6d34edd42d71acc266716df0dd23101fa8fff0e8ccefdb889b3962010c3e24861527ace743ec0e871a386364f8cab70d0b137
7
+ data.tar.gz: c5bfc4fc88f97dcd5be53e7775d09b439f81cbf2e2c25b8aac6f7e327f0913e66a4374b9d3bd29adb5b037ee464308fd532df8beaf4d49d9e36e394e79f49ac9
data/Gemfile CHANGED
@@ -27,7 +27,7 @@ group :profile do
27
27
  end
28
28
 
29
29
  group :coverage do
30
- gem 'coveralls', '~>0.8', require: false
30
+ gem 'coveralls', require: false
31
31
  gem 'simplecov', require: false, platforms: [:ruby]
32
32
  end
33
33
 
@@ -35,6 +35,5 @@ group :development do
35
35
  gem 'iconv', platforms: [:ruby]
36
36
  gem 'racc'
37
37
  gem 'rake'
38
- gem 'rubocop', require: false
39
38
  gem 'yard'
40
39
  end
data/Rakefile CHANGED
@@ -11,7 +11,6 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), './lib'))
11
11
 
12
12
  require 'rake/clean'
13
13
  require 'rake/testtask'
14
- require 'rubocop/rake_task'
15
14
 
16
15
  require 'bibtex/version'
17
16
 
@@ -44,9 +43,7 @@ rescue LoadError
44
43
  # ignore
45
44
  end
46
45
 
47
- RuboCop::RakeTask.new
48
-
49
- task default: %i[test features rubocop]
46
+ task default: %i[test features]
50
47
 
51
48
  desc 'Generates the BibTeX parser'
52
49
  task racc: ['lib/bibtex/parser.rb', 'lib/bibtex/name_parser.rb']
@@ -117,43 +117,6 @@ module BibTeX
117
117
  self
118
118
  end
119
119
 
120
- # Generate accessors for required fields (#52)
121
- REQUIRED_FIELDS.values.flatten.uniq.each do |name|
122
- unless method_defined? name
123
- define_method(name) do
124
- get name
125
- end
126
- end
127
-
128
- writer = "#{name}="
129
-
130
- next if method_defined? writer
131
-
132
- define_method(writer) do |value|
133
- add name, value
134
- end
135
- end
136
-
137
- # Generate author, editor and translator accessors
138
- NAME_FIELDS.each do |contributor|
139
- unless method_defined? contributor
140
- define_method(contributor) do
141
- get contributor
142
- end
143
- end
144
-
145
- writer = "#{contributor}="
146
-
147
- unless method_defined? writer
148
- define_method(writer) do |value|
149
- add contributor, value
150
- end
151
- end
152
-
153
- alias_method "#{contributor}s", contributor
154
- alias_method "#{contributor}s=", writer
155
- end
156
-
157
120
  # call-seq:
158
121
  # entry.each { |key, value| block } -> entry
159
122
  # entry.each_pair { |key, value| block } -> entry
@@ -669,6 +632,44 @@ module BibTeX
669
632
  fields[:date].to_s[/\d{4}/]
670
633
  end
671
634
 
635
+ # Generate accessors for required fields (#52)
636
+ REQUIRED_FIELDS.values.flatten.uniq.each do |name|
637
+ unless method_defined? name
638
+ define_method(name) do
639
+ get name
640
+ end
641
+ end
642
+
643
+ writer = "#{name}="
644
+
645
+ next if method_defined? writer
646
+
647
+ define_method(writer) do |value|
648
+ add name, value
649
+ end
650
+ end
651
+
652
+ # Generate author, editor and translator accessors
653
+ NAME_FIELDS.each do |contributor|
654
+ unless method_defined? contributor
655
+ define_method(contributor) do
656
+ get contributor
657
+ end
658
+ end
659
+
660
+ writer = "#{contributor}="
661
+
662
+ unless method_defined? writer
663
+ define_method(writer) do |value|
664
+ add contributor, value
665
+ end
666
+ end
667
+
668
+ alias_method "#{contributor}s", contributor
669
+ alias_method "#{contributor}s=", writer
670
+ end
671
+
672
+
672
673
  private
673
674
 
674
675
  # Returns a default key for this entry.
@@ -49,9 +49,9 @@ module BibTeX
49
49
  alias to_a tokens
50
50
 
51
51
  def_delegators :to_s, :=~, :===,
52
- *String.instance_methods(false).reject do |m|
53
- m =~ /^\W|^(length|dup|replace|to_s|inspect)$|!$/
54
- end
52
+ *String.instance_methods(false).reject { |m|
53
+ m =~ /^\W|^(length|dup|replace|to_s|to_i|inspect)$|!$/
54
+ }
55
55
 
56
56
  def_delegators :@tokens, :[], :length
57
57
  def_delegator :@tokens, :each, :each_token
@@ -20,7 +20,7 @@ module BibTeX
20
20
  module Version
21
21
  MAJOR = 5
22
22
  MINOR = 1
23
- PATCH = 4
23
+ PATCH = 5
24
24
  BUILD = nil
25
25
 
26
26
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.').freeze
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: 5.1.4
4
+ version: 5.1.5
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: 2020-04-14 00:00:00.000000000 Z
11
+ date: 2020-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: latex-decode
@@ -128,7 +128,7 @@ homepage: http://inukshuk.github.com/bibtex-ruby
128
128
  licenses:
129
129
  - GPL-3.0
130
130
  metadata: {}
131
- post_install_message:
131
+ post_install_message:
132
132
  rdoc_options: []
133
133
  require_paths:
134
134
  - lib
@@ -143,22 +143,22 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0'
145
145
  requirements: []
146
- rubygems_version: 3.0.3
147
- signing_key:
146
+ rubygems_version: 3.1.2
147
+ signing_key:
148
148
  specification_version: 4
149
149
  summary: A BibTeX parser, converter and API for Ruby.
150
150
  test_files:
151
- - test/test_export.rb
152
- - test/bibtex/test_filters.rb
153
151
  - test/bibtex/entry/test_rdf_converter.rb
152
+ - test/bibtex/test_elements.rb
153
+ - test/bibtex/test_lexer.rb
154
154
  - test/bibtex/test_name_parser.rb
155
- - test/bibtex/test_utilities.rb
156
- - test/bibtex/test_bibliography.rb
155
+ - test/bibtex/test_names.rb
156
+ - test/bibtex/test_parser.rb
157
157
  - test/bibtex/test_string.rb
158
+ - test/bibtex/test_utilities.rb
158
159
  - test/bibtex/test_value.rb
160
+ - test/bibtex/test_filters.rb
161
+ - test/bibtex/test_bibliography.rb
159
162
  - test/bibtex/test_entry.rb
160
- - test/bibtex/test_lexer.rb
161
- - test/bibtex/test_names.rb
162
- - test/bibtex/test_elements.rb
163
- - test/bibtex/test_parser.rb
164
163
  - test/test_bibtex.rb
164
+ - test/test_export.rb