metaractor-sycamore 0.4.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 +7 -0
 - data/.editorconfig +24 -0
 - data/.envrc +3 -0
 - data/.github/workflows/specs.yml +13 -0
 - data/.gitignore +16 -0
 - data/.rspec +6 -0
 - data/.ruby-version +1 -0
 - data/.yardopts +13 -0
 - data/AUTHORS +2 -0
 - data/CHANGELOG.md +88 -0
 - data/CONTRIBUTING.md +5 -0
 - data/CREDITS +0 -0
 - data/Gemfile +12 -0
 - data/LICENSE.txt +22 -0
 - data/README.md +571 -0
 - data/Rakefile +36 -0
 - data/VERSION +1 -0
 - data/bin/console +7 -0
 - data/bin/setup +8 -0
 - data/devenv.lock +210 -0
 - data/devenv.nix +25 -0
 - data/devenv.yaml +8 -0
 - data/lib/outstand_sycamore.rb +1 -0
 - data/lib/sycamore/absence.rb +179 -0
 - data/lib/sycamore/exceptions.rb +16 -0
 - data/lib/sycamore/extension/nothing.rb +4 -0
 - data/lib/sycamore/extension/path.rb +7 -0
 - data/lib/sycamore/extension/tree.rb +4 -0
 - data/lib/sycamore/extension.rb +2 -0
 - data/lib/sycamore/nothing.rb +157 -0
 - data/lib/sycamore/path.rb +266 -0
 - data/lib/sycamore/path_root.rb +43 -0
 - data/lib/sycamore/stree.rb +4 -0
 - data/lib/sycamore/tree.rb +1469 -0
 - data/lib/sycamore/version.rb +28 -0
 - data/lib/sycamore.rb +13 -0
 - data/support/doctest_helper.rb +2 -0
 - data/support/travis.sh +6 -0
 - data/sycamore.gemspec +29 -0
 - metadata +152 -0
 
    
        checksums.yaml
    ADDED
    
    | 
         @@ -0,0 +1,7 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            ---
         
     | 
| 
      
 2 
     | 
    
         
            +
            SHA256:
         
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 11c200f95444bae5971a1e5f7b0f9eb7c15f04087a6fc7e7d0c62760a4583a0e
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: ff89bf7bc3e510ad2a1c2dfe83e3e8d086f82c95cbca2b71eb52b0b395a39ff5
         
     | 
| 
      
 5 
     | 
    
         
            +
            SHA512:
         
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 9b114dda2b8441e4d7e551416147a2552fc762226ff4cf56b72b347157f0fd83d787ba89972f6df42c4dbabce82d7df70cc3a2c4dd9ccef233009ed0b885daf8
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 3d2b071c69e7a2c3645e556488fc9d03418bda2dbc471834d819416cb1e14e448a3ab9af4a7bb999456ad98d6168c7598eb288349e77b6ab9730719fc0e2db51
         
     | 
    
        data/.editorconfig
    ADDED
    
    | 
         @@ -0,0 +1,24 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            root = true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            [*]
         
     | 
| 
      
 4 
     | 
    
         
            +
            charset = utf-8
         
     | 
| 
      
 5 
     | 
    
         
            +
            end_of_line = lf
         
     | 
| 
      
 6 
     | 
    
         
            +
            insert_final_newline = true
         
     | 
| 
      
 7 
     | 
    
         
            +
            trim_trailing_whitespace = true
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            [*.rb]
         
     | 
| 
      
 10 
     | 
    
         
            +
            indent_style = space
         
     | 
| 
      
 11 
     | 
    
         
            +
            indent_size = 2
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            [*.gemspec]
         
     | 
| 
      
 14 
     | 
    
         
            +
            indent_style = space
         
     | 
| 
      
 15 
     | 
    
         
            +
            indent_size = 2
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
            [*.yml]
         
     | 
| 
      
 18 
     | 
    
         
            +
            indent_style = space
         
     | 
| 
      
 19 
     | 
    
         
            +
            indent_size = 2
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
            [*.md]
         
     | 
| 
      
 22 
     | 
    
         
            +
            indent_style = space
         
     | 
| 
      
 23 
     | 
    
         
            +
            indent_size = 2
         
     | 
| 
      
 24 
     | 
    
         
            +
            trim_trailing_whitespace = false
         
     | 
    
        data/.envrc
    ADDED
    
    
| 
         @@ -0,0 +1,13 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            name: Specs
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            on: [push]
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            jobs:
         
     | 
| 
      
 6 
     | 
    
         
            +
              test:
         
     | 
| 
      
 7 
     | 
    
         
            +
                runs-on: ubuntu-latest
         
     | 
| 
      
 8 
     | 
    
         
            +
                steps:
         
     | 
| 
      
 9 
     | 
    
         
            +
                - uses: actions/checkout@v3
         
     | 
