summaryrefslogtreecommitdiff
path: root/lib/pstore.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-07-29 00:31:52 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-07-30 19:03:18 +0900
commitb2d96abb42abbe2e01f010ffc9ac51f0f9a50002 (patch)
tree57791da8a71280c335109916376e13f5e0c63af3 /lib/pstore.rb
parentcfbae7dae052180e5dde05a27948ae8d779eccab (diff)
Extract version number from the source
"requiring version.rb" strategy has some issues. - cannot work when cross-compiling - often introduces wrong namespace - must know the superclasses - costs at each runtime than at build-time etc.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3375
Diffstat (limited to 'lib/pstore.rb')
-rw-r--r--lib/pstore.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/pstore.rb b/lib/pstore.rb
index 1180fd50a0..f4e6e12c26 100644
--- a/lib/pstore.rb
+++ b/lib/pstore.rb
@@ -92,6 +92,8 @@ require "digest"
# Needless to say, if you're storing valuable data with PStore, then you should
# backup the PStore files from time to time.
class PStore
+ VERSION = "0.1.0"
+
RDWR_ACCESS = {mode: IO::RDWR | IO::CREAT | IO::BINARY, encoding: Encoding::ASCII_8BIT}.freeze
RD_ACCESS = {mode: IO::RDONLY | IO::BINARY, encoding: Encoding::ASCII_8BIT}.freeze
WR_ACCESS = {mode: IO::WRONLY | IO::CREAT | IO::TRUNC | IO::BINARY, encoding: Encoding::ASCII_8BIT}.freeze