diff options
| author | Marat Radchenko <marat@slonopotamus.org> | 2022-12-27 11:23:27 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-27 11:23:27 +0300 |
| commit | 87178e3c97c81bf0326cde86d3ee3632e4491038 (patch) | |
| tree | 77ccd984a70856ed6962101c0c1e0d5758d47cb3 | |
| parent | 9f0b53cfe273bd715814fdfad821d930b0b84cbf (diff) | |
fix compatibility with Ruby < 2.7 (#435)
| -rw-r--r-- | lib/asciidoctor-epub3/ext/core.rb | 1 | ||||
| -rw-r--r-- | lib/asciidoctor-epub3/ext/core/file.rb | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/asciidoctor-epub3/ext/core.rb b/lib/asciidoctor-epub3/ext/core.rb index c1577f4..1b9ce27 100644 --- a/lib/asciidoctor-epub3/ext/core.rb +++ b/lib/asciidoctor-epub3/ext/core.rb @@ -1,3 +1,4 @@ # frozen_string_literal: true +require_relative 'core/file' require_relative 'core/string' diff --git a/lib/asciidoctor-epub3/ext/core/file.rb b/lib/asciidoctor-epub3/ext/core/file.rb new file mode 100644 index 0000000..246c222 --- /dev/null +++ b/lib/asciidoctor-epub3/ext/core/file.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +class File + # NOTE: remove once minimum required Ruby version is at least 2.7 + def self.absolute_path? path + Pathname.new(path).absolute? + end unless respond_to? :absolute_path? +end |
