rash_alt 0.4.9 → 0.4.10
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/.github/workflows/{ruby.yml → rspec.yml} +1 -1
- data/Dockerfile +10 -0
- data/README.md +86 -0
- data/lib/hashie/mash/rash.rb +1 -0
- data/lib/rash/version.rb +1 -1
- data/rash.gemspec +5 -5
- data/spec/rash_spec.rb +6 -0
- metadata +15 -14
- data/README.rdoc +0 -77
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 5c484aa06757e57da16df5493e7556d017891abc9dc31602e7d7da2cb0afaf95
         | 
| 4 | 
            +
              data.tar.gz: 65a185702f051d84d2b04f93a96c3f8bac0b60a2c5b48ef6fc22158a54cc8762
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: f35863662ddca2a6e6191f2a515955df9950f37a5e587661df06f0c86ad47fabc1c28fd63ae2f6b07cb11b3bf5d9869d82aa053c331e3f767ecfe5a0725e550c
         | 
| 7 | 
            +
              data.tar.gz: 6d07ba44559d89608ade5f1e6af1a7ec1e98493b0c9367dc62fbf7adf31940f57184cdeeec6431272e182dd3bdb41e9bc4a25c22e6a2aab44573696fc10e2472
         | 
    
        data/Dockerfile
    ADDED
    
    
    
        data/README.md
    ADDED
    
    | @@ -0,0 +1,86 @@ | |
