pstore 0.2.0 → 0.2.1

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: d4af5fcacc680025ce66c1ada2096341526492d999f65d9e406a4f48f105c60e
4
- data.tar.gz: fcb504575c025d4797935076248d4490fd2ceaa72a17176129481f40aaadd95b
3
+ metadata.gz: 581505ed1677d161bfeab6b72527336b3593726a2ef3e354155e944c0189bf8b
4
+ data.tar.gz: 29a99aead3e82f72c1bbcf821a39dbba0601f58d93cbc8649d6d522da938e8c0
5
5
  SHA512:
6
- metadata.gz: 16e1c1157c8edfdaabb2e5f90979a6e05bb1c77ebec3f4dc4b3bf503715e0e36bbc4efaa0ddcd56fcbe035a55dca4cadc72f493b6242da14912e1842f78de0a3
7
- data.tar.gz: 64b2f0fbe41c31a35a991ea1b1abfce61907ae880a9bab90ba58875c4abdbe922ecaf2dd8bbaa3d83001fbea272104484a3358571b58f3ab4ecb917d6417d9da
6
+ metadata.gz: 2713ed297961e320cc23a3ae9659f233bff05769878312f0516dbdd207dac8bcd6f979ca082717ba5ca65dd7b39c129149b7bcb269b39e243dac4294270353b2
7
+ data.tar.gz: f3833ca460fe0406a9bb1d21c8b19dfd515a0b5706aa91cfc4114b2f62696962cbad1773b8bfe62701a24321d77aa15d0e96aabbbf91586ca82284dd5d412a84
data/.document ADDED
@@ -0,0 +1,4 @@
1
+ BSDL
2
+ COPYING
3
+ README.md
4
+ lib/
@@ -23,24 +23,24 @@ jobs:
23
23
 
24
24
  steps:
25
25
  - name: Harden Runner
26
- uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
26
+ uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
27
27
  with:
28
28
  egress-policy: audit
29
29
 
30
- - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
30
+ - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
31
31
 
32
32
  - name: Set up Ruby
33
- uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 # v1.190.0
33
+ uses: ruby/setup-ruby@d5126b9b3579e429dd52e51e68624dda2e05be25 # v1.267.0
34
34
  with:
35
35
  bundler-cache: true
36
36
  ruby-version: ruby
37
37
 
38
38
  - name: Publish to RubyGems
39
- uses: rubygems/release-gem@a25424ba2ba8b387abc8ef40807c2c85b96cbe32 # v1.1.1
39
+ uses: rubygems/release-gem@1c162a739e8b4cb21a676e97b087e8268d8fc40b # v1.1.2
40
40
 
41
41
  - name: Create GitHub release
42
42
  run: |
43
43
  tag_name="$(git describe --tags --abbrev=0)"
44
44
  gh release create "${tag_name}" --verify-tag --generate-notes
45
45
  env:
46
- GITHUB_TOKEN: ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}
46
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -15,13 +15,17 @@ jobs:
15
15
  strategy:
16
16
  matrix:
17
17
  ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
18
- os: [ ubuntu-latest, macos-latest ]
18
+ os: [ ubuntu-latest, macos-latest, windows-latest ]
19
19
  exclude:
20
20
  - { os: macos-latest, ruby: '2.4' }
21
21
  - { os: macos-latest, ruby: '2.5' }
22
+ - { os: windows-latest, ruby: head }
23
+ include:
24
+ - { os: windows-latest, ruby: mingw }
25
+ - { os: windows-latest, ruby: mswin }
22
26
  runs-on: ${{ matrix.os }}
23
27
  steps:
24
- - uses: actions/checkout@v4
28
+ - uses: actions/checkout@v6
25
29
  - name: Set up Ruby
26
30
  uses: ruby/setup-ruby@v1
27
31
  with:
data/lib/pstore.rb CHANGED
@@ -326,11 +326,14 @@ require "digest"
326
326
  # end
327
327
  #
328
328
  class PStore
329
- VERSION = "0.2.0"
329
+ # :stopdoc:
330
+ VERSION = "0.2.1"
330
331
 
