ykxutils 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: 5c80eb9e85b3441203320049d784663253c665d2a1220d88e0b7fddb26e24190
4
- data.tar.gz: dbef95c791e50759a57e7815147e5cbb9784598737532de9597bc7a9e80732c4
3
+ metadata.gz: d22fc7981cccfd35ad44ec562ea9ec2775c45becb73165b85163b552733e6d05
4
+ data.tar.gz: 06e6f4b69633c3c02b6be1f62c7d59b353bea43a6a25524e76aea8cf9baf65f2
5
5
  SHA512:
6
- metadata.gz: 7b475bcd7df940e53ab43f5db69f2185c97f9dbb10c3b0db79a26c219e3ce8e1e41db7fc3f6d54f8d5c0621a8d0ef0279e5e6bb9c4313c49c086f225f75d6b40
7
- data.tar.gz: d1fc83418f134d299beae4801746cc86f8068a890403a728e3e006bafcb2ac9b1308d569681448ebaaf4252bd2dbc834f8a5201379649d6a9c590d73db9765f8
6
+ metadata.gz: a61623d958984bc3a73a0f7295234a9ede65dbc572e39f7bc5702dfd05eac823d0b8bc6f8dd4a0bb30e39d41bdfcd6ad14c25bd71ab1a941fb8f0a0b7a22dc2f
7
+ data.tar.gz: b334748905b7b82cfd78f32dcb445476710e81fbcee0577bd03c6b97a6906912f37351896190fa36b8ad4ac555c8b92ab58e800a35692d981bded1d1cfe1aa41
data/.gitignore CHANGED
@@ -11,3 +11,4 @@
11
11
  .rspec_status
12
12
  /vendor/
13
13
  *.code-workspace
14
+ /output/
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ykxutils (0.1.2)
4
+ ykxutils (0.1.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -22,14 +22,14 @@ GEM
22
22
  rspec-mocks (~> 3.11.0)
23
23
  rspec-core (3.11.0)
24
24
  rspec-support (~> 3.11.0)
25
- rspec-expectations (3.11.0)
25
+ rspec-expectations (3.11.1)
26
26
  diff-lcs (>= 1.2.0, < 2.0)
27
27
  rspec-support (~> 3.11.0)
28
28
  rspec-mocks (3.11.1)
29
29
  diff-lcs (>= 1.2.0, < 2.0)
30
30
  rspec-support (~> 3.11.0)
31
31
  rspec-support (3.11.0)
32
- rubocop (1.35.0)
32
+ rubocop (1.36.0)
33
33
  json (~> 2.3)
34
34
  parallel (~> 1.10)
35
35
  parser (>= 3.1.2.1)
@@ -43,8 +43,8 @@ GEM
43
43
  parser (>= 3.1.1.0)
44
44
  rubocop-rake (0.6.0)
45
45
  rubocop (~> 1.0)
46
- rubocop-rspec (2.12.1)
47
- rubocop (~> 1.31)
46
+ rubocop-rspec (2.13.0)
47
+ rubocop (~> 1.33)
48
48
  ruby-progressbar (1.11.0)
49
49
  unicode-display_width (2.2.0)
50
50
  webrick (1.7.0)
@@ -52,10 +52,10 @@ GEM
52
52
  webrick (~> 1.7.0)
53
53
 
54
54
  PLATFORMS
55
- x64-mingw32
56
55
  x86_64-linux
57
56
 
58
57
  DEPENDENCIES
58
+ bundler
59
59
  rake (~> 13.0)
60
60
  rspec (~> 3.0)
61
61
  rubocop (~> 1.7)
@@ -65,4 +65,4 @@ DEPENDENCIES
65
65
  ykxutils!
66
66
 
67
67
  BUNDLED WITH
68
- 2.3.9
68
+ 2.3.17
@@ -0,0 +1,25 @@
1
+ require "pstore"
2
+ require "fileutils"
3
+
4
+ module Ykxutils
5
+ class Pstorex
6
+ def initialize(store_dir, dump_file="pstore.dump")
7
+ FileUtils.mkdir_p(store_dir)
8
+ @store_db = PStore.new(Pathname.new(store_dir).join(dump_file))
9
+ end
10
+
11
+ def fetch(key, default_value)
12
+ value = default_value
13
+ @store_db.transaction do
14
+ value = @store_db.fetch(key, default_value)
15
+ end
16
+ value
17
+ end
18
+
19
+ def store(key, value)
20
+ @store_db.transaction do
21
+ @store_db[key] = value
22
+ end
23
+ end
24
+ end
25
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ykxutils
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
data/lib/ykxutils.rb CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require_relative "ykxutils/version"
4
4
  require_relative "ykxutils/yamlx"
5
+ require_relative "ykxutils/pstorex"
5
6
 
6
7
  module Ykxutils
7
8
  class Error < StandardError; end
data/ykxutils.gemspec CHANGED
@@ -29,6 +29,15 @@ Gem::Specification.new do |spec|
29
29
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
30
30
  spec.require_paths = ["lib"]
31
31
 
32
+ spec.add_development_dependency "bundler"
33
+ spec.add_development_dependency "rake", "~> 13.0"
34
+ spec.add_development_dependency "rspec", "~> 3.0"
35
+
36
+ spec.add_development_dependency "rubocop", "~> 1.7"
37
+ spec.add_development_dependency "rubocop-rake"
38
+ spec.add_development_dependency "rubocop-rspec"
39
+
40
+ spec.add_development_dependency "yard"
32
41
  # Uncomment to register a new dependency of your gem
33
42
  # spec.add_dependency "example-gem", "~> 1.0"
34
43
 
metadata CHANGED
@@ -1,15 +1,113 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ykxutils
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
  - ykominami
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-07 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2022-09-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '13.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '13.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.7'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.7'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop-rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop-rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: yard
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
13
111
  description: New version of utilty function created by yk.
14
112
  email:
15
113
  - ykominami@gmail.com
@@ -32,6 +130,7 @@ files:
32
130
  - bin/console
33
131
  - bin/setup
34
132
  - lib/ykxutils.rb
133
+ - lib/ykxutils/pstorex.rb
35
134
  - lib/ykxutils/version.rb
36
135
  - lib/ykxutils/yamlx.rb
37
136
  - test_data/test.yaml