anystyle 1.3.14 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1bf14266569ad0eb5e812e68d0289780e50ee2cc765faeb1a5fb48b37b1ba4b7
4
- data.tar.gz: be96508a8b939c6450342a763cfb469b87d170dab80380b4a82beb7d02b4e0c4
3
+ metadata.gz: b7d5642b2c453c00a91748d6e447504c825b0097095cda159d92f2c6d82a11c5
4
+ data.tar.gz: c29fa4ee58a017404b205418bcf1d45f7111d3005e881f5d869d73572d0cd5e6
5
5
  SHA512:
6
- metadata.gz: a8a2c6f4f0d997b657b9817b8bf2a4bdf62db4e9f53130ed9923de571e9cb6a264e554dd78c4ebaf7180b424734632d526fd46d3accba07e0cd766fb37689fae
7
- data.tar.gz: d2ddd8f136ac10a0ddd29b9522fc7779c1ea92c1d441601c801726fa4e304d104de588b38c230fa53102e59e23e2ce0b48b79f4c4bd932c2cb0e3a3f56ccd43a
6
+ metadata.gz: 44f8226f33b22aa53b743ce56db3203a1c1bb3e4dd749ca746a0c46563656f36a4da585eebb32f0b8062701f6719e5c0aed9ee5f9fa533a1f49aacdef2d79504
7
+ data.tar.gz: dcaf21ed636bc50a7fa982e220942b0d752f13714e1a8cda038d1d7b324b7da9c78569903460c10454c5740d191e1abc19254c24222cd2a411880c78fe3933ea
data/HISTORY.md CHANGED
@@ -1,3 +1,9 @@
1
+ 1.4.0 / 2023-01-06
2
+ ==================
3
+ * Removed deprectate string taint checking (@bbonamin).
4
+ * `AnyStyle::Parser#parse` will no longer automatically open local files.
5
+ Please call `Wapiti::Dataset.open` explicitly if you relied on this.
6
+
1
7
  1.3.6 / 2019-12-02
2
8
  ==================
3
9
  * Updated parser model.
data/LICENSE CHANGED
@@ -1,5 +1,5 @@
1
1
  AnyStyle
2
- Copyright 2011-2020 Sylvester Keil. All rights reserved.
2
+ Copyright 2011-2023 Sylvester Keil. All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without
5
5
  modification, are permitted provided that the following conditions are met:
data/README.md CHANGED
@@ -213,7 +213,7 @@ to join us! Over the years our main contributors have been:
213
213
 
214
214
  License
215
215
  -------
216
- Copyright 2011-2020 Sylvester Keil. All rights reserved.
216
+ Copyright 2011-2023 Sylvester Keil. All rights reserved.
217
217
 
218
218
  AnyStyle is distributed under a BSD-style license.
219
219
  See LICENSE for details.
@@ -10,7 +10,7 @@ module AnyStyle
10
10
  end
11
11
 
12
12
  def open
13
- if File.exists?(options[:path])
13
+ if File.exist?(options[:path])
14
14
  @db = ::Marshal.load(File.open(options[:path]))
15
15
  else
16
16
  @db = {}
@@ -18,8 +18,6 @@ module AnyStyle
18
18
  end
19
19
 
20
20
  def open(path, format: File.extname(path), tagged: false, **opts)
21
- raise ArgumentError,
22
- "cannot open tainted path: '#{path}'" if path.tainted?
23
21
  raise ArgumentError,
24
22
  "document not found: '#{path}'" unless File.exist?(path)
25
23
 
@@ -8,7 +8,7 @@ module AnyStyle
8
8
  compact: true,
9
9
  threads: 4,
10
10
  format: :references,
11
- training_data: Dir[File.join(RES, 'finder', '*.ttx')].map(&:untaint),
11
+ training_data: Dir[File.join(RES, 'finder', '*.ttx')],
12
12
  layout: true,
13
13
  pdftotext: 'pdftotext',
14
14
  pdfinfo: 'pdfinfo'
@@ -86,12 +86,6 @@ module AnyStyle
86
86
  expand input
87
87
  when Wapiti::Sequence
88
88
  expand Wapiti::Dataset.new([input])
89
- when String
90
- if !input.tainted? && input.length < 1024 && File.exists?(input)
91
- expand Wapiti::Dataset.open(input, **opts)
92
- else
93
- expand Wapiti::Dataset.parse(input, **opts)
94
- end
95
89
  else
96
90
  expand Wapiti::Dataset.parse(input, **opts)
97
91
  end
@@ -1,4 +1,4 @@
1
1
  module AnyStyle
2
- SUPPORT = File.expand_path('../support', __FILE__).untaint
3
- RES = File.expand_path('../../../res', __FILE__).untaint
2
+ SUPPORT = File.expand_path('../support', __FILE__)
3
+ RES = File.expand_path('../../../res', __FILE__)
4
4
  end
@@ -63,21 +63,18 @@ module AnyStyle
63
63
  module_function
64
64
 
65
65
  def pdf_to_text(path, pdftotext: 'pdftotext', **opts)
66
- raise "pdftotext is tainted" if pdftotext.tainted?
67
66
  text = %x{#{pdftotext} #{pdf_opts(path, **opts).join(' ')} "#{path}" -}
68
67
  raise "pdftotext failed with error code #{$?.exitstatus}" unless $?.success?
69
68
  text.force_encoding(opts[:encoding] || 'UTF-8')
70
69
  end
71
70
 
72
71
  def pdf_info(path, pdfinfo: 'pdfinfo', **opts)
73
- raise "pdfinfo is tainted" if pdfinfo.tainted?
74
72
  Hash[%x{#{pdfinfo} "#{path}"}.split("\n").map { |ln|
75
73
  ln.split(/:\s+/, 2)
76
74
  }]
77
75
  end
78
76
 
79
77
  def pdf_info(path, pdfinfo: 'pdfinfo', **opts)
80
- raise "pdfinfo is tainted" if pdfinfo.tainted?
81
78
  %x{#{pdfinfo} -meta "#{path}"}
82
79
  end
83
80
 
@@ -1,3 +1,3 @@
1
1
  module AnyStyle
2
- VERSION = '1.3.14'.freeze
2
+ VERSION = '1.4.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anystyle
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.14
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylvester Keil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-27 00:00:00.000000000 Z
11
+ date: 2023-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bibtex-ruby
@@ -30,28 +30,28 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.2'
33
+ version: '1.3'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.2'
40
+ version: '1.3'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: wapiti
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '2.0'
47
+ version: '2.1'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '2.0'
54
+ version: '2.1'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: namae
57
57
  requirement: !ruby/object:Gem::Requirement