epub-cfi 0.1.2 → 0.1.3

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: c7bd4bcf31dae58b934393de702fb036186b950bbeb72d065931d0406506c2be
4
- data.tar.gz: 5820d5272ed8c29790c69e959c1e4b140eae9e567182b2c5929dbbcff41efc0e
3
+ metadata.gz: 3a79486ec6d7e2a618cfba25b35658411424f08ed77384025174935d8cbc8127
4
+ data.tar.gz: e5cbd477b9b7ebdc0850d428b2494e795fddb0208a209e6969f5ff2adea4ec95
5
5
  SHA512:
6
- metadata.gz: 83d606fc2a8321349c6b055df31610bbc384b7c42e620ee01ec6b1461b2c6a51534327c70442894a70f8faf6c0cee0a0506e84b55c5765a25a97d2ae6548ac7e
7
- data.tar.gz: 8b950b018d6bde45b2c1107ab2c19048c4e05e06cc49c4cd59c4c77a5b4b706228bc2268b65eebbb91314a51104b5fa48ddf5371c202c187bda1faf023fbccab
6
+ metadata.gz: c9434ba31524411d771d7abe463294f5154da32707ce640539e3dcb6f9e0c9d1507ee23e638cb746d22b97fd59ad885b190fed0c16943610c0ab1f99215bf30f
7
+ data.tar.gz: d6b2a08aa5c7ca1d622e884645dd8a90eaf1bd4392f3a1d761f4976a0e5fa0a497e974bf940fecad7b3b20fe7976ad8e49d68fb3ad5be8bb276b0796b99aa96d
data/.gitlab-ci.yml CHANGED
@@ -1,24 +1,24 @@
1
1
  before_script:
2
2
  - ruby -v
3
3
  - which ruby
4
- - gem install --no-document racc rake rubygems-tasks yard test-unit test-unit-notify pretty_backtrace simplecov
4
+ - gem install --no-document racc rake rubygems-tasks yard test-unit test-unit-notify simplecov steep
5
5
 
6
- test:2.3:
7
- image: ruby:2.3
6
+ test:3.0:
7
+ image: ruby:3.0
8
8
  script:
9
9
  rake test
10
10
 
11
- test:2.4:
12
- image: ruby:2.4
11
+ test:3.1:
12
+ image: ruby:3.1
13
13
  script:
14
14
  rake test
15
15
 
16
- test:2.5:
17
- image: ruby:2.5
16
+ test:3.2:
17
+ image: ruby:3.2
18
18
  script:
19
- rake test
19
+ rake test typecheck
20
20
 
21
- test:2.6:
22
- image: ruby:2.6
21
+ test:3.3:
22
+ image: ruby:3.3
23
23
  script:
24
- rake test
24
+ rake test typecheck
data/ChangeLog.adoc CHANGED
@@ -1,3 +1,10 @@
1
+ === 0.1.3 / 2023-12-28
2
+
3
+ * Suppress warning on unused variable
4
+ * Include RBS file
5
+ * [BUG FIX]Include strscan
6
+ * Add Racc to runtime dependencies
7
+
1
8
  === 0.1.2 / 2019-05-19
2
9
 
3
10
  * Scan CFI string on demand to reduce memory footprint
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  require 'rake'
3
3
 
4
- task :default => "lib/epub/cfi/parser.tab.rb"
4
+ task :default => [:test, :typecheck]
5
5
 
6
6
  desc "Build EPUB CFI parser"
7
7
  file "lib/epub/cfi/parser.tab.rb" => "lib/epub/cfi/parser.y" do |task|
@@ -18,10 +18,15 @@ task :build => "lib/epub/cfi/parser.tab.rb"
18
18
  require 'rake/testtask'
19
19
  Rake::TestTask.new do |test|
20
20
  test.libs << 'test'
21
- test.pattern = 'test/**/test_*.rb'
22
21
  test.verbose = true
23
22
  end
24
23
  task :test => "lib/epub/cfi/parser.tab.rb"
25
24
 
26
25
  require 'yard'
27
26
  YARD::Rake::YardocTask.new
27
+
28
+ require "steep"
29
+ desc "Check type"
30
+ task typecheck: "lib/epub/cfi/parser.tab.rb" do
31
+ Steep::Drivers::Check.new(stdout: $stdout, stderr: $stderr).run
32
+ end
data/Steepfile ADDED
@@ -0,0 +1,30 @@
1
+ # D = Steep::Diagnostic
2
+ #
3
+ target :lib do
4
+ signature "sig"
5
+
6
+ check "lib" # Directory name
7
+ # check "Gemfile" # File name
8
+ # check "app/models/**/*.rb" # Glob
9
+ ignore "lib/shims"
10
+
11
+ # library "pathname" # Standard libraries
12
+ # library "strong_json" # Gems
13
+ library "strscan"
14
+
15
+ # configure_code_diagnostics(D::Ruby.default) # `default` diagnostics setting (applies by default)
16
+ # configure_code_diagnostics(D::Ruby.strict) # `strict` diagnostics setting
17
+ # configure_code_diagnostics(D::Ruby.lenient) # `lenient` diagnostics setting
18
+ # configure_code_diagnostics(D::Ruby.silent) # `silent` diagnostics setting
19
+ # configure_code_diagnostics do |hash| # You can setup everything yourself
20
+ # hash[D::Ruby::NoMethod] = :information
21
+ # end
22
+ end
23
+
24
+ target :test do
25
+ signature "sig", "sig-private"
26
+
27
+ check "test"
28
+
29
+ # library "pathname" # Standard libraries
30
+ end
data/epub-cfi.gemspec CHANGED
@@ -29,12 +29,13 @@ Gem::Specification.new do |gem|
29
29
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
30
30
  gem.require_paths = ['lib']
