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 +4 -4
 - data/Gemfile.lock +1 -1
 - data/README.md +20 -4
 - data/lib/mdbm_dist_support/distributer.rb +2 -0
 - data/lib/mdbm_dist_support/validator.rb +18 -0
 - data/lib/mdbm_dist_support/version.rb +1 -1
 - metadata +2 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: c726dac9e2d09ceb2e5bae606f611f6fc6dbb200
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 24ed82fcc5026ca2d5e981e45eb5662d80b57f29
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 4150672dc5b2555731b04e174bd44bcd6dcceed317da506702cd2a68ff278ade6892bb3b670d1aa0bc49be9fe78f7eb04949041bb2ecbe77f0faf4c13875d55c
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 76cc9ebb6ac539d6c2898917790520188616f5cc172497c5d2a33aee7088a9e5d8e8dbfc9385578b63009f3e9686cbe9325383c1ab70481f01e4d9ba0e05fd23
         
     | 
    
        data/Gemfile.lock
    CHANGED
    
    
    
        data/README.md
    CHANGED
    
    | 
         @@ -1,6 +1,9 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # mdbm_dist_support
         
     | 
| 
       2 
2 
     | 
    
         
             
            mdbm distribution support gem
         
     | 
| 
       3 
3 
     | 
    
         | 
| 
      
 4 
     | 
    
         
            +
            [](https://badge.fury.io/rb/mdbm_dist_support)
         
     | 
| 
      
 5 
     | 
    
         
            +
            [](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
         
     | 
    
        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. 
     | 
| 
      
 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
         
     |