| 1 | 
            +
            # rash
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            [](https://rubygems.org/gems/rash_alt)
         | 
| 4 | 
            +
            [](https://github.com/shishi/rash_alt/actions?query=workflow%3Arspec)
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            Rash is an extension to Hashie ( http://github.com/hashie/hashie ).
         | 
| 7 | 
            +
             | 
| 8 | 
            +
            Rash subclasses Hashie::Mash to convert all keys in the hash to underscore.
         | 
| 9 | 
            +
             | 
| 10 | 
            +
            The purpose of this is when working w/ Java (or any other apis) that return
         | 
| 11 | 
            +
            hashes (including nested) that have camelCased keys.
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            You will now be able to access those keys through underscored key names
         | 
| 14 | 
            +
            (camelCase still available).
         | 
| 15 | 
            +
             | 
| 16 | 
            +
            ## Installation
         | 
| 17 | 
            +
             | 
| 18 | 
            +
            Add this line to your application's Gemfile:
         | 
| 19 | 
            +
             | 
| 20 | 
            +
            ```ruby
         | 
| 21 | 
            +
            gem 'rash_alt', require: 'rash'
         | 
| 22 | 
            +
            ```
         | 
| 23 | 
            +
             | 
| 24 | 
            +
            And then execute:
         | 
| 25 | 
            +
             | 
| 26 | 
            +
            ```shell
         | 
| 27 | 
            +
            $ bundle
         | 
| 28 | 
            +
            ```
         | 
| 29 | 
            +
             | 
| 30 | 
            +
            Or install it yourself as:
         | 
| 31 | 
            +
             | 
| 32 | 
            +
            ```shell
         | 
| 33 | 
            +
            $ gem install rash_alt
         | 
| 34 | 
            +
            ```
         | 
| 35 | 
            +
             | 
| 36 | 
            +
            ## Usage
         | 
| 37 | 
            +
             | 
| 38 | 
            +
            ```ruby
         | 
| 39 | 
            +
            @rash = Hashie::Mash::Rash.new({
         | 
| 40 | 
            +
              "varOne" => 1,
         | 
| 41 | 
            +
              "two" => 2,
         | 
| 42 | 
            +
              :three => 3,
         | 
| 43 | 
            +
              :varFour => 4,
         | 
| 44 | 
            +
              "fiveHumpHumps" => 5,
         | 
| 45 | 
            +
              :nested => {
         | 
| 46 | 
            +
                "NestedOne" => "One",
         | 
| 47 | 
            +
                :two => "two",
         | 
| 48 | 
            +
                "nested_three" => "three"
         | 
| 49 | 
            +
              },
         | 
| 50 | 
            +
              "nestedTwo" => {
         | 
| 51 | 
            +
                "nested_two" => 22,
         | 
| 52 | 
            +
                :nestedThree => 23
         | 
| 53 | 
            +
              }
         | 
| 54 | 
            +
            })
         | 
| 55 | 
            +
             | 
| 56 | 
            +
            @rash.var_one                 # => 1
         | 
| 57 | 
            +
            @rash.two                     # => 2
         | 
| 58 | 
            +
            @rash.three                   # => 3
         | 
| 59 | 
            +
            @rash.var_four                # => 4
         | 
| 60 | 
            +
            @rash.five_hump_humps         # => 5
         | 
| 61 | 
            +
            @rash.nested.nested_one       # => "One"
         | 
| 62 | 
            +
            @rash.nested.two              # => "two"
         | 
| 63 | 
            +
            @rash.nested.nested_three     # => "three"
         | 
| 64 | 
            +
            @rash.nested_two.nested_two   # => 22
         | 
| 65 | 
            +
            @rash.nested_two.nested_three # => 23
         | 
| 66 | 
            +
            ```
         | 
| 67 | 
            +
             | 
| 68 | 
            +
            ## Note on Patches/Pull Requests
         | 
| 69 | 
            +
             | 
| 70 | 
            +
            * Fork the project.
         | 
| 71 | 
            +
            * Make your feature addition or bug fix.
         | 
| 72 | 
            +
            * Add tests for it. This is important so I don't break it in a future version unintentionally.
         | 
| 73 | 
            +
            * Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
         | 
| 74 | 
            +
            * Send me a pull request. Bonus points for topic branches.
         | 
| 75 | 
            +
             | 
| 76 | 
            +
            ## Copyright
         | 
| 77 | 
            +
             | 
| 78 | 
            +
            * Copyright (c) 2010 Tom Cocca.
         | 
| 79 | 
            +
            * Copyright (c) 2016 Shigenobu Nishikawa.
         | 
| 80 | 
            +
             | 
| 81 | 
            +
            ### Acknowledgements
         | 
| 82 | 
            +
             | 
| 83 | 
            +
            * Intridea (https://github.com/intridea) for Hashie
         | 
| 84 | 
            +
            * Mislav Marohnić (https://github.com/mislav) for contributions to Rash
         | 
| 85 | 
            +
            * Steve Agalloco (https://github.com/spagalloco) for updating Rash to use bundler, rspec 2.5, hashie 1.0 and fixing some load dependencies
         | 
| 86 | 
            +
             | 
    
        data/lib/hashie/mash/rash.rb
    CHANGED
    
    
    
        data/lib/rash/version.rb
    CHANGED
    
    
    
        data/rash.gemspec
    CHANGED
    
    | @@ -6,17 +6,17 @@ Gem::Specification.new do |s| | |
| 6 6 | 
             
              s.name = %q{rash_alt}
         | 
| 7 7 | 
             
              s.authors = ["tcocca", "Shigenobu Nishikawa"]
         | 
| 8 8 | 
             
              s.description = %q{simple extension to Hashie::Mash for rubyified keys, all keys are converted to underscore to eliminate horrible camelCasing}
         | 
| 9 | 
            -
              s.email = %q{tom.cocca@gmail.com, shishi | 
| 9 | 
            +
              s.email = %q{tom.cocca@gmail.com, shishi@srevo.net}
         | 
| 10 10 | 
             
              s.homepage = "https://github.com/shishi/rash_alt"
         | 
| 11 11 | 
             
              s.rdoc_options = ["--charset=UTF-8"]
         | 
| 12 12 | 
             
              s.summary = %q{simple extension to Hashie::Mash for rubyified keys}
         | 
| 13 13 |  | 
| 14 14 | 
             
              s.version = Rash::VERSION
         | 
| 15 15 |  | 
| 16 | 
            -
              s.add_dependency 'hashie', '~>  | 
| 17 | 
            -
              s.add_development_dependency 'rake', '~> 13 | 
| 18 | 
            -
              s.add_development_dependency 'rdoc', '~> 6 | 
| 19 | 
            -
              s.add_development_dependency 'rspec', '~> 3 | 
| 16 | 
            +
              s.add_dependency 'hashie', '~> 5'
         | 
| 17 | 
            +
              s.add_development_dependency 'rake', '~> 13'
         | 
| 18 | 
            +
              s.add_development_dependency 'rdoc', '~> 6'
         | 
| 19 | 
            +
              s.add_development_dependency 'rspec', '~> 3'
         | 
| 20 20 |  | 
| 21 21 | 
             
              s.require_paths = ['lib']
         | 
| 22 22 | 
             
              s.files = `git ls-files`.split("\n")
         | 
    
        data/spec/rash_spec.rb
    CHANGED
    
    | @@ -48,6 +48,9 @@ describe Hashie::Mash::Rash do | |
| 48 48 | 
             
              end
         | 
| 49 49 |  | 
| 50 50 | 
             
              it "should allow camelCased accessors" do
         | 
| 51 | 
            +
                #avoiding hashie v5- warnings
         | 
| 52 | 
            +
                subject.class.disable_warnings(:varOne)
         | 
| 53 | 
            +
             | 
| 51 54 | 
             
                subject.varOne.should == 1
         | 
| 52 55 | 
             
                subject.varOne = "once"
         | 
| 53 56 | 
             
                subject.varOne.should == "once"
         | 
| @@ -55,6 +58,9 @@ describe Hashie::Mash::Rash do | |
| 55 58 | 
             
              end
         | 
| 56 59 |  | 
| 57 60 | 
             
              it "should allow camelCased accessors on nested hashes" do
         | 
| 61 | 
            +
                # avoiding hashie v5-  warnings
         | 
| 62 | 
            +
                subject.class.disable_warnings(:nestedOne)
         | 
| 63 | 
            +
             | 
| 58 64 | 
             
                subject.nested.nestedOne.should == "One"
         | 
| 59 65 | 
             
                subject.nested.nestedOne = "once"
         | 
| 60 66 | 
             
                subject.nested.nested_one.should == "once"
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: rash_alt
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.4. | 
| 4 | 
            +
              version: 0.4.10
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - tcocca
         | 
| @@ -9,7 +9,7 @@ authors: | |
| 9 9 | 
             
            autorequire: 
         | 
| 10 10 | 
             
            bindir: bin
         | 
| 11 11 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date:  | 
| 12 | 
            +
            date: 2022-02-21 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: hashie
         | 
| @@ -17,69 +17,70 @@ dependencies: | |
| 17 17 | 
             
                requirements:
         | 
| 18 18 | 
             
                - - "~>"
         | 
| 19 19 | 
             
                  - !ruby/object:Gem::Version
         | 
| 20 | 
            -
                    version: ' | 
| 20 | 
            +
                    version: '5'
         | 
| 21 21 | 
             
              type: :runtime
         | 
| 22 22 | 
             
              prerelease: false
         | 
| 23 23 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 24 24 | 
             
                requirements:
         | 
| 25 25 | 
             
                - - "~>"
         | 
| 26 26 | 
             
                  - !ruby/object:Gem::Version
         | 
| 27 | 
            -
                    version: ' | 
| 27 | 
            +
                    version: '5'
         | 
| 28 28 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 29 29 | 
             
              name: rake
         | 
| 30 30 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 31 31 | 
             
                requirements:
         | 
| 32 32 | 
             
                - - "~>"
         | 
| 33 33 | 
             
                  - !ruby/object:Gem::Version
         | 
| 34 | 
            -
                    version: '13 | 
| 34 | 
            +
                    version: '13'
         | 
| 35 35 | 
             
              type: :development
         | 
| 36 36 | 
             
              prerelease: false
         | 
| 37 37 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 38 38 | 
             
                requirements:
         | 
| 39 39 | 
             
                - - "~>"
         | 
| 40 40 | 
             
                  - !ruby/object:Gem::Version
         | 
| 41 | 
            -
                    version: '13 | 
| 41 | 
            +
                    version: '13'
         | 
| 42 42 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 43 43 | 
             
              name: rdoc
         | 
| 44 44 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 45 45 | 
             
                requirements:
         | 
| 46 46 | 
             
                - - "~>"
         | 
| 47 47 | 
             
                  - !ruby/object:Gem::Version
         | 
| 48 | 
            -
                    version: '6 | 
| 48 | 
            +
                    version: '6'
         | 
| 49 49 | 
             
              type: :development
         | 
| 50 50 | 
             
              prerelease: false
         | 
| 51 51 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 52 52 | 
             
                requirements:
         | 
| 53 53 | 
             
                - - "~>"
         | 
| 54 54 | 
             
                  - !ruby/object:Gem::Version
         | 
| 55 | 
            -
                    version: '6 | 
| 55 | 
            +
                    version: '6'
         | 
| 56 56 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 57 57 | 
             
              name: rspec
         | 
| 58 58 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 59 59 | 
             
                requirements:
         | 
| 60 60 | 
             
                - - "~>"
         | 
| 61 61 | 
             
                  - !ruby/object:Gem::Version
         | 
| 62 | 
            -
                    version: '3 | 
| 62 | 
            +
                    version: '3'
         | 
| 63 63 | 
             
              type: :development
         | 
| 64 64 | 
             
              prerelease: false
         | 
| 65 65 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 66 66 | 
             
                requirements:
         | 
| 67 67 | 
             
                - - "~>"
         | 
| 68 68 | 
             
                  - !ruby/object:Gem::Version
         | 
| 69 | 
            -
                    version: '3 | 
| 69 | 
            +
                    version: '3'
         | 
| 70 70 | 
             
            description: simple extension to Hashie::Mash for rubyified keys, all keys are converted
         | 
| 71 71 | 
             
              to underscore to eliminate horrible camelCasing
         | 
| 72 | 
            -
            email: tom.cocca@gmail.com, shishi | 
| 72 | 
            +
            email: tom.cocca@gmail.com, shishi@srevo.net
         | 
| 73 73 | 
             
            executables: []
         | 
| 74 74 | 
             
            extensions: []
         | 
| 75 75 | 
             
            extra_rdoc_files: []
         | 
| 76 76 | 
             
            files:
         | 
| 77 | 
            -
            - ".github/workflows/ | 
| 77 | 
            +
            - ".github/workflows/rspec.yml"
         | 
| 78 78 | 
             
            - ".gitignore"
         | 
| 79 79 | 
             
            - ".rspec"
         | 
| 80 | 
            +
            - Dockerfile
         | 
| 80 81 | 
             
            - Gemfile
         | 
| 81 82 | 
             
            - LICENSE
         | 
| 82 | 
            -
            - README. | 
| 83 | 
            +
            - README.md
         | 
| 83 84 | 
             
            - Rakefile
         | 
| 84 85 | 
             
            - lib/hashie/mash/rash.rb
         | 
| 85 86 | 
             
            - lib/rash.rb
         | 
| @@ -106,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 106 107 | 
             
                - !ruby/object:Gem::Version
         | 
| 107 108 | 
             
                  version: '0'
         | 
| 108 109 | 
             
            requirements: []
         | 
| 109 | 
            -
            rubygems_version: 3. | 
| 110 | 
            +
            rubygems_version: 3.2.3
         | 
| 110 111 | 
             
            signing_key: 
         | 
| 111 112 | 
             
            specification_version: 4
         | 
| 112 113 | 
             
            summary: simple extension to Hashie::Mash for rubyified keys
         | 
    
        data/README.rdoc
    DELETED
    
    | @@ -1,77 +0,0 @@ | |
| 1 | 
            -
            = rash
         | 
| 2 | 
            -
             | 
| 3 | 
            -
            {<img src="https://img.shields.io/gem/v/rash_alt.svg" alt="Gem Version" />}[https://rubygems.org/gems/rash_alt]
         | 
| 4 | 
            -
            {<img src="https://img.shields.io/travis/shishi/rash_alt.svg" alt="Build Status" />}[https://travis-ci.org/shishi/rash_alt]
         | 
| 5 | 
            -
             | 
| 6 | 
            -
            Rash is an extension to Hashie ( http://github.com/hashie/hashie ).
         | 
| 7 | 
            -
             | 
| 8 | 
            -
            Rash subclasses Hashie::Mash to convert all keys in the hash to underscore.
         | 
| 9 | 
            -
             | 
| 10 | 
            -
            The purpose of this is when working w/ Java (or any other apis) that return hashes (including nested) that have camelCased keys.
         | 
| 11 | 
            -
             | 
| 12 | 
            -
            You will now be able to access those keys through underscored key names (camelCase still available).
         | 
| 13 | 
            -
             | 
| 14 | 
            -
            == Installation
         | 
| 15 | 
            -
             | 
| 16 | 
            -
            Add this line to your application's Gemfile:
         | 
| 17 | 
            -
             | 
| 18 | 
            -
              gem 'rash_alt', require: 'rash'
         | 
| 19 | 
            -
             | 
| 20 | 
            -
            And then execute:
         | 
| 21 | 
            -
             | 
| 22 | 
            -
              $ bundle
         | 
| 23 | 
            -
             | 
| 24 | 
            -
            Or install it yourself as:
         | 
| 25 | 
            -
             | 
| 26 | 
            -
              $ gem install rash_alt
         | 
| 27 | 
            -
             | 
| 28 | 
            -
            == Usage
         | 
| 29 | 
            -
             | 
| 30 | 
            -
              @rash = Hashie::Mash::Rash.new({
         | 
| 31 | 
            -
                "varOne" => 1,
         | 
| 32 | 
            -
                "two" => 2,
         | 
| 33 | 
            -
                :three => 3,
         | 
| 34 | 
            -
                :varFour => 4,
         | 
| 35 | 
            -
                "fiveHumpHumps" => 5,
         | 
| 36 | 
            -
                :nested => {
         | 
| 37 | 
            -
                  "NestedOne" => "One",
         | 
| 38 | 
            -
                  :two => "two",
         | 
| 39 | 
            -
                  "nested_three" => "three"
         | 
| 40 | 
            -
                },
         | 
| 41 | 
            -
                "nestedTwo" => {
         | 
| 42 | 
            -
                  "nested_two" => 22,
         | 
| 43 | 
            -
                  :nestedThree => 23
         | 
| 44 | 
            -
                }
         | 
| 45 | 
            -
              })
         | 
| 46 | 
            -
             | 
| 47 | 
            -
              @rash.var_one                 # => 1
         | 
| 48 | 
            -
              @rash.two                     # => 2
         | 
| 49 | 
            -
              @rash.three                   # => 3
         | 
| 50 | 
            -
              @rash.var_four                # => 4
         | 
| 51 | 
            -
              @rash.five_hump_humps         # => 5
         | 
| 52 | 
            -
              @rash.nested.nested_one       # => "One"
         | 
| 53 | 
            -
              @rash.nested.two              # => "two"
         | 
| 54 | 
            -
              @rash.nested.nested_three     # => "three"
         | 
| 55 | 
            -
              @rash.nested_two.nested_two   # => 22
         | 
| 56 | 
            -
              @rash.nested_two.nested_three # => 23
         | 
| 57 | 
            -
             | 
| 58 | 
            -
            == Note on Patches/Pull Requests
         | 
| 59 | 
            -
             | 
| 60 | 
            -
            * Fork the project.
         | 
| 61 | 
            -
            * Make your feature addition or bug fix.
         | 
| 62 | 
            -
            * Add tests for it. This is important so I don't break it in a
         | 
| 63 | 
            -
              future version unintentionally.
         | 
| 64 | 
            -
            * Commit, do not mess with rakefile, version, or history.
         | 
| 65 | 
            -
              (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
         | 
| 66 | 
            -
            * Send me a pull request. Bonus points for topic branches.
         | 
| 67 | 
            -
             | 
| 68 | 
            -
            == Copyright
         | 
| 69 | 
            -
             | 
| 70 | 
            -
            * Copyright (c) 2010 Tom Cocca.
         | 
| 71 | 
            -
            * Copyright (c) 2016 Shigenobu Nishikawa.
         | 
| 72 | 
            -
             | 
| 73 | 
            -
            === Acknowledgements
         | 
| 74 | 
            -
             | 
| 75 | 
            -
            * Intridea (https://github.com/intridea) for Hashie
         | 
| 76 | 
            -
            * Mislav Marohnić (https://github.com/mislav) for contributions to Rash
         | 
| 77 | 
            -
            * Steve Agalloco (https://github.com/spagalloco) for updating Rash to use bundler, rspec 2.5, hashie 1.0 and fixing some load dependencies
         |