31
31
 
32
- gem.add_development_dependency "racc"
32
+ gem.add_runtime_dependency "racc"
33
+
33
34
  gem.add_development_dependency 'rake'
34
35
  gem.add_development_dependency 'rubygems-tasks'
35
36
  gem.add_development_dependency 'yard'
36
37
  gem.add_development_dependency "test-unit"
37
38
  gem.add_development_dependency "test-unit-notify"
38
- gem.add_development_dependency "pretty_backtrace"
39
39
  gem.add_development_dependency "simplecov"
40
+ gem.add_development_dependency "steep"
40
41
  end
@@ -1,10 +1,13 @@
1
+ require "strscan"
1
2
  require "epub/cfi/parser.tab"
2
3
 
3
4
  class EPUB::CFI::Parser
4
5
  include Comparable
5
6
 
6
7
  UNICODE_CHARACTER_EXCLUDING_SPECIAL_CHARS_AND_SPACE_AND_DOT_AND_COLON_AND_TILDE_AND_ATMARK_AND_SOLIDUS_AND_EXCLAMATION_MARK_PATTERN = /\u0009|\u000A|\u000D|[\u0022-\u0027]|[\u002A-\u002B]|\u002D|[\u0030-\u0039]|\u003C|[\u003E-\u0040]|[\u0041-\u005A]|\u005C|[\u005F-\u007D]|[\u007F-\uD7FF]|[\uE000-\uFFFD]|[\u10000-\u10FFFF]/ # excluding special chars and space(\u0020) and dot(\u002E) and colon(\u003A) and tilde(\u007E) and atmark(\u0040) and solidus(\u002F) and exclamation mark(\u0021)
7
- UNICODE_CHARACTER_PATTERN = Regexp.union(UNICODE_CHARACTER_EXCLUDING_SPECIAL_CHARS_AND_SPACE_AND_DOT_AND_COLON_AND_TILDE_AND_ATMARK_AND_SOLIDUS_AND_EXCLAMATION_MARK_PATTERN, Regexp.new(Regexp.escape(EPUB::CFI::SPECIAL_CHARS), / \.:~@!/))
8
+ FRAGMENT_PREFIX = "epubcfi("
9
+ FRAGMENT_PREFIX_LENGTH = FRAGMENT_PREFIX.length
10
+ FRAGMENT_SUFFIX_LENGTH = ")".length
8
11
 
9
12
  class << self
10
13
  def parse(string, debug: $DEBUG)
@@ -18,8 +21,9 @@ class EPUB::CFI::Parser
18
21
  end
19
22
 
20
23
  def parse(string)
21
- if string.start_with? 'epubcfi('
22
- string = string['epubcfi('.length .. -2]
24
+ if string.start_with? FRAGMENT_PREFIX
25
+ string = string[FRAGMENT_PREFIX_LENGTH .. -(FRAGMENT_SUFFIX_LENGTH + 1)]
26
+ # @type var string: String
23
27
  end
24
28
  @scanner = StringScanner.new(string, true)
25
29
  do_parse
@@ -107,7 +111,10 @@ end
107
111
  # @raise [Racc::ParseError] if given string is invalid
108
112
  # @see CFI.parse
109
113
  def EPUB::CFI(string)
110
- string.kind_of?(EPUB::CFI::Location) || string.kind_of?(EPUB::CFI::Range) ?
111
- string :
114
+ case string
115
+ when EPUB::CFI::Location, EPUB::CFI::Range
116
+ string
117
+ else
112
118
  EPUB::CFI.parse(string)
119
+ end
113
120
  end
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # DO NOT MODIFY!!!!
3
- # This file is automatically generated by Racc 1.4.14
4
- # from Racc grammer file "".
3
+ # This file is automatically generated by Racc 1.7.3
4
+ # from Racc grammar file "parser.y".
5
5
  #
6
6
 
7
7
  require 'racc/parser.rb'
@@ -12,53 +12,53 @@ module EPUB
12
12
 
13
13
  racc_action_table = [
14
14
  44, 61, 60, 57, 58, 59, 32, 31, 56, 47,
15
- 110, 49, 4, 22, 24, 25, 54, 62, 61, 60,
16
- 57, 58, 59, 32, 31, 56, 39, 40, 49, 32,
17
- 31, 72, 75, 54, 62, 61, 60, 57, 58, 59,
18
- 32, 31, 56, 32, 31, 49, 100, 31, 14, 13,
19
- 54, 62, 61, 60, 57, 58, 59, 32, 31, 56,
20
- 107, 31, 49, 20, 4, 22, 24, 25, 62, 61,
21
- 60, 57, 58, 59, 32, 31, 56, -63, -63, 49,
22
- 14, 13, 32, 31, 54, 62, 61, 60, 57, 58,
23
- 59, 32, 31, 56, -63, -63, 49, 39, 40, 39,
24
- 40, 54, 62, 61, 60, 57, 58, 59, 32, 31,
25
- 56, 32, 31, 49, 5, 8, 4, 15, 54, 62,
26
- 61, 60, 57, 58, 59, 32, 31, 56, 90, 4,
27
- 49, 28, 33, 28, 4, 28, 62, 91, 92, 87,
28
- 28, 75, 95, 96, 25, 72, 73, 4, 47, 47,
29
- 80, 28, 47, 47, 47, 105, 47 ]
15
+ 4, 49, 4, 22, 24, 25, 54, 62, 61, 60,
16
+ 57, 58, 59, 32, 31, 56, 14, 13, 49, 32,
17
+ 31, 72, 5, 54, 62, 61, 60, 57, 58, 59,
18
+ 32, 31, 56, 32, 31, 49, 20, 4, 22, 24,
19
+ 25, 62, 61, 60, 57, 58, 59, 32, 31, 56,
20
+ 14, 13, 49, 39, 40, 39, 40, 54, 62, 61,
21
+ 60, 57, 58, 59, 32, 31, 56, 32, 31, 49,
22
+ 32, 31, 100, 31, 54, 62, 61, 60, 57, 58,
23
+ 59, 32, 31, 56, 39, 40, 49, 107, 31, -63,
24
+ -63, 8, 62, 61, 60, 57, 58, 59, 32, 31,
25
+ 56, -63, -63, 49, 4, 15, 4, 28, 54, 62,
26
+ 61, 60, 57, 58, 59, 32, 31, 56, 90, 33,
27
+ 49, 28, 4, 28, 25, 54, 62, 91, 92, 87,
28
+ 28, 75, 95, 96, 72, 73, 75, 47, 47, 80,
29
+ 28, 47, 47, 47, 105, 47, 110 ]
30
30
 
