roma-storage 0.1.0 → 0.1.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: 9c2510a2520e68f70dae57e6d038295a89b10e246bcd5f1b10539691ff9258bf
4
- data.tar.gz: 65f8e45637f5bbf488b77d0969ea3e2d7fb68da23973bd7148df0208e41c69aa
3
+ metadata.gz: be339014d3d6302df9c114eafa0af8133d36630c91b0874235a1eac6765852ed
4
+ data.tar.gz: b48b3c583ec0753f520a68ba9a6f4c59b820407165780da794384ad8fce742c3
5
5
  SHA512:
6
- metadata.gz: 11c99d2cd9a446abece1a9fa8cfa42a87eb8cd51203c4ff1de20d1e58072e64e28a10d5c668af546e213f4c64e623ecdfe4383edabde9155c9abd7cbab93fc67
7
- data.tar.gz: 848ede96b5092d9b20c0e8587eaf721cc87b408af343c4dd07b6ac89e10beeb012d7952ad39b663a37c22a4a82aa077e11db482357d5b191f45082b6acb00f3c
6
+ metadata.gz: 1578b1b4984728252fde8eef667effce9628974d435e87099a79e677afd510c6ed503c81f64ed231191c872a193500d2f1c32acacef71735b57ed222ebd74180
7
+ data.tar.gz: f38620ebcad74bef70808c81864749018b63704c4cd5ecfaba3a1b5b32dcfdbebf38ad31213de6e21430a3b170b578584b6508a4330b983324d4c0f56b5a59e6
data/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Roma::Storage
2
2
 
