wherever-positions 0.4.1 → 0.4.2
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.
- data/VERSION +1 -1
 - data/lib/wherever.rb +1 -0
 - data/lib/wherever/db_store.rb +3 -7
 - data/lib/wherever/wherever/mark.rb +10 -9
 - data/wherever-positions.gemspec +2 -2
 - metadata +4 -4
 
    
        data/VERSION
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            0.4. 
     | 
| 
      
 1 
     | 
    
         
            +
            0.4.2
         
     | 
    
        data/lib/wherever.rb
    CHANGED
    
    
    
        data/lib/wherever/db_store.rb
    CHANGED
    
    | 
         @@ -30,14 +30,10 @@ module DbStore 
     | 
|
| 
       30 
30 
     | 
    
         
             
                end
         
     | 
| 
       31 
31 
     | 
    
         | 
| 
       32 
32 
     | 
    
         
             
                def get_lookup(name, keys)
         
     | 
| 
       33 
     | 
    
         
            -
                  if keys
         
     | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
       35 
     | 
    
         
            -
                  end
         
     | 
| 
       36 
     | 
    
         
            -
                  name = "Lookup_#{name.upcase}"
         
     | 
| 
       37 
     | 
    
         
            -
                  return "DbStore::#{name}".constantize if DbStore.constants.include?(name)
         
     | 
| 
      
 33 
     | 
    
         
            +
                  DbStore::Lookup.find_or_create_by(:name => name, :keys => keys) if keys
         
     | 
| 
      
 34 
     | 
    
         
            +
                  return "DbStore::Lookup#{name}".constantize if DbStore.constants.include?("Lookup#{name}")
         
     | 
| 
       38 
35 
     | 
    
         
             
                  raise "Missing lookup key from definition" unless keys
         
     | 
| 
       39 
     | 
    
         
            -
             
     | 
| 
       40 
     | 
    
         
            -
                  build_class(name, DbStore::VersionConfig, :"lookup_#{name}")
         
     | 
| 
      
 36 
     | 
    
         
            +
                  build_class("Lookup#{name}", DbStore::VersionConfig, :"lookup_#{name}")
         
     | 
| 
       41 
37 
     | 
    
         
             
                end
         
     | 
| 
       42 
38 
     | 
    
         | 
| 
       43 
39 
     | 
    
         
             
                def build_class(name, module_object, store_in)
         
     | 
| 
         @@ -1,15 +1,16 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            class Wherever
         
     | 
| 
       2 
2 
     | 
    
         
             
              module Mark
         
     | 
| 
       3 
3 
     | 
    
         
             
                def mark(name)
         
     | 
| 
       4 
     | 
    
         
            -
                   
     | 
| 
       5 
     | 
    
         
            -
                     
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
     | 
    
         
            -
                     
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
                     
     | 
| 
       12 
     | 
    
         
            -
                       
     | 
| 
      
 4 
     | 
    
         
            +
                  configuration = if Mongoid::Config.respond_to?(:master) 
         
     | 
| 
      
 5 
     | 
    
         
            +
                    Mongoid::Config
         
     | 
| 
      
 6 
     | 
    
         
            +
                  else
         
     | 
| 
      
 7 
     | 
    
         
            +
                    Mongoid::Config.instance
         
     | 
| 
      
 8 
     | 
    
         
            +
                  end
         
     | 
| 
      
 9 
     | 
    
         
            +
                  configuration.master.eval("db.current_identifier.find().forEach( function(x){db.#{name}_identifier.insert(x)} )")
         
     | 
| 
      
 10 
     | 
    
         
            +
                  config.key_groups.each do |keys|
         
     | 
| 
      
 11 
     | 
    
         
            +
                    [:identifier, :dataset].each do |db_type|
         
     | 
| 
      
 12 
     | 
    
         
            +
                      db_id = "#{keys.join('_')}_#{db_type}"
         
     | 
| 
      
 13 
     | 
    
         
            +
                      configuration.master.eval("db.current_#{db_id}.find().forEach( function(x){db.#{name}_#{db_id}.insert(x)} )")
         
     | 
| 
       13 
14 
     | 
    
         
             
                    end
         
     | 
| 
       14 
15 
     | 
    
         
             
                  end
         
     | 
| 
       15 
16 
     | 
    
         
             
                  set_price_lookup('price', nil, [{'marker' => name}])
         
     | 
    
        data/wherever-positions.gemspec
    CHANGED
    
    | 
         @@ -5,11 +5,11 @@ 
     | 
|
| 
       5 
5 
     | 
    
         | 
| 
       6 
6 
     | 
    
         
             
            Gem::Specification.new do |s|
         
     | 
| 
       7 
7 
     | 
    
         
             
              s.name = %q{wherever-positions}
         
     | 
| 
       8 
     | 
    
         
            -
              s.version = "0.4. 
     | 
| 
      
 8 
     | 
    
         
            +
              s.version = "0.4.2"
         
     | 
| 
       9 
9 
     | 
    
         | 
| 
       10 
10 
     | 
    
         
             
              s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
         
     | 
| 
       11 
11 
     | 
    
         
             
              s.authors = ["David Henry"]
         
     | 
| 
       12 
     | 
    
         
            -
              s.date = %q{2011-11- 
     | 
| 
      
 12 
     | 
    
         
            +
              s.date = %q{2011-11-04}
         
     | 
| 
       13 
13 
     | 
    
         
             
              s.description = %q{Allow Store of positions by multiple keys with teh option to mark specific points in time for use later}
         
     | 
| 
       14 
14 
     | 
    
         
             
              s.email = %q{dw_henry@yahoo.com.au}
         
     | 
| 
       15 
15 
     | 
    
         
             
              s.extra_rdoc_files = [
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,13 +1,13 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification 
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: wherever-positions
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version 
         
     | 
| 
       4 
     | 
    
         
            -
              hash:  
     | 
| 
      
 4 
     | 
    
         
            +
              hash: 11
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: 
         
     | 
| 
       6 
6 
     | 
    
         
             
              segments: 
         
     | 
| 
       7 
7 
     | 
    
         
             
              - 0
         
     | 
| 
       8 
8 
     | 
    
         
             
              - 4
         
     | 
| 
       9 
     | 
    
         
            -
              -  
     | 
| 
       10 
     | 
    
         
            -
              version: 0.4. 
     | 
| 
      
 9 
     | 
    
         
            +
              - 2
         
     | 
| 
      
 10 
     | 
    
         
            +
              version: 0.4.2
         
     | 
| 
       11 
11 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       12 
12 
     | 
    
         
             
            authors: 
         
     | 
| 
       13 
13 
     | 
    
         
             
            - David Henry
         
     | 
| 
         @@ -15,7 +15,7 @@ autorequire: 
     | 
|
| 
       15 
15 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       16 
16 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       17 
17 
     | 
    
         | 
| 
       18 
     | 
    
         
            -
            date: 2011-11- 
     | 
| 
      
 18 
     | 
    
         
            +
            date: 2011-11-04 00:00:00 +00:00
         
     | 
| 
       19 
19 
     | 
    
         
             
            default_executable: 
         
     | 
| 
       20 
20 
     | 
    
         
             
            dependencies: 
         
     | 
| 
       21 
21 
     | 
    
         
             
            - !ruby/object:Gem::Dependency 
         
     |