| 
      
 10 
     | 
    
         
            +
                - uses: ruby/setup-ruby@v1
         
     | 
| 
      
 11 
     | 
    
         
            +
                  with:
         
     | 
| 
      
 12 
     | 
    
         
            +
                    bundler-cache: true # runs 'bundle install' and caches installed gems automatically
         
     | 
| 
      
 13 
     | 
    
         
            +
                - run: bundle exec rspec spec
         
     | 
    
        data/.gitignore
    ADDED
    
    
    
        data/.rspec
    ADDED
    
    
    
        data/.ruby-version
    ADDED
    
    | 
         @@ -0,0 +1 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            3.2.2
         
     | 
    
        data/.yardopts
    ADDED
    
    
    
        data/AUTHORS
    ADDED
    
    
    
        data/CHANGELOG.md
    ADDED
    
    | 
         @@ -0,0 +1,88 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # Change Log
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            All notable changes to this project will be documented in this file.
         
     | 
| 
      
 4 
     | 
    
         
            +
            This project adheres to [Semantic Versioning](http://semver.org/) and
         
     | 
| 
      
 5 
     | 
    
         
            +
            [Keep a CHANGELOG](http://keepachangelog.com).
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            ## 0.3.1 - 2016-05-07
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            ### Added
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            - array-access operator and `fetch` on `Path` for random access
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
            ### Changed
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
            - Lazy initialization of the internal hash. This improves extensibility, eg. by  
         
     | 
| 
      
 17 
     | 
    
         
            +
              not requiring a `super` call in the constructors of `Tree` subclasses.
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
            [Compare v0.3.0...v0.3.1](https://github.com/marcelotto/sycamore/compare/v0.3.0...v0.3.1)
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
            ## 0.3.0 - 2016-04-23
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
            ### Added
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
            - support `Path` objects as input on the following `Tree` methods:
         
     | 
| 
      
 29 
     | 
    
         
            +
              - the `Tree.[]` population constructor
         
     | 
| 
      
 30 
     | 
    
         
            +
              - `fetch`
         
     | 
| 
      
 31 
     | 
    
         
            +
              - `add` 
         
     | 
| 
      
 32 
     | 
    
         
            +
              - `delete`
         
     | 
| 
      
 33 
     | 
    
         
            +
              - `replace`
         
     | 
| 
      
 34 
     | 
    
         
            +
              - `[]=`
         
     | 
| 
      
 35 
     | 
    
         
            +
              - `include_node?`
         
     | 
| 
      
 36 
     | 
    
         
            +
              - `leaf?`
         
     | 
| 
      
 37 
     | 
    
         
            +
              - `strict_leaf?`
         
     | 
| 
      
 38 
     | 
    
         
            +
              - `strict_leaves?`
         
     | 
| 
      
 39 
     | 
    
         
            +
              - `internal?`
         
     | 
| 
      
 40 
     | 
    
         
            +
              - `external?`
         
     | 
| 
      
 41 
     | 
    
         
            +
            - `Tree#fetch_path` for fetching a child by path 
         
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
            ### Fixed
         
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
      
 45 
     | 
    
         
            +
            - `Tree#add` or `Tree#delete` now fail without making any changes, when given 
         
     | 
| 
      
 46 
     | 
    
         
            +
              invalid input. Previously these command methods performed their operations  
         
     | 
| 
      
 47 
     | 
    
         
            +
              until the invalid input elements were encountered.
         
     | 
| 
      
 48 
     | 
    
         
            +
            - `Tree#delete` deleted paths, when they matched a given input path partially,
         
     | 
| 
      
 49 
     | 
    
         
            +
              e.g. `Tree[a: 1] >> a: {1 => 2}` deleted successfully.
         
     | 
| 
      
 50 
     | 
    
         
            +
             
     | 
| 
      
 51 
     | 
    
         
            +
             
     | 
| 
      
 52 
     | 
    
         
            +
            [Compare v0.2.1...v0.3.0](https://github.com/marcelotto/sycamore/compare/v0.2.1...v0.3.0)
         
     | 
| 
      
 53 
     | 
    
         
            +
             
     | 
| 
      
 54 
     | 
    
         
            +
             
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
      
 56 
     | 
    
         
            +
            ## 0.2.1 - 2016-04-07
         
     | 
| 
      
 57 
     | 
    
         
            +
             
     | 
| 
      
 58 
     | 
    
         
            +
            ### Added
         
     | 
| 
      
 59 
     | 
    
         
            +
             
     | 
| 
      
 60 
     | 
    
         
            +
            - assigning `nil` via `Tree#[]=` removes a child tree, similar to the assignment
         
     | 
| 
      
 61 
     | 
    
         
            +
              of `Sycamore::Nothing`
         
     | 
| 
      
 62 
     | 
    
         
            +
             
     | 
| 
      
 63 
     | 
    
         
            +
            ### Fixed
         
     | 
| 
      
 64 
     | 
    
         
            +
             
     | 
| 
      
 65 
     | 
    
         
            +
            - [#2](https://github.com/marcelotto/sycamore/issues/2): Rubinius support
         
     | 
| 
      
 66 
     | 
    
         
            +
             
     | 
| 
      
 67 
     | 
    
         
            +
             
     | 
| 
      
 68 
     | 
    
         
            +
            [Compare v0.2.0...v0.2.1](https://github.com/marcelotto/sycamore/compare/v0.2.0...v0.2.1)
         
     | 
| 
      
 69 
     | 
    
         
            +
             
     | 
| 
      
 70 
     | 
    
         
            +
             
     | 
| 
      
 71 
     | 
    
         
            +
             
     | 
| 
      
 72 
     | 
    
         
            +
            ## 0.2.0 - 2016-04-05
         
     | 
| 
      
 73 
     | 
    
         
            +
             
     | 
| 
      
 74 
     | 
    
         
            +
            ### Added
         
     | 
| 
      
 75 
     | 
    
         
            +
             
     | 
| 
      
 76 
     | 
    
         
            +
            - assigning `Sycamore::Nothing` via `Tree#[]=` removes a child tree
         
     | 
| 
      
 77 
     | 
    
         
            +
            - `Tree#search` for searching the tree for one or multiple nodes or a tree
         
     | 
| 
      
 78 
     | 
    
         
            +
            - `Tree#node!` as a more strict variant of `Tree#node`, which raises an error 
         
     | 
| 
      
 79 
     | 
    
         
            +
              when no node present
         
     | 
| 
      
 80 
     | 
    
         
            +
             
     | 
| 
      
 81 
     | 
    
         
            +
             
     | 
| 
      
 82 
     | 
    
         
            +
            [Compare v0.1.0...v0.2.0](https://github.com/marcelotto/sycamore/compare/v0.1.0...v0.2.0)
         
     | 
| 
      
 83 
     | 
    
         
            +
             
     | 
| 
      
 84 
     | 
    
         
            +
             
     | 
| 
      
 85 
     | 
    
         
            +
             
     | 
| 
      
 86 
     | 
    
         
            +
            ## 0.1.0 - 2016-03-28
         
     | 
| 
      
 87 
     | 
    
         
            +
             
     | 
| 
      
 88 
     | 
    
         
            +
            Initial release
         
     | 
    
        data/CONTRIBUTING.md
    ADDED
    
    | 
         @@ -0,0 +1,5 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            1. Fork it ( <https://github.com/marcelotto/sycamore/fork> )
         
     | 
| 
      
 2 
     | 
    
         
            +
            2. Create your feature branch (`git checkout -b my-new-feature`)
         
     | 
| 
      
 3 
     | 
    
         
            +
            3. Commit your changes (`git commit -am 'Add some feature'`)
         
     | 
| 
      
 4 
     | 
    
         
            +
            4. Push to the branch (`git push origin my-new-feature`)
         
     | 
| 
      
 5 
     | 
    
         
            +
            5. Create a new Pull Request
         
     | 
    
        data/CREDITS
    ADDED
    
    | 
         
            File without changes
         
     | 
    
        data/Gemfile
    ADDED
    
    
    
        data/LICENSE.txt
    ADDED
    
    | 
         @@ -0,0 +1,22 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            Copyright (c) 2015-2016 Marcel Otto
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            MIT License
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            Permission is hereby granted, free of charge, to any person obtaining
         
     | 
| 
      
 6 
     | 
    
         
            +
            a copy of this software and associated documentation files (the
         
     | 
| 
      
 7 
     | 
    
         
            +
            "Software"), to deal in the Software without restriction, including
         
     | 
| 
      
 8 
     | 
    
         
            +
            without limitation the rights to use, copy, modify, merge, publish,
         
     | 
| 
      
 9 
     | 
    
         
            +
            distribute, sublicense, and/or sell copies of the Software, and to
         
     | 
| 
      
 10 
     | 
    
         
            +
            permit persons to whom the Software is furnished to do so, subject to
         
     | 
| 
      
 11 
     | 
    
         
            +
            the following conditions:
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            The above copyright notice and this permission notice shall be
         
     | 
| 
      
 14 
     | 
    
         
            +
            included in all copies or substantial portions of the Software.
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
            THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
         
     | 
| 
      
 17 
     | 
    
         
            +
            EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
         
     | 
| 
      
 18 
     | 
    
         
            +
            MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
         
     | 
| 
      
 19 
     | 
    
         
            +
            NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
         
     | 
| 
      
 20 
     | 
    
         
            +
            LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
         
     | 
| 
      
 21 
     | 
    
         
            +
            OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
         
     | 
| 
      
 22 
     | 
    
         
            +
            WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
         
     |