rb_lovely 0.5.0 → 0.6.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/ext/rb_lovely/container.hpp +4 -2
- data/ext/rb_lovely/extconf.rb +3 -1
- data/ext/rb_lovely/ruby_util.hpp +2 -2
- data/ext/rb_lovely/sorted_hash.cpp +2 -2
- 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: a101665aa179ecfdd7edfce739f5f2feee1af73d
         | 
| 4 | 
            +
              data.tar.gz: 819f929306b9aeef392d0325e311badac9e4c019
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 26d39b7cee7223eb6e66cd5e7fecac58e59fcc3e9880e24c3c120e582ca590492d2f38fab8607ee03be02eca2747327841d6238cbda17db94cdd3f2aee0e035f
         | 
| 7 | 
            +
              data.tar.gz: ba9d4986fce10cf32ea1c268cfa5e85301d28baa1d547646d1d9b4fe87167374d496e53ff806c43cd4c837a5d74f39319089872201f3396c6a63d4e9c3ea7636
         | 
    
        data/ext/rb_lovely/container.hpp
    CHANGED
    
    | @@ -1,10 +1,12 @@ | |
| 1 | 
            -
            #ifndef  | 
| 2 | 
            -
            #define  | 
| 1 | 
            +
            #ifndef RB_LOVELY_CONTAINER_HPP
         | 
| 2 | 
            +
            #define RB_LOVELY_CONTAINER_HPP
         | 
| 3 3 |  | 
| 4 4 | 
             
            #include "ruby_util.hpp"
         | 
| 5 5 |  | 
| 6 6 | 
             
            namespace rb_lovely {
         | 
| 7 7 |  | 
| 8 | 
            +
            // TODO: No more toS, provide inspect instead which is what the containers should be using
         | 
| 9 | 
            +
            //       for each member.
         | 
| 8 10 | 
             
            auto toS = [](VALUE val) { return RSTRING_PTR(rb_funcall(val, to_sSym, 0)); };
         | 
| 9 11 |  | 
| 10 12 | 
             
            }
         | 
    
        data/ext/rb_lovely/extconf.rb
    CHANGED
    
    | @@ -2,6 +2,8 @@ require 'mkmf' | |
| 2 2 | 
             
            $CPPFLAGS += ' -std=c++0x'
         | 
| 3 3 | 
             
            with_cflags('-x c++') do
         | 
| 4 4 | 
             
              # needed for SortedHash, optional
         | 
| 5 | 
            -
              have_header | 
| 5 | 
            +
              unless have_header 'boost/multi_index_container.hpp'
         | 
| 6 | 
            +
                warn 'Could not find boost, disabling SortedHash'
         | 
| 7 | 
            +
              end
         | 
| 6 8 | 
             
            end
         | 
| 7 9 | 
             
            create_makefile('rb_lovely')
         | 
    
        data/ext/rb_lovely/ruby_util.hpp
    CHANGED
    
    
| @@ -183,7 +183,7 @@ VALUE hashLast(VALUE self) { | |
| 183 183 | 
             
              return last->val;
         | 
| 184 184 | 
             
            }
         | 
| 185 185 |  | 
| 186 | 
            -
            VALUE  | 
| 186 | 
            +
            VALUE hashDelete(VALUE self, VALUE toDelete) {
         | 
| 187 187 | 
             
              Hash* hash = rubyCast<Hash>(self);
         | 
| 188 188 | 
             
              auto it = hash->container.find(toDelete);
         | 
| 189 189 | 
             
              if (it == hash->container.end()) {
         | 
| @@ -256,7 +256,7 @@ extern "C" { | |
| 256 256 | 
             
                rb_define_method(rbHash, "to_s", RUBY_METHOD_FUNC(hashToString), 0);
         | 
| 257 257 | 
             
                rb_define_method(rbHash, "first", RUBY_METHOD_FUNC(hashFirst), 0);
         | 
| 258 258 | 
             
                rb_define_method(rbHash, "last", RUBY_METHOD_FUNC(hashLast), 0);
         | 
| 259 | 
            -
                rb_define_method(rbHash, "delete", RUBY_METHOD_FUNC( | 
| 259 | 
            +
                rb_define_method(rbHash, "delete", RUBY_METHOD_FUNC(hashDelete), 1);
         | 
| 260 260 | 
             
                // rb_define_method(rbHash, "reject!", RUBY_METHOD_FUNC(hashMutatingReject), 0);
         | 
| 261 261 | 
             
                // rb_define_method(rbHash, "reject_first!", RUBY_METHOD_FUNC(hashMutatingRejectFirst), 0);
         | 
| 262 262 | 
             
                // rb_define_method(rbHash, "select!", RUBY_METHOD_FUNC(hashMutatingSelect), 0);
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: rb_lovely
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.6.1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - James Pike
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2014-09- | 
| 11 | 
            +
            date: 2014-09-06 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies: []
         | 
| 13 13 | 
             
            description: A fast sorted set built using std::set and a fast sorted hash built using
         | 
| 14 14 | 
             
              boost::multi_index_container.
         |