pstore 0.1.3 → 0.2.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: 72f658b529641295888e56602677fe0f38bda8824529a2a8d35100e6d58e99e8
4
- data.tar.gz: 1531cc04ead49cbc5dbf481f2f4a695bc1de94398f057ff0c65ff022322284bc
3
+ metadata.gz: d4af5fcacc680025ce66c1ada2096341526492d999f65d9e406a4f48f105c60e
4
+ data.tar.gz: fcb504575c025d4797935076248d4490fd2ceaa72a17176129481f40aaadd95b
5
5
  SHA512:
6
- metadata.gz: 79f06b0cb5666d9ba0a2497d99b42761c5c728b87137693581faa6c08f9b3f4f53dc34764db01b4190a08e33259e0b933a98aa17f5dd8f0717670fdb55a9b0df
7
- data.tar.gz: 7cd25219d39946f558480e53373b47da30d8083cea9e67a3dfd44f7612050f23fd05577d932cb0f4a1af46b42119ff2a4bf3bb36300a5163f31d837f7126dbda
6
+ metadata.gz: 16e1c1157c8edfdaabb2e5f90979a6e05bb1c77ebec3f4dc4b3bf503715e0e36bbc4efaa0ddcd56fcbe035a55dca4cadc72f493b6242da14912e1842f78de0a3
7
+ data.tar.gz: 64b2f0fbe41c31a35a991ea1b1abfce61907ae880a9bab90ba58875c4abdbe922ecaf2dd8bbaa3d83001fbea272104484a3358571b58f3ab4ecb917d6417d9da
@@ -0,0 +1,46 @@
1
+ name: Publish gem to rubygems.org
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ push:
13
+ if: github.repository == 'ruby/pstore'
14
+ runs-on: ubuntu-latest
15
+
16
+ environment:
17
+ name: rubygems.org
18
+ url: https://rubygems.org/gems/pstore
19
+
20
+ permissions:
21
+ contents: write
22
+ id-token: write
23
+
24
+ steps:
25
+ - name: Harden Runner
26
+ uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
27
+ with:
28
+ egress-policy: audit
29
+
30
+ - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
31
+
32
+ - name: Set up Ruby
33
+ uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 # v1.190.0
34
+ with:
35
+ bundler-cache: true
36
+ ruby-version: ruby
37
+
38
+ - name: Publish to RubyGems
39
+ uses: rubygems/release-gem@a25424ba2ba8b387abc8ef40807c2c85b96cbe32 # v1.1.1
40
+
41
+ - name: Create GitHub release
42
+ run: |
43
+ tag_name="$(git describe --tags --abbrev=0)"
44
+ gh release create "${tag_name}" --verify-tag --generate-notes
45
+ env:
46
+ GITHUB_TOKEN: ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}
@@ -16,6 +16,9 @@ jobs:
16
16
  matrix:
17
17
  ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
18
18
  os: [ ubuntu-latest, macos-latest ]
19
+ exclude:
20
+ - { os: macos-latest, ruby: '2.4' }
21
+ - { os: macos-latest, ruby: '2.5' }
19
22
  runs-on: ${{ matrix.os }}
20
23
  steps:
21
24
  - uses: actions/checkout@v4
@@ -4,10 +4,10 @@ Redistribution and use in source and binary forms, with or without
4
4
  modification, are permitted provided that the following conditions
5
5
  are met:
6
6
  1. Redistributions of source code must retain the above copyright
7
- notice, this list of conditions and the following disclaimer.
7
+ notice, this list of conditions and the following disclaimer.
8
8
  2. Redistributions in binary form must reproduce the above copyright
9
- notice, this list of conditions and the following disclaimer in the
10
- documentation and/or other materials provided with the distribution.
9
+ notice, this list of conditions and the following disclaimer in the
10
+ documentation and/or other materials provided with the distribution.
11
11
 
12
12
  THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13
13
  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
