dynamosaurus 0.1.2 → 0.1.3
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/lib/dynamosaurus/dynamo_class.rb +9 -1
- data/lib/dynamosaurus/version.rb +1 -1
- data/spec/dynamo_base_spec.rb +2 -2
- data/spec/testmodel.rb +1 -0
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: a19de38297f2abf4e165739a67763a989892daca
         | 
| 4 | 
            +
              data.tar.gz: 3fd81be8b4ffa49b8b2c2df4f25d15d7f2b4b5da
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: ed60ac6ce628a15294b08558398fd4a5305a7608d2a1a6397b5873c0eb455fc7085d7a4821fc5ee0f845fb9cb7d9a260ed486ee0a70390425e0d9730c4f884dc
         | 
| 7 | 
            +
              data.tar.gz: f926c1169e267f288a6d87b6b8b06287502229eb861674a376884e2a88d603c4872440d5b07b21c900e3a6d830f5b1fae9d3ed7ff6966c9c7aede4c8078435e3
         | 
| @@ -132,13 +132,16 @@ module Dynamosaurus | |
| 132 132 | 
             
                  end
         | 
| 133 133 |  | 
| 134 134 | 
             
                  def global_index_schemas
         | 
| 135 | 
            +
                    @global_index_option = {} if @global_index_option.nil?
         | 
| 135 136 | 
             
                    schema = []
         | 
| 136 137 | 
             
                    get_global_indexes.each do |index|
         | 
| 138 | 
            +
                      option = @global_index_option[index[0]] || {}
         | 
| 139 | 
            +
             | 
| 137 140 | 
             
                      schema << {
         | 
| 138 141 | 
             
                        :index_name => index[0],
         | 
| 139 142 | 
             
                        :key_schema => global_index_key_schema(index),
         | 
| 140 143 | 
             
                        :projection => {
         | 
| 141 | 
            -
                          :projection_type => "KEYS_ONLY",
         | 
| 144 | 
            +
                          :projection_type => (option[:projection_type] || "KEYS_ONLY"),
         | 
| 142 145 | 
             
                        },
         | 
| 143 146 | 
             
                        :provisioned_throughput => {
         | 
| 144 147 | 
             
                          :read_capacity_units => 10,
         | 
| @@ -207,6 +210,11 @@ module Dynamosaurus | |
| 207 210 | 
             
                    @global_index[index_name] << range_key_name <<  Dynamosaurus::DynamoBase::TYPES[range_key_type] if range_key_name
         | 
| 208 211 | 
             
                  end
         | 
| 209 212 |  | 
| 213 | 
            +
                  def global_index_option index_name, option
         | 
| 214 | 
            +
                    @global_index_option = {} if @global_index_option.nil?
         | 
| 215 | 
            +
                    @global_index_option[index_name] = option
         | 
| 216 | 
            +
                  end
         | 
| 217 | 
            +
             | 
| 210 218 | 
             
                  def get_global_indexes
         | 
| 211 219 | 
             
                    (@global_index) ? @global_index : {}
         | 
| 212 220 |  | 
    
        data/lib/dynamosaurus/version.rb
    CHANGED
    
    
    
        data/spec/dynamo_base_spec.rb
    CHANGED
    
    | @@ -2,11 +2,11 @@ require 'spec_helper' | |
| 2 2 |  | 
| 3 3 | 
             
            describe Dynamosaurus::DynamoBase do
         | 
| 4 4 | 
             
              before(:all) do
         | 
| 5 | 
            -
                ENV['DYNAMODB_SUFFIX'] = " | 
| 5 | 
            +
                ENV['DYNAMODB_SUFFIX'] = "_local_spec"
         | 
| 6 6 |  | 
| 7 7 | 
             
                Aws.config = {
         | 
| 8 8 | 
             
                  :endpoint => "http://localhost:8000",
         | 
| 9 | 
            -
                  :region => ' | 
| 9 | 
            +
                  :region => 'local_test_spec',
         | 
| 10 10 | 
             
                }
         | 
| 11 11 | 
             
                Dynamosaurus::DynamoBase.create_tables
         | 
| 12 12 | 
             
              end
         | 
    
        data/spec/testmodel.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: dynamosaurus
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 4 | 
            +
              version: 0.1.3
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Isamu Arimoto
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2016-08- | 
| 11 | 
            +
            date: 2016-08-26 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         |