331
332
  RDWR_ACCESS = {mode: IO::RDWR | IO::CREAT | IO::BINARY, encoding: Encoding::ASCII_8BIT}.freeze
332
333
  RD_ACCESS = {mode: IO::RDONLY | IO::BINARY, encoding: Encoding::ASCII_8BIT}.freeze
333
334
  WR_ACCESS = {mode: IO::WRONLY | IO::CREAT | IO::TRUNC | IO::BINARY, encoding: Encoding::ASCII_8BIT}.freeze
335
+ private_constant :RDWR_ACCESS, :RD_ACCESS, :WR_ACCESS
336
+ # :startdoc:
334
337
 
335
338
  # The error type thrown by all PStore methods.
336
339
  class Error < StandardError
@@ -591,6 +594,8 @@ class PStore
591
594
  end
592
595
 
593
596
  private
597
+ # :stopdoc:
598
+
594
599
  # Constant for relieving Ruby's garbage collector.
595
600
  CHECKSUM_ALGO = %w[SHA512 SHA384 SHA256 SHA1 RMD160 MD5].each do |algo|
596
601
  begin
@@ -604,6 +609,7 @@ class PStore
604
609
 
605
610
  EMPTY_MARSHAL_DATA.freeze
606
611
  EMPTY_MARSHAL_CHECKSUM.freeze
612
+ private_constant :CHECKSUM_ALGO, :EMPTY_STRING, :EMPTY_MARSHAL_DATA, :EMPTY_MARSHAL_CHECKSUM
607
613
 
608
614
  #
609
615
  # Open the specified filename (either in read-only mode or in
@@ -667,23 +673,16 @@ class PStore
667
673
  end
668
674
  end
669
675
 
670
- def on_windows?
671
- is_windows = RUBY_PLATFORM =~ /mswin|mingw|bccwin|wince/
672
-
673
- on_windows_proc = Proc.new do
674
- is_windows
675
- end
676
- Ractor.make_shareable(on_windows_proc) if defined?(Ractor)
677
- self.class.__send__(:define_method, :on_windows?, &on_windows_proc)
678
- is_windows
679
- end
676
+ ON_WINDOWS = true & (/mswin|mingw|bccwin|wince/ =~ RUBY_PLATFORM) # :nodoc:
677
+ private_constant :ON_WINDOWS
680
678
 
681
679
  def save_data(original_checksum, original_file_size, file)
682
680
  new_data = dump(@table)
683
681
 
684
682
  if new_data.bytesize != original_file_size || CHECKSUM_ALGO.digest(new_data) != original_checksum
685
- if @ultra_safe && !on_windows?
686
- # Windows doesn't support atomic file renames.
683
+ if @ultra_safe && !ON_WINDOWS
684
+ # Once a file is locked, Windows does not guarantee that the
685
+ # lock will be released until the file is closed.
687
686
  save_data_with_atomic_file_rename_strategy(new_data, file)
688
687
  else
689
688
  save_data_with_fast_strategy(new_data, file)
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pstore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yukihiro Matsumoto
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-03-12 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies: []
13
12
  description: Transactional File Storage for Ruby Objects
14
13
  email:
@@ -17,6 +16,7 @@ executables: []
17
16
  extensions: []
18
17
  extra_rdoc_files: []
19
18
  files:
19
+ - ".document"
20
20
  - ".github/dependabot.yml"
21
21
  - ".github/workflows/push_gem.yml"
22
22
  - ".github/workflows/test.yml"
@@ -37,7 +37,6 @@ licenses:
37
37
  metadata:
38
38
  homepage_uri: https://github.com/ruby/pstore
39
39
  source_code_uri: https://github.com/ruby/pstore
40
- post_install_message:
41
40
  rdoc_options: []
42
41
  require_paths:
43
42
  - lib
@@ -52,8 +51,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
52
51
  - !ruby/object:Gem::Version
53
52
  version: '0'
54
53
  requirements: []
55
- rubygems_version: 3.5.11
56
- signing_key:
54
+ rubygems_version: 3.6.9
57
55
  specification_version: 4
58
56
  summary: Transactional File Storage for Ruby Objects
59
57
  test_files: []