mdbm_dist_support 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
  SHA1:
3
- metadata.gz: f6a110b62fc353a860aea95a85a114cfe98a8e12
4
- data.tar.gz: d084dfa7a45a7933fb150945641d4d8cc1e51bfd
3
+ metadata.gz: c726dac9e2d09ceb2e5bae606f611f6fc6dbb200
4
+ data.tar.gz: 24ed82fcc5026ca2d5e981e45eb5662d80b57f29
5
5
  SHA512:
6
- metadata.gz: 95ac2310e2fef1acd077915b2283ffe4d616af2aa58d3b2a922d372021a792ed0e405b09f455733317cba7b547a25f587f997366a5c867eb91481fda4305e18e
7
- data.tar.gz: 37ad18a71b23d25add915c523bfad8c04f23e457340b51a3728e2d8b510ecf2f7326b8366e14fde37097016a5d55aaf84837f70a69fde3f7658fa2b90cb61c8a
6
+ metadata.gz: 4150672dc5b2555731b04e174bd44bcd6dcceed317da506702cd2a68ff278ade6892bb3b670d1aa0bc49be9fe78f7eb04949041bb2ecbe77f0faf4c13875d55c
7
+ data.tar.gz: 76cc9ebb6ac539d6c2898917790520188616f5cc172497c5d2a33aee7088a9e5d8e8dbfc9385578b63009f3e9686cbe9325383c1ab70481f01e4d9ba0e05fd23
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mdbm_dist_support (0.1.0)
4
+ mdbm_dist_support (0.1.1)
5
5
  ruby-mdbm (>= 0.0.2)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # mdbm_dist_support
2
2
  mdbm distribution support gem
3
3
 
4
+ [![Gem Version](https://badge.fury.io/rb/mdbm_dist_support.svg)](https://badge.fury.io/rb/mdbm_dist_support)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+
4
7
  ## Usage
5
8
  ```
6
9
  #!/usr/bin/env ruby
@@ -12,14 +15,27 @@ mds = MdbmDistSupport::Distributer.new do |m|
12
15
  m.meta_path = 'local meta mdbm file path'
13
16
  m.local_path = 'local mdbm file path'
14
17
  m.dist_path = 'distribution mdbm file path'
15
- m.cmd_print = 'print command ( command to print Key Value seperated TAB to STDOUT )'
16
- m.cmd_gen = 'generate mdbm command'
17
- m.cmd_rep = 'replace mdbm command'
18
- m.full_mode = true
18
+ m.cmd_print = 'print command path ( command to print Key Value seperated TAB to STDOUT )'
19
+ m.cmd_gen = 'generate mdbm command path'
20
+ m.cmd_rep = 'replace mdbm command path'
21
+ m.full_mode = true/false ( full or increment update )
19
22
  m.dist_server_hosts = ['distribution target server hosts array']
20
23
  m.meta_incr_key = 'incrementmode key in local meta mdbm'
21
24
  end
22
25
 
23
26
  mds.run
24
27
  ```
28
+ |parameter_name|value|
29
+ |:-----------|:------------|
30
+ |cmd_gen|_i64_str_gen_ / _i32_str_gen_ / _i32_i64_gen_ / _i32_i32_gen_ etc|
31
+ |cmd_rep|_/usr/local/bin/mdbm_replace_|
32
+
33
+ ## Requires
34
+ * ruby
35
+ * ruby-mdbm
25
36
 
37
+ ## Generate mdbm command module
38
+ * int64_str_mdbm
39
+ * int32_str_mdbm
40
+ * int32_int64_mdbm
41
+ * int32_int32_mdbm
@@ -1,5 +1,6 @@
1
1
  require 'mdbm_dist_support/meta'
2
2
  require 'mdbm_dist_support/lock'
3
+ require 'mdbm_dist_support/validator'
3
4
  require 'tempfile'
4
5
 
5
6
  module MdbmDistSupport
@@ -14,6 +15,7 @@ module MdbmDistSupport
14
15
  end
15
16
 
16
17
  def run
18
+ MdbmDistSupport::Validator::check(instance_variables)
17
19
  @lock = MdbmDistSupport::Lock.new(@lock_path)
18
20
  @meta = MdbmDistSupport::Meta.new(@meta_path)
19
21
  @lock.try_lock
@@ -0,0 +1,18 @@
1
+ module MdbmDistSupport
2
+ # settings input validator
3
+ class Validator
4
+ REQUIRE_INSTANCE_VARS =
5
+ [:@lock_path, :@meta_path, :@local_path, :@dist_path, :@cmd_print,\
6
+ :@cmd_gen, :@cmd_rep, :@full_mode, :@dist_server_hosts,\
7
+ :@meta_incr_key].freeze
8
+
9
+ class << self
10
+ def check(settings)
11
+ df = REQUIRE_INSTANCE_VARS - settings
12
+ unless df.length.zero?
13
+ raise %(#{df.to_s} : Required settings is undefined. )
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,3 +1,3 @@
1
1
  module MdbmDistSupport
2
- VERSION = "0.1.0"
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mdbm_dist_support
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
  - MichinaoShimizu
@@ -85,6 +85,7 @@ files:
85
85
  - lib/mdbm_dist_support/distributer.rb
86
86
  - lib/mdbm_dist_support/lock.rb
87
87
  - lib/mdbm_dist_support/meta.rb
88
+ - lib/mdbm_dist_support/validator.rb
88
89
  - lib/mdbm_dist_support/version.rb
89
90
  - mdbm_dist_support.gemspec
90
91
  homepage: https://github.com/MichinaoShimizu/mdbm_dist_support