31
31
  racc_action_check = [
32
32
  27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
33
- 108, 27, 20, 20, 20, 20, 27, 27, 44, 44,
34
- 44, 44, 44, 44, 44, 44, 25, 25, 44, 69,
35
- 69, 69, 42, 44, 44, 110, 110, 110, 110, 110,
36
- 110, 110, 110, 39, 39, 110, 72, 72, 22, 22,
37
- 110, 110, 47, 47, 47, 47, 47, 47, 47, 47,
38
- 99, 99, 47, 10, 10, 10, 10, 10, 47, 48,
39
- 48, 48, 48, 48, 48, 48, 48, 100, 100, 48,
40
- 4, 4, 14, 14, 48, 48, 80, 80, 80, 80,
41
- 80, 80, 80, 80, 107, 107, 80, 24, 24, 73,
42
- 73, 80, 80, 105, 105, 105, 105, 105, 105, 105,
43
- 105, 29, 29, 105, 1, 2, 3, 5, 105, 105,
44
- 82, 82, 82, 82, 82, 82, 82, 82, 49, 8,
45
- 82, 12, 16, 23, 33, 36, 82, 49, 49, 49,
46
- 49, 49, 49, 49, 38, 40, 41, 0, 43, 45,
47
- 46, 67, 76, 78, 79, 81, 103 ]
33
+ 0, 27, 20, 20, 20, 20, 27, 27, 44, 44,
34
+ 44, 44, 44, 44, 44, 44, 4, 4, 44, 69,
35
+ 69, 69, 1, 44, 44, 47, 47, 47, 47, 47,
36
+ 47, 47, 47, 14, 14, 47, 10, 10, 10, 10,
37
+ 10, 47, 48, 48, 48, 48, 48, 48, 48, 48,
38
+ 22, 22, 48, 24, 24, 25, 25, 48, 48, 80,
39
+ 80, 80, 80, 80, 80, 80, 80, 29, 29, 80,
40
+ 39, 39, 72, 72, 80, 80, 82, 82, 82, 82,
41
+ 82, 82, 82, 82, 73, 73, 82, 99, 99, 100,
42
+ 100, 2, 82, 105, 105, 105, 105, 105, 105, 105,
43
+ 105, 107, 107, 105, 3, 5, 8, 12, 105, 105,
44
+ 110, 110, 110, 110, 110, 110, 110, 110, 49, 16,
45
+ 110, 23, 33, 36, 38, 110, 110, 49, 49, 49,
46
+ 49, 49, 49, 49, 40, 41, 42, 43, 45, 46,
47
+ 67, 76, 78, 79, 81, 103, 108 ]
48
48
 
49
49
  racc_action_pointer = [
50
- 143, 114, 113, 112, 72, 117, nil, nil, 125, nil,
51
- 60, nil, 117, nil, 74, nil, 130, nil, nil, nil,
52
- 8, nil, 40, 119, 89, 18, nil, -2, nil, 103,
53
- nil, nil, nil, 130, nil, nil, 121, nil, 137, 35,
54
- 135, 141, 17, 137, 15, 138, 148, 49, 66, 126,
50
+ 6, 32, 99, 110, 18, 115, nil, nil, 112, nil,
51
+ 43, nil, 103, nil, 35, nil, 127, nil, nil, nil,
52
+ 8, nil, 52, 117, 55, 57, nil, -2, nil, 69,
53
+ nil, nil, nil, 128, nil, nil, 119, nil, 127, 72,
54
+ 134, 140, 131, 136, 15, 137, 147, 32, 49, 126,
55
55
  nil, nil, nil, nil, nil, nil, nil, nil, nil, nil,
56
- nil, nil, nil, nil, nil, nil, nil, 137, nil, 21,
57
- nil, nil, 38, 91, nil, nil, 141, nil, 142, 143,
58
- 83, 143, 117, nil, nil, nil, nil, nil, nil, nil,
59
- nil, nil, nil, nil, nil, nil, nil, nil, nil, 52,
60
- 69, nil, nil, 145, nil, 100, nil, 86, 8, nil,
61
- 32, nil ]
56
+ nil, nil, nil, nil, nil, nil, nil, 136, nil, 21,
57
+ nil, nil, 74, 86, nil, nil, 140, nil, 141, 142,
58
+ 66, 142, 83, nil, nil, nil, nil, nil, nil, nil,
59
+ nil, nil, nil, nil, nil, nil, nil, nil, nil, 89,
60
+ 91, nil, nil, 144, nil, 100, nil, 103, 154, nil,
61
+ 117, nil ]
62
62
 