3
+ [![Build Status](https://travis-ci.org/roma/roma-storage.svg?branch=master)](https://travis-ci.org/roma/roma-storage)
4
+ [![Maintainability](https://api.codeclimate.com/v1/badges/c13d593018a15a64b6f8/maintainability)](https://codeclimate.com/github/roma/roma-storage/maintainability)
5
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/c13d593018a15a64b6f8/test_coverage)](https://codeclimate.com/github/roma/roma-storage/test_coverage)
6
+
3
7
  Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/roma/storage`. To experiment with that code, run `bin/console` for an interactive prompt.
4
8
 
5
9
  TODO: Delete this and the text above, and describe your gem
@@ -32,7 +36,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
36
 
33
37
  ## Contributing
34
38
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/satoryu/roma-storage. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
39
+ Bug reports and pull requests are welcome on GitHub at https://github.com/roma/roma-storage. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
40
 
37
41
  ## License
38
42
 
@@ -40,4 +44,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
40
44
 
41
45
  ## Code of Conduct
42
46
 
43
- Everyone interacting in the Roma::Storage project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/satoryu/roma-storage/blob/master/CODE_OF_CONDUCT.md).
47
+ Everyone interacting in the Roma::Storage project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/roma/roma-storage/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile CHANGED
@@ -1,6 +1,10 @@
1
1
  require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
2
+ require 'rake/testtask'
3
3
 
4
- RSpec::Core::RakeTask.new(:spec)
4
+ Rake::TestTask.new do |t|
5
+ t.libs << 'test'
6
+ t.test_files = FileList['test/**/test_*.rb']
7
+ t.verbose = true
8
+ end
5
9
 
6
- task :default => :spec
10
+ task :default => :test
@@ -156,8 +156,8 @@ module Roma
156
156
 
157
157
  if @dbs[n] == :cachecleaning && d
158
158
  # in case of existing value is both @hdb and @hdbc
159
- vn, lat, clk, expt = unpack_header(d)
160
- cvn, clat, cclk, cexpt = unpack_header(c)
159
+ vn, _lat, clk, _expt = unpack_header(d)
160
+ _cvn, _clat, cclk, _cexpt = unpack_header(c)
161
161
  return d if cmp_clk(clk, cclk) > 0 # if @hdb newer than @hdbc
162
162
  end
163
163
  c
@@ -226,7 +226,7 @@ module Roma
226
226
  buf = db_get(vn, k)
227
227
  clk = 0
228
228
  if buf
229
- vn, t, clk, expt2, v2 = unpack_data(buf)
229
+ vn, _t, clk, expt2, _v2 = unpack_data(buf)
230
230
  return nil if Time.now.to_i <= expt2
231
231
  clk = (clk + 1) & 0xffffffff
232
232
  end
@@ -242,7 +242,7 @@ module Roma
242
242
  return nil unless buf
243
243
 
244
244
  # buf != nil
245
- vn, t, clk, expt2, v2 = unpack_data(buf)
245
+ vn, _t, clk, expt2, _v2 = unpack_data(buf)
246
246
  return nil if Time.now.to_i > expt2
247
247
  clk = (clk + 1) & 0xffffffff
248
248
 
@@ -256,7 +256,7 @@ module Roma
256
256
  return nil unless buf
257
257
 
258
258
  # buf != nil
259
- vn, t, clk, expt2, v2 = unpack_data(buf)
259
+ vn, _t, clk, expt2, v2 = unpack_data(buf)
260
260
  return nil if Time.now.to_i > expt2
261
261
  clk = (clk + 1) & 0xffffffff
262
262
 
@@ -270,7 +270,7 @@ module Roma
270
270
  return nil unless buf
271
271
 
272
272
  # buf != nil
273
- vn, t, clk, expt2, v2 = unpack_data(buf)
273
+ vn, _t, clk, expt2, v2 = unpack_data(buf)
274
274
  return nil if Time.now.to_i > expt2
275
275
  clk = (clk + 1) & 0xffffffff
276
276
 
@@ -282,7 +282,7 @@ module Roma
282
282
  def get(vn, k, d)
283
283
  buf = db_get(vn, k)
284
284
  return nil unless buf
285
- vn, t, clk, expt, v = unpack_data(buf)
285
+ vn, _t, _clk, expt, v = unpack_data(buf)
286
286
 
287
287
  return nil if Time.now.to_i > expt
288
288
  v
@@ -331,7 +331,7 @@ module Roma
331
331
  v = ret = nil
332
332
  clk = 0
333
333
  if buf
334
- vn, t, clk, expt, v2 = unpack_data(buf)
334
+ vn, _t, clk, expt, v2 = unpack_data(buf)
335
335
  return :deletemark if expt == 0
336
336
  clk = (clk + 1) & 0xffffffff
337
337
  v = v2 if v2 && v2.length != 0 && Time.now.to_i <= expt
@@ -358,7 +358,7 @@ module Roma
358
358
  return nil unless buf
359
359
 
360
360
  # buf != nil
361
- vn, t, clk, expt2, v2 = unpack_data(buf)
361
+ vn, _t, clk, expt2, v2 = unpack_data(buf)
362
362
  return nil if Time.now.to_i > expt2
363
363
  clk = (clk + 1) & 0xffffffff
364
364
 
@@ -376,7 +376,7 @@ module Roma
376
376
  return nil unless buf
377
377
 
378
378
  # buf != nil
379
- vn, t, clk, expt2, v2 = unpack_data(buf)
379
+ vn, _t, clk, expt2, v2 = unpack_data(buf)
380
380
  return nil if Time.now.to_i > expt2
381
381
  clk = (clk + 1) & 0xffffffff
382
382
 
@@ -393,7 +393,7 @@ module Roma
393
393
  def set_expt(vn, k, d, expt)
394
394
  buf = db_get(vn, k)
395
395
  if buf
396
- vn, t, clk, expt2, v = unpack_data(buf)
396
+ vn, _t, clk, expt2, v = unpack_data(buf)
397
397
  return nil if Time.now.to_i > expt2
398
398
  clk = (clk + 1) & 0xffffffff
399
399
  ret = [vn, Time.now.to_i, clk, expt, v]
@@ -467,7 +467,7 @@ module Roma
467
467
  h = Marshal.load(dmp)
468
468
  h.each_pair{ |k, v|
469
469
  # remort data
470
- r_vn, r_last, r_clk, r_expt = unpack_header(v)
470
+ r_vn, r_last, r_clk, _r_expt = unpack_header(v)
471
471
  raise "An invalid vnode number is include.key=#{k} vn=#{r_vn}" unless @hdiv.key?(r_vn)
472
472
  local = @hdb[@hdiv[r_vn]].get(k)
473
473
  if local == nil
@@ -475,7 +475,7 @@ module Roma
475
475
  @hdb[@hdiv[r_vn]].put(k, v)
476
476
  else
477
477
  # local data
478
- l_vn, l_last, l_clk, l_expt = unpack_data(local)
478
+ _l_vn, l_last, l_clk, _l_expt = unpack_data(local)
479
479
  if r_last - l_last < @logic_clock_expire && cmp_clk(r_clk,l_clk) <= 0
480
480
  else # remort is newer.
481
481
  n += 1
@@ -31,7 +31,7 @@ module Roma
31
31
  keys.each{ |k|
32
32
  v = hdb[k]
33
33
  return unless @do_clean_up
34
- vn, last, clk, expt = unpack_header(v)
34
+ vn, last, _clk, expt = unpack_header(v)
35
35
  vn_stat = vnhash[vn]
36
36
  if vn_stat == :primary && ( (expt != 0 && nt > expt) || (expt == 0 && t > last) )
37
37
  yield k, vn
@@ -1,5 +1,5 @@
1
1
  module Roma
2
2
  module Storage
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
data/roma-storage.gemspec CHANGED
@@ -7,30 +7,25 @@ Gem::Specification.new do |spec|
7
7
  spec.name = "roma-storage"
8
8
  spec.version = Roma::Storage::VERSION
9
9
  spec.authors = ["Tatsuya Sato"]
10
- spec.email = ["tatsuya.b.sato@rakuten.com"]
10
+ spec.email = ["satoryu.1981@gmail.com"]
11
11
 
12
- spec.summary = %q{Storages available for Roma server.}
13
- spec.description = %q{This gem provides storage classes available for Roma server.}
14
- spec.homepage = "https://roma-kvs.org/"
15
- spec.license = "GPL-3.0"
12
+ spec.summary = %q{The storages of ROMA.}
13
+ spec.description = %q{The base class of the storages of ROMA, and the storage on a Ruby Hash.}
14
+ spec.homepage = "https://github.com/roma/roma-storage"
15
+ spec.license = "GPL-3.0-only"
16
+ spec.required_ruby_version = '>= 3.4'
16
17
 
17
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
- # to allow pushing to a single host or delete this section to allow pushing to any host.
19
- if spec.respond_to?(:metadata)
20
- spec.metadata["allowed_push_host"] = "https://rubygems.org"
21
- else
22
- raise "RubyGems 2.0 or newer is required to protect against " \
23
- "public gem pushes."
24
- end
18
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
19
+ spec.metadata["source_code_uri"] = spec.homepage
25
20
 
26
21
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
27
- f.match(%r{^(test|spec|features)/})
22
+ f.match(%r{^(test|spec|features|bin)/|^\.})
28
23
  end
29
24
  spec.bindir = "exe"
30
25
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
26
  spec.require_paths = ["lib"]
32
27
 
33
- spec.add_development_dependency "bundler", "~> 1.16"
34
- spec.add_development_dependency "rake", "~> 10.0"
35
- spec.add_development_dependency "rspec", "~> 3.0"
28
+ spec.add_development_dependency "rake"
29
+ spec.add_development_dependency "simplecov"
30
+ spec.add_development_dependency "test-unit"
36
31
  end
metadata CHANGED
@@ -1,86 +1,80 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roma-storage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tatsuya Sato
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2018-06-20 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
- name: bundler
13
+ name: rake
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
- - - "~>"
16
+ - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: '1.16'
18
+ version: '0'
20
19
  type: :development
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
- - - "~>"
23
+ - - ">="
25
24
  - !ruby/object:Gem::Version
26
- version: '1.16'
25
+ version: '0'
27
26
  - !ruby/object:Gem::Dependency
28
- name: rake
27
+ name: simplecov
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
- - - "~>"
30
+ - - ">="
32
31
  - !ruby/object:Gem::Version
33
- version: '10.0'
32
+ version: '0'
34
33
  type: :development
35
34
  prerelease: false
36
35
  version_requirements: !ruby/object:Gem::Requirement
37
36
  requirements:
38
- - - "~>"
37
+ - - ">="
39
38
  - !ruby/object:Gem::Version
40
- version: '10.0'
39
+ version: '0'
41
40
  - !ruby/object:Gem::Dependency
42
- name: rspec
41
+ name: test-unit
43
42
  requirement: !ruby/object:Gem::Requirement
44
43
  requirements:
45
- - - "~>"
44
+ - - ">="
46
45
  - !ruby/object:Gem::Version
47
- version: '3.0'
46
+ version: '0'
48
47
  type: :development
49
48
  prerelease: false
50
49
  version_requirements: !ruby/object:Gem::Requirement
51
50
  requirements:
52
- - - "~>"
51
+ - - ">="
53
52
  - !ruby/object:Gem::Version
54
- version: '3.0'
55
- description: This gem provides storage classes available for Roma server.
53
+ version: '0'
54
+ description: The base class of the storages of ROMA, and the storage on a Ruby Hash.
56
55
  email:
57
- - tatsuya.b.sato@rakuten.com
56
+ - satoryu.1981@gmail.com
58
57
  executables: []
59
58
  extensions: []
60
59
  extra_rdoc_files: []
61
60
  files:
62
- - ".gitignore"
63
- - ".rspec"
64
- - ".travis.yml"
65
61
  - CODE_OF_CONDUCT.md
66
62
  - Gemfile
67
63
  - LICENSE.txt
68
64
  - README.md
69
65
  - Rakefile
70
- - bin/console
71
- - bin/setup
72
66
  - lib/roma/storage.rb
73
67
  - lib/roma/storage/basic_storage.rb
74
68
  - lib/roma/storage/dummy_storage.rb
75
69
  - lib/roma/storage/ruby_hash_storage.rb
76
70
  - lib/roma/storage/version.rb
77
71
  - roma-storage.gemspec
78
- homepage: https://roma-kvs.org/
72
+ homepage: https://github.com/roma/roma-storage
79
73
  licenses:
80
- - GPL-3.0
74
+ - GPL-3.0-only
81
75
  metadata:
82
76
  allowed_push_host: https://rubygems.org
83
- post_install_message:
77
+ source_code_uri: https://github.com/roma/roma-storage
84
78
  rdoc_options: []
85
79
  require_paths:
86
80
  - lib
@@ -88,16 +82,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
88
82
  requirements:
89
83
  - - ">="
90
84
  - !ruby/object:Gem::Version
91
- version: '0'
85
+ version: '3.4'
92
86
  required_rubygems_version: !ruby/object:Gem::Requirement
93
87
  requirements:
94
88
  - - ">="
95
89
  - !ruby/object:Gem::Version
96
90
  version: '0'
97
91
  requirements: []
98
- rubyforge_project:
99
- rubygems_version: 2.7.6
100
- signing_key:
92
+ rubygems_version: 4.0.10
101
93
  specification_version: 4
102
- summary: Storages available for Roma server.
94
+ summary: The storages of ROMA.
103
95
  test_files: []
data/.gitignore DELETED
@@ -1,12 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
- Gemfile.lock
10
-
11
- # rspec failure tracking
12
- .rspec_status
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/.travis.yml DELETED
@@ -1,5 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.5.1
5
- before_install: gem install bundler -v 1.16.1
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "roma/storage"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here