data/COPYING ADDED
@@ -0,0 +1,56 @@
1
+ Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
2
+ You can redistribute it and/or modify it under either the terms of the
3
+ 2-clause BSDL (see the file BSDL), or the conditions below:
4
+
5
+ 1. You may make and give away verbatim copies of the source form of the
6
+ software without restriction, provided that you duplicate all of the
7
+ original copyright notices and associated disclaimers.
8
+
9
+ 2. You may modify your copy of the software in any way, provided that
10
+ you do at least ONE of the following:
11
+
12
+ a. place your modifications in the Public Domain or otherwise
13
+ make them Freely Available, such as by posting said
14
+ modifications to Usenet or an equivalent medium, or by allowing
15
+ the author to include your modifications in the software.
16
+
17
+ b. use the modified software only within your corporation or
18
+ organization.
19
+
20
+ c. give non-standard binaries non-standard names, with
21
+ instructions on where to get the original software distribution.
22
+
23
+ d. make other distribution arrangements with the author.
24
+
25
+ 3. You may distribute the software in object code or binary form,
26
+ provided that you do at least ONE of the following:
27
+
28
+ a. distribute the binaries and library files of the software,
29
+ together with instructions (in the manual page or equivalent)
30
+ on where to get the original distribution.
31
+
32
+ b. accompany the distribution with the machine-readable source of
33
+ the software.
34
+
35
+ c. give non-standard binaries non-standard names, with
36
+ instructions on where to get the original software distribution.
37
+
38
+ d. make other distribution arrangements with the author.
39
+
40
+ 4. You may modify and include the part of the software into any other
41
+ software (possibly commercial). But some files in the distribution
42
+ are not written by the author, so that they are not under these terms.
43
+
44
+ For the list of those files and their copying conditions, see the
45
+ file LEGAL.
46
+
47
+ 5. The scripts and library files supplied as input to or produced as
48
+ output from the software do not automatically fall under the
49
+ copyright of the software, but belong to whomever generated them,
50
+ and may be sold commercially, and may be aggregated with this
51
+ software.
52
+
53
+ 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
54
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
55
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
56
+ PURPOSE.
data/lib/pstore.rb CHANGED
@@ -326,7 +326,7 @@ require "digest"
326
326
  # end
327
327
  #
328
328
  class PStore
329
- VERSION = "0.1.3"
329
+ VERSION = "0.2.0"
330
330
 
331
331
  RDWR_ACCESS = {mode: IO::RDWR | IO::CREAT | IO::BINARY, encoding: Encoding::ASCII_8BIT}.freeze
332
332
  RD_ACCESS = {mode: IO::RDONLY | IO::BINARY, encoding: Encoding::ASCII_8BIT}.freeze
@@ -437,7 +437,7 @@ class PStore
437
437
  in_transaction
438
438
  unless @table.key? key
439
439
  if default == PStore::Error
440
- raise PStore::Error, format("undefined key `%s'", key)
440
+ raise PStore::Error, format("undefined key '%s'", key)
441
441
  else
442
442
  return default
443
443
  end
@@ -602,6 +602,9 @@ class PStore
602
602
  EMPTY_MARSHAL_DATA = Marshal.dump({})
603
603
  EMPTY_MARSHAL_CHECKSUM = CHECKSUM_ALGO.digest(EMPTY_MARSHAL_DATA)
604
604
 
605
+ EMPTY_MARSHAL_DATA.freeze
606
+ EMPTY_MARSHAL_CHECKSUM.freeze
607
+
605
608
  #
606
609
  # Open the specified filename (either in read-only mode or in
607
610
  # read-write mode) and lock it for reading or writing.
@@ -666,9 +669,12 @@ class PStore
666
669
 
667
670
  def on_windows?
668
671
  is_windows = RUBY_PLATFORM =~ /mswin|mingw|bccwin|wince/
669
- self.class.__send__(:define_method, :on_windows?) do
672
+
673
+ on_windows_proc = Proc.new do
670
674
  is_windows
671
675
  end
676
+ Ractor.make_shareable(on_windows_proc) if defined?(Ractor)
677
+ self.class.__send__(:define_method, :on_windows?, &on_windows_proc)
672
678
  is_windows
673
679
  end
674
680
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pstore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yukihiro Matsumoto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-07 00:00:00.000000000 Z
11
+ date: 2025-03-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Transactional File Storage for Ruby Objects
14
14
  email:
@@ -18,10 +18,12 @@ extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
20
  - ".github/dependabot.yml"
21
+ - ".github/workflows/push_gem.yml"
21
22
  - ".github/workflows/test.yml"
22
23
  - ".gitignore"
24
+ - BSDL
25
+ - COPYING
23
26
  - Gemfile
24
- - LICENSE.txt
25
27
  - README.md
26
28
  - Rakefile
27
29
  - bin/console
@@ -50,7 +52,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
50
52
  - !ruby/object:Gem::Version
51
53
  version: '0'
52
54
  requirements: []
53
- rubygems_version: 3.5.0.dev
55
+ rubygems_version: 3.5.11
54
56
  signing_key:
55
57
  specification_version: 4
56
58
  summary: Transactional File Storage for Ruby Objects