63
63
  racc_action_default = [
64
64
  -81, -81, -3, -10, -81, -81, -1, -2, -10, -4,
@@ -75,32 +75,32 @@ racc_action_default = [
75
75
  -81, -44 ]
76
76
 
77
77
  racc_goto_table = [
78
- 30, 46, 29, 85, 45, 83, 26, 84, 38, 41,
79
- 76, 9, 79, 3, 70, 64, 16, 37, 78, 2,
80
- 6, 21, 74, 19, 42, 30, 12, 69, 93, 94,
81
- 66, 34, 43, 3, 67, 68, 18, 81, 85, 35,
82
- 106, 65, 84, 98, 36, 103, 108, 82, 17, 88,
83
- 89, 86, 7, 102, 104, 64, 102, 101, 30, 1,
78
+ 30, 46, 29, 76, 45, 79, 26, 85, 38, 41,
79
+ 83, 84, 70, 2, 9, 64, 3, 37, 78, 16,
80
+ 1, 12, 21, 6, 74, 30, 19, 69, 7, 17,
81
+ 66, 94, 34, 35, 18, 68, 3, 67, 103, 36,
82
+ 93, 98, 85, 42, 65, 106, 84, 43, 81, 108,
83
+ 82, 88, 89, 102, 104, 64, 102, 101, 30, 86,
84
84
  99, 97, nil, nil, nil, nil, nil, nil, nil, nil,
85
85
  nil, nil, nil, nil, nil, nil, nil, nil, nil, 109,
86
86
  102, nil, nil, nil, 111, 64 ]
87
87
 
88
88
  racc_goto_check = [
89
- 22, 25, 19, 31, 26, 36, 12, 37, 14, 14,
90
- 24, 6, 24, 5, 20, 22, 6, 12, 25, 2,
91
- 3, 10, 18, 5, 17, 22, 11, 19, 16, 18,
92
- 12, 10, 23, 5, 15, 13, 9, 27, 31, 2,
93
- 36, 6, 37, 20, 11, 24, 28, 30, 8, 32,
94
- 33, 34, 4, 26, 25, 22, 26, 14, 22, 1,
89
+ 22, 25, 19, 24, 26, 24, 12, 31, 14, 14,
90
+ 36, 37, 20, 2, 6, 22, 5, 12, 25, 6,
91
+ 1, 11, 10, 3, 18, 22, 5, 19, 4, 8,
92
+ 12, 18, 10, 2, 9, 13, 5, 15, 24, 11,
93
+ 16, 20, 31, 17, 6, 36, 37, 23, 27, 28,
94
+ 30, 32, 33, 26, 25, 22, 26, 14, 22, 34,
95
95
  19, 12, nil, nil, nil, nil, nil, nil, nil, nil,
96
96
  nil, nil, nil, nil, nil, nil, nil, nil, nil, 25,
97
97
  26, nil, nil, nil, 25, 22 ]
98
98
 
99
99
  racc_goto_pointer = [
100
- nil, 59, 19, 18, 50, 13, 8, nil, 38, 26,
101
- 11, 22, -6, -3, -16, -4, -21, -3, -20, -12,
102
- -26, nil, -14, 5, -33, -26, -23, -10, -59, nil,
103
- 0, -44, 0, 1, 3, nil, -42, -40, nil ]
100
+ nil, 20, 13, 21, 26, 16, 11, nil, 19, 24,
101
+ 12, 17, -6, -3, -16, -1, -9, 16, -18, -12,
102
+ -28, nil, -14, 20, -40, -26, -23, 1, -56, nil,
103
+ 3, -40, 2, 3, 11, nil, -37, -36, nil ]
104
104
 
105
105
  racc_goto_default = [
106
106
  nil, nil, nil, nil, nil, 11, nil, 10, nil, nil,
@@ -236,6 +236,7 @@ Racc_arg = [
236
236
  racc_shift_n,
237
237
  racc_reduce_n,
238
238
  racc_use_result_var ]
239
+ Ractor.make_shareable(Racc_arg) if defined?(Ractor)
239
240
 
240
241
  Racc_token_to_s_table = [
241
242
  "$end",
@@ -297,6 +298,7 @@ Racc_token_to_s_table = [
297
298
  "character_escaped_special_excluding_space",
298
299
  "character_excluding_special_chars_and_space",
299
300
  "character_excluding_special_chars_and_space_and_dot_and_colon_and_tilde_and_atmark_and_solidus_and_exclamation_mark" ]
301
+ Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)
300
302
 
301
303
  Racc_debug_parser = false
302
304
 
@@ -311,7 +313,7 @@ module_eval(<<'.,.,', 'parser.y', 5)
311
313
  else
312
314
  result = CFI::Location.new(val[0])
313
315
  end
314
-
316
+
315
317
  result
316
318
  end
317
319
  .,.,
@@ -322,10 +324,10 @@ module_eval(<<'.,.,', 'parser.y', 5)
322
324
 
323
325
  module_eval(<<'.,.,', 'parser.y', 17)
324
326
  def _reduce_4(val, _values, result)
325
- path, redirected_path = *val[1]
327
+ path, _redirected_path = *val[1]
326
328
  path.steps.unshift val[0]
327
329
  result = val[1]
328
-
330
+
329
331
  result
330
332
  end
331
333
  .,.,
@@ -390,7 +392,7 @@ module_eval(<<'.,.,', 'parser.y', 44)
390
392
  def _reduce_13(val, _values, result)
391
393
  assertion = val[2] ? CFI::IDAssertion.new(val[2][0], val[2][2]) : nil
392
394
  result = CFI::Step.new(val[1].to_i, assertion)
393
-
395
+
394
396
  result
395
397
  end
396
398
  .,.,
@@ -403,7 +405,7 @@ module_eval(<<'.,.,', 'parser.y', 53)
403
405
  def _reduce_16(val, _values, result)
404
406
  assertion = val[2] ? CFI::TextLocationAssertion.new(*val[2]) : nil
405
407
  result = CFI::CharacterOffset.new(val[1].to_i, assertion)
406
-
408
+
407
409
  result
408
410
  end
409
411
  .,.,
@@ -420,7 +422,7 @@ module_eval(<<'.,.,', 'parser.y', 60)
420
422
  x = val[2] ? val[2][0].to_f : nil
421
423
  y = val[2] ? val[2][1].to_f : nil
422
424
  result = CFI::TemporalSpatialOffset.new(val[1].to_f, x, y, val[3])
423
-
425
+
424
426
  result
425
427
  end
426
428
  .,.,
@@ -694,5 +696,5 @@ def _reduce_none(val, _values, result)
694
696
  end
695
697
 
696
698
  end # class Parser
697
- end # module CFI
698
- end # module EPUB
699
+ end # module CFI
700
+ end # module EPUB
@@ -15,7 +15,7 @@ rule
15
15
 
16
16
  path : step local_path
17
17
  {
18
- path, redirected_path = *val[1]
18
+ path, _redirected_path = *val[1]
19
19
  path.steps.unshift val[0]
20
20
  result = val[1]
21
21
  }
@@ -18,6 +18,6 @@
18
18
  module EPUB
19
19
  module CFI
20
20
  # epub-cfi version
21
- VERSION = "0.1.2"
21
+ VERSION = "0.1.3"
22
22
  end
23
23
  end
data/lib/epub/cfi.rb CHANGED
@@ -221,7 +221,7 @@ module EPUB
221
221
  end
222
222
 
223
223
  def to_s
224
- return @string_cache if @string_cache
224
+ return @string_cache if @string_cache # @type ivar @string_cache: String
225
225
  string_cache = '['
226
226
  string_cache << CFI.escape(id) if id
227
227
  parameters.each_pair do |key, values|
@@ -242,7 +242,7 @@ module EPUB
242
242
  end
243
243
 
244
244
  def to_s
245
- return @string_cache if @string_cache
245
+ return @string_cache if @string_cache # @type ivar @string_cache: String
246
246
  string_cache = '['
247
247
  string_cache << CFI.escape(preceded) if preceded
248
248
  string_cache << ',' << CFI.escape(followed) if followed
@@ -279,13 +279,13 @@ module EPUB
279
279
  def initialize(temporal=nil, x=nil, y=nil, assertion=nil)
280
280
  raise RangeError, "dimension must be in 0..100 but passed #{x}" unless (0.0..100.0).cover?(x) if x
281
281
  raise RangeError, "dimension must be in 0..100 but passed #{y}" unless (0.0..100.0).cover?(y) if y
282
- warn "Assertion is passed to #{__class__} but cannot know how to handle with it: #{assertion}" if assertion
282
+ warn "Assertion is passed to #{self.class} but cannot know how to handle with it: #{assertion}" if assertion
283
283
  @temporal, @x, @y, @assertion = temporal, x, y, assertion
284
284
  @string_cache = nil
285
285
  end
286
286
 
287
287
  def to_s
288
- return @string_cache if @string_cache
288
+ return @string_cache if @string_cache # @type ivar @string_cache: String
289
289
  string_cache = ''
290
290
  string_cache << "~#{temporal}" if temporal
291
291
  string_cache << "@#{x}:#{y}" if x or y
data/sig/epub-cfi.rbs ADDED
@@ -0,0 +1,132 @@
1
+ # TypeProf 0.21.8
2
+
3
+ # Classes
4
+ module EPUB
5
+ def self.CFI: (String | CFI::Location | CFI::Range) -> (CFI::Location | CFI::Range)
6
+
7
+ module CFI
8
+ VERSION: String
9
+ SPECIAL_CHARS: "^[](),;="
10
+ RE_ESCAPED_SPECIAL_CHARS: String
11
+
12
+ def self.escape: (String string) -> String
13
+ def self.unescape: (String string) -> String
14
+ def self.parse: (String) -> (Location | Range)
15
+
16
+ class Location
17
+ include Comparable
18
+
19
+ attr_reader paths: NonEmptyArray[Path]
20
+ def self.from_parent_and_subpath: (NonEmptyArray[Path] parent_path, (NonEmptyArray[Path]?) subpath) -> Location
21
+ def self.resolve_path: (NonEmptyArray[Path] parent_path, (NonEmptyArray[Path]?) subpath) -> NonEmptyArray[Path]
22
+ def initialize: (?NonEmptyArray[Path] paths) -> void
23
+ def initialize_copy: (self original) -> void
24
+ def <=>: (self other) -> Integer?
25
+ def path_string: -> String
26
+ def to_s: -> String
27
+ def inspect: -> String
28
+ def join: (*Path other_paths) -> Location
29
+ end
30
+
31
+ class Path
32
+ @string_cache: String
33
+
34
+ attr_reader steps: Array[Path | Step]
35
+ attr_reader offset: (CharacterOffset | TemporalSpatialOffset)?
36
+ def initialize: (?Array[Path | Step] steps, ?nil offset) -> void
37
+ def initialize_copy: (self original) -> void
38
+ def to_s: -> String
39
+ def <=>: (self other) -> Integer?
40
+ end
41
+
42
+ class Range < ::Range[Location]
43
+ @string_cache: String
44
+
45
+ attr_accessor parent_path: Location
46
+ attr_accessor start_subpath: String
47
+ attr_accessor end_subpath: String
48
+ def self.from_parent_and_start_and_end: (NonEmptyArray[Path] parent_path, NonEmptyArray[Path] start_subpath, NonEmptyArray[Path] end_subpath) -> Range
49
+ def to_s: -> String
50
+ end
51
+
52
+ class Step
53
+ @string_cache: String?
54
+
55
+ attr_reader value: Integer
56
+ attr_reader assertion: (IDAssertion | String)?
57
+ alias step value
58
+ def initialize: (Integer value, ?(IDAssertion | String)? assertion) -> void
59
+ def initialize_copy: (self original) -> void
60
+ def to_s: -> String
61
+ def <=>: (self other) -> Integer?
62
+ def element?: -> bool
63
+ def character_data?: -> bool
64
+ end
65
+
66
+ class IDAssertion
67
+ @string_cache: String?
68
+
69
+ attr_reader id: String
70
+ attr_reader parameters: Hash[String, [String]]
71
+ def initialize: (String id, ?Hash[String, [String]] parameters) -> void
72
+ def to_s: -> String
73
+ end
74
+
75
+ class TextLocationAssertion
76
+ @string_cache: String?
77
+
78
+ attr_reader preceded: String?
79
+ attr_reader followed: String?
80
+ attr_reader parameters: Hash[String, [String]]
81
+ def initialize: (?String? preceded, ?String? followed, ?Hash[String, [String]] parameters) -> void
82
+ def to_s: -> String
83
+ end
84
+
85
+ class CharacterOffset
86
+ @string_cache: String?
87
+
88
+ attr_reader value: Integer
89
+ attr_reader assertion: TextLocationAssertion?
90
+ alias offset value
91
+ def initialize: (Integer value, ?TextLocationAssertion? assertion) -> void
92
+ def to_s: -> String
93
+ def <=>: (self other) -> Integer?
94
+ end
95
+
96
+ class TemporalSpatialOffset
97
+ @string_cache: String?
98
+
99
+ attr_reader temporal: (Float | Integer)?
100
+ attr_reader x: (Float | Integer)?
101
+ attr_reader y: (Float | Integer)?
102
+ attr_reader assertion: nil
103
+ def initialize: (?(Float | Integer)? temporal, ?(Float | Integer)? x, ?(Float | Integer)? y, ?nil assertion) -> void
104
+ def to_s: -> String
105
+ def <=>: (self other) -> Integer?
106
+ end
107
+
108
+ class Parser < Racc::Parser
109
+ Racc_arg: [[Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer], [Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer], [Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer], [Integer, Integer, Integer, Integer, Integer, Integer, nil, nil, Integer, nil, Integer, nil, Integer, nil, Integer, nil, Integer, nil, nil, nil, Integer, nil, Integer, Integer, Integer, Integer, nil, Integer, nil, Integer, nil, nil, nil, Integer, nil, nil, Integer, nil, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, Integer, nil, Integer, nil, nil, Integer, Integer, nil, nil, Integer, nil, Integer, Integer, Integer, Integer, Integer, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, Integer, Integer, nil, nil, Integer, nil, Integer, nil, Integer, Integer, nil, Integer, nil], [Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, Integer, Integer, nil, nil, nil, Integer, Integer], [Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, Integer, Integer, nil, nil, nil, Integer, Integer], [nil, nil, nil, nil, nil, Integer, nil, Integer, nil, nil, nil, nil, nil, Integer, nil, nil, Integer, nil, nil, nil, nil, Integer, Integer, nil, nil, nil, Integer, nil, nil, Integer, nil, Integer, nil, nil, Integer, Integer, nil, Integer, Integer], [nil, Integer, Integer, Integer, Integer, Integer, Integer, nil, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, Integer, nil, Integer, Integer, Integer, Integer, Integer, Integer, Integer, nil, Integer, Integer, Integer, Integer, Integer, nil, Integer, Integer, nil], Integer, [Integer, Integer, :racc_error, Integer, Integer, :_reduce_1, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_4, Integer, Integer, :_reduce_5, Integer, Integer, :_reduce_6, Integer, Integer, :_reduce_7, Integer, Integer, :_reduce_8, Integer, Integer, :_reduce_9, Integer, Integer, :_reduce_10, Integer, Integer, :_reduce_11, Integer, Integer, :_reduce_12, Integer, Integer, :_reduce_13, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_16, Integer, Integer, :_reduce_17, Integer, Integer, :_reduce_18, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_21, Integer, Integer, :_reduce_22, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_24, Integer, Integer, :_reduce_25, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_28, Integer, Integer, :_reduce_29, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_31, Integer, Integer, :_reduce_32, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_35, Integer, Integer, :_reduce_36, Integer, Integer, :_reduce_37, Integer, Integer, :_reduce_38, Integer, Integer, :_reduce_39, Integer, Integer, :_reduce_40, Integer, Integer, :_reduce_41, Integer, Integer, :_reduce_42, Integer, Integer, :_reduce_43, Integer, Integer, :_reduce_44, Integer, Integer, :_reduce_45, Integer, Integer, :_reduce_46, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_48, Integer, Integer, :_reduce_49, Integer, Integer, :_reduce_50, Integer, Integer, :_reduce_51, Integer, Integer, :_reduce_52, Integer, Integer, :_reduce_53, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_56, Integer, Integer, :_reduce_57, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_none, Integer, Integer, :_reduce_none], Hash[:ATMARK | :CIRCUMFLEX | :CLOSING_PARENTHESIS | :CLOSING_SQUARE_BRACKET | :COLON | :COMMA | :DIGIT_NON_ZERO | :DOT | :EQUAL | :EXCLAMATION_MARK | :OPENING_PARENTHESIS | :OPENING_SQUARE_BRACKET | :SEMICOLON | :SOLIDUS | :SPACE | :TILDE | :UNICODE_CHARACTER_EXCLUDING_SPECIAL_CHARS_AND_SPACE_AND_DOT_AND_COLON_AND_TILDE_AND_ATMARK_AND_SOLIDUS_AND_EXCLAMATION_MARK | :ZERO | :error | false, Integer], Integer, Integer, true]
110
+ Racc_token_to_s_table: [String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String]
111
+ Racc_debug_parser: false
112
+ UNICODE_CHARACTER_EXCLUDING_SPECIAL_CHARS_AND_SPACE_AND_DOT_AND_COLON_AND_TILDE_AND_ATMARK_AND_SOLIDUS_AND_EXCLAMATION_MARK_PATTERN: Regexp
113
+ FRAGMENT_PREFIX: "epubcfi("
114
+ FRAGMENT_PREFIX_LENGTH: 8
115
+ FRAGMENT_SUFFIX_LENGTH: 1
116
+ include Comparable
117
+
118
+ def _reduce_none: (untyped val, untyped _values, untyped result) -> untyped
119
+ def self.parse: (String string, ?debug: boolish) -> (Location | Range)
120
+ def initialize: (?debug: boolish) -> void
121
+ def parse: (String string) -> (Location | Range)
122
+ def next_token: -> ([:ATMARK | :CIRCUMFLEX | :CLOSING_PARENTHESIS | :CLOSING_SQUARE_BRACKET | :COLON | :COMMA | :DIGIT_NON_ZERO | :DOT | :EQUAL | :EXCLAMATION_MARK | :OPENING_PARENTHESIS | :OPENING_SQUARE_BRACKET | :SEMICOLON | :SOLIDUS | :SPACE | :TILDE | :UNICODE_CHARACTER_EXCLUDING_SPECIAL_CHARS_AND_SPACE_AND_DOT_AND_COLON_AND_TILDE_AND_ATMARK_AND_SOLIDUS_AND_EXCLAMATION_MARK | :ZERO, String] | [bool, bool])
123
+ end
124
+ end
125
+ end
126
+
127
+ # Just for type checking
128
+ class NonEmptyArray[T] < Array[T]
129
+ def last: -> T
130
+ def shift: -> T
131
+ def collect: { (T) -> untyped } -> NonEmptyArray[untyped]
132
+ end
@@ -0,0 +1,8 @@
1
+ module Racc
2
+ class Parser
3
+ private def do_parse: () -> untyped
4
+ end
5
+
6
+ class ParseError < StandardError
7
+ end
8
+ end
@@ -0,0 +1,7 @@
1
+ module SimpleCov
2
+ def self.start: { [self: Configuration] -> void } -> void
3
+
4
+ module Configuration
5
+ def add_filter: (string) -> void
6
+ end
7
+ end
@@ -0,0 +1,31 @@
1
+ module Test
2
+ module Unit
3
+ class TestCase
4
+ include Assertions
5
+ extend Data::ClassMethods
6
+
7
+ def self.data: (untyped) -> untyped
8
+ end
9
+
10
+ module Assertions
11
+ def assert_equal: (untyped, untyped) -> void
12
+ def assert_not_same: (untyped, untyped) -> void
13
+ def assert_nil: (untyped) -> void
14
+ def assert_true: (untyped) -> void
15
+ def assert_block: (string?) { -> void } -> void
16
+ def assert_raise: (singleton(Exception)?) { -> void } -> void
17
+ def assert_nothing_raised: { -> void } -> void
18
+ def build_message: (string, string?, *string) -> String
19
+
20
+ class AssertionMessage
21
+ def self.delayed_diff: (string? from, string? to) -> String
22
+ end
23
+ end
24
+
25
+ module Data
26
+ module ClassMethods
27
+ def data: (untyped) -> untyped
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,39 @@
1
+ class TestCFI < Test::Unit::TestCase
2
+ private
3
+
4
+ def epubcfi: (String string) -> (EPUB::CFI::Location | EPUB::CFI::Range)
5
+ def assert_equal_node: (untyped expected, untyped actual, ?String message) -> void
6
+
7
+ class TestLocation < TestCFI
8
+ end
9
+
10
+ class TestPath < TestCFI
11
+ end
12
+
13
+ class TestRange < TestCFI
14
+ end
15
+
16
+ class TestStep < TestCFI
17
+ end
18
+
19
+ class TestIDAssertion < TestCFI
20
+ end
21
+
22
+ class TestTextLocationAssertion < TestCFI
23
+ end
24
+
25
+ class TestCharacterOffset < TestCFI
26
+ end
27
+
28
+ class TestSpatialOffset < TestCFI
29
+ end
30
+
31
+ class TestTemporalOffset < TestCFI
32
+ end
33
+
34
+ class TestTemporalSpatialOffset < TestCFI
35
+ end
36
+ end
37
+
38
+ class TestParserCFI < Test::Unit::TestCase
39
+ end
data/test/helper.rb CHANGED
@@ -5,9 +5,3 @@ end
5
5
 
6
6
  require 'test/unit'
7
7
  require "test/unit/notify"
8
-
9
- require "pretty_backtrace"
10
- PrettyBacktrace.enable
11
-
12
- class Test::Unit::TestCase
13
- end
data/test/test_cfi.rb CHANGED
@@ -21,13 +21,14 @@ class TestCFI < Test::Unit::TestCase
21
21
 
22
22
  def test_join
23
23
  location = EPUB::CFI::Parser.parse('epubcfi(/6/14[chap05ref])')
24
+ # @type var location: EPUB::CFI::Location
24
25
  other_path = EPUB::CFI::Path.new([EPUB::CFI::Path.new([
25
26
  EPUB::CFI::Step.new(4, EPUB::CFI::IDAssertion.new('body01')),
26
27
  EPUB::CFI::Step.new(10),
27
28
  EPUB::CFI::Step.new(2),
28
29
  EPUB::CFI::Step.new(1)
29
30
  ])])
30
- joined = location.join([other_path])
31
+ joined = location.join(other_path)
31
32
 
32
33
  assert_equal 'epubcfi(/6/14[chap05ref]!/4[body01]/10/2/1)', joined.to_s
33
34
  end
@@ -81,6 +82,7 @@ class TestCFI < Test::Unit::TestCase
81
82
  first = epubcfi('/6/4[chap01ref]!/4[body01]/10[para05]/2/1:1')
82
83
  last = epubcfi('/6/4[chap01ref]!/4[body01]/10[para05]/3:4')
83
84
  range = epubcfi('/6/4[chap01ref]!/4[body01]/10[para05],/2/1:1,/3:4')
85
+ # @type var range: EPUB::CFI::Range
84
86
  assert_equal 0, first <=> range.first
85
87
  assert_equal 0, last <=> range.last
86
88
 
@@ -93,7 +95,9 @@ class TestCFI < Test::Unit::TestCase
93
95
  end
94
96
 
95
97
  def test_cover
96
- assert_true epubcfi('/6/4[chap01ref]!/4[body01]/10[para05],/2/1:1,/3:4').cover? epubcfi('/6/4[chap01ref]!/4[body01]/10[para05]/2/2/4')
98
+ range = epubcfi('/6/4[chap01ref]!/4[body01]/10[para05],/2/1:1,/3:4')
99
+ # @type var range: EPUB::CFI::Range
100
+ assert_true range.cover? epubcfi('/6/4[chap01ref]!/4[body01]/10[para05]/2/2/4')
97
101
  end
98
102
  end
99
103
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epub-cfi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - KITAITI Makoto
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-19 00:00:00.000000000 Z
11
+ date: 2023-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: racc
@@ -17,7 +17,7 @@ dependencies:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
- type: :development
20
+ type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
@@ -95,7 +95,7 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: pretty_backtrace
98
+ name: simplecov
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - ">="
@@ -109,7 +109,7 @@ dependencies:
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: simplecov
112
+ name: steep
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ">="
@@ -136,13 +136,18 @@ files:
136
136
  - ChangeLog.adoc
137
137
  - README.adoc
138
138
  - Rakefile
139
- - appveyor.yml
139
+ - Steepfile
140
140
  - epub-cfi.gemspec
141
141
  - lib/epub/cfi.rb
142
142
  - lib/epub/cfi/parser.rb
143
143
  - lib/epub/cfi/parser.tab.rb
144
144
  - lib/epub/cfi/parser.y
145
145
  - lib/epub/cfi/version.rb
146
+ - sig-private/shims/simplecov.rbs
147
+ - sig-private/shims/test-unit.rbs
148
+ - sig-private/test.rbs
149
+ - sig/epub-cfi.rbs
150
+ - sig/shims/racc.rbs
146
151
  - test/helper.rb
147
152
  - test/test_cfi.rb
148
153
  - test/test_parser.rb
@@ -150,7 +155,7 @@ homepage: https://gitlab.com/KitaitiMakoto/epub-cfi
150
155
  licenses:
151
156
  - LGPL
152
157
  metadata: {}
153
- post_install_message:
158
+ post_install_message:
154
159
  rdoc_options: []
155
160
  require_paths:
156
161
  - lib
@@ -165,8 +170,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
165
170
  - !ruby/object:Gem::Version
166
171
  version: '0'
167
172
  requirements: []
168
- rubygems_version: 3.0.3
169
- signing_key:
173
+ rubygems_version: 3.5.3
174
+ signing_key:
170
175
  specification_version: 4
171
176
  summary: EPUB CFI parser and builder
172
177
  test_files:
data/appveyor.yml DELETED
@@ -1,21 +0,0 @@
1
- version: 1.0.{build}-{branch}
2
-
3
- environment:
4
- matrix:
5
- - RUBY_VERSION: 23
6
- - RUBY_VERSION: 24
7
- - RUBY_VERSION: 25
8
- - RUBY_VERSION: 26
9
-
10
- install:
11
- - set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
12
- - gem install --no-document racc rake rubygems-tasks yard test-unit test-unit-notify pretty_backtrace simplecov
13
-
14
- build: off
15
-
16
- before_test:
17
- - ruby -v
18
- - gem -v
19
-
20
- test_script:
21
- - rake test