clean_params 0.0.6 → 0.0.7
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 +8 -8
- data/README.md +18 -2
- data/clean_params.gemspec +1 -1
- data/lib/clean_params/version.rb +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,15 +1,15 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            !binary "U0hBMQ==":
         | 
| 3 3 | 
             
              metadata.gz: !binary |-
         | 
| 4 | 
            -
                 | 
| 4 | 
            +
                ZjU2NDgwYTJkZTRlZDRhMDhlNmU3OGIyMTBiNzNjZDRkZjg3YjFmYw==
         | 
| 5 5 | 
             
              data.tar.gz: !binary |-
         | 
| 6 | 
            -
                 | 
| 6 | 
            +
                ODRiMDVmZTkwODE2YmI1YWU1YmQxM2NmZGFlM2M0NTU1MWVmOTkxMg==
         | 
| 7 7 | 
             
            SHA512:
         | 
| 8 8 | 
             
              metadata.gz: !binary |-
         | 
| 9 | 
            -
                 | 
| 10 | 
            -
                 | 
| 11 | 
            -
                 | 
| 9 | 
            +
                MGM2MTgxYjViMmVmMjc0OTdiZWY3NmVkMjUyZjMzZDRkYTg5N2EyZTYwMzVi
         | 
| 10 | 
            +
                YzlmZGMwYTYwMmIyN2Y5YjUwZWU4MGQwNDliZjk5MDRmMTg2NmVhYjFkMTRj
         | 
| 11 | 
            +
                ZjZhMWM5NjhlNzRjNDA4NzRhOTE0NzA0MGIxNTkwNDU4YmQxMzg=
         | 
| 12 12 | 
             
              data.tar.gz: !binary |-
         | 
| 13 | 
            -
                 | 
| 14 | 
            -
                 | 
| 15 | 
            -
                 | 
| 13 | 
            +
                MWNmYmYxZmY4YzRjOTI0ODU4Mjk3MTkwNjY3NzliOGMyZjc3ZmY1NjczZTZm
         | 
| 14 | 
            +
                OTY2MTdjYTBmMjYzYjY3M2MzNTY3MzkzNjVhNTVhOTcxNjY1ZTdlMjI1OTQ2
         | 
| 15 | 
            +
                NDNhNDI2ZWIyMjVmZGE1ZDE5Y2IxNzY5OTMxZWVmYWE4NTdmZTA=
         | 
    
        data/README.md
    CHANGED
    
    | @@ -17,9 +17,25 @@ Run the generator to create the initializer file. You can specify your parsing r | |
| 17 17 |  | 
| 18 18 | 
             
            ## Usage
         | 
| 19 19 |  | 
| 20 | 
            +
            Example initializer file -
         | 
| 21 | 
            +
             | 
| 22 | 
            +
            	CleanParams.configure do |config|
         | 
| 23 | 
            +
            	  config.params = {
         | 
| 24 | 
            +
            	    # Customize your params here
         | 
| 25 | 
            +
            	    'key' => ['key', 'Key']
         | 
| 26 | 
            +
            	  }
         | 
| 27 | 
            +
            	end
         | 
| 28 | 
            +
            	
         | 
| 29 | 
            +
            Example params hash -
         | 
| 30 | 
            +
             | 
| 31 | 
            +
            	params = {"utf8"=>"✓", "authenticity_token"=>"123", "Key" => "key", "token"=>"323344", "customer_detail"=>{"caller_id"=>"123", "customer_name"=>"XYZ"}}
         | 
| 32 | 
            +
            	
         | 
| 33 | 
            +
            And goodies -
         | 
| 34 | 
            +
             | 
| 20 35 | 
             
            	params = CleanParams.clean(params) # params - rails params hash
         | 
| 21 | 
            -
            	params.key # =>  | 
| 22 | 
            -
            	params.token # =>  | 
| 36 | 
            +
            	params.key # => key
         | 
| 37 | 
            +
            	params.token # => 323344
         | 
| 38 | 
            +
            	params.caller_id # => 123
         | 
| 23 39 |  | 
| 24 40 | 
             
            Or you can include it inside the filter in ApplicationController and use the object inside any controller.
         | 
| 25 41 |  | 
    
        data/clean_params.gemspec
    CHANGED
    
    | @@ -8,7 +8,7 @@ Gem::Specification.new do |spec| | |
| 8 8 | 
             
              spec.version       = CleanParams::VERSION
         | 
| 9 9 | 
             
              spec.authors       = ["Yogesh Pendharkar"]
         | 
| 10 10 | 
             
              spec.email         = ["yogesh.pendharkar@gmail.com"]
         | 
| 11 | 
            -
              spec.description   = %q{ | 
| 11 | 
            +
              spec.description   = %q{A better way to operate on Rails params.}
         | 
| 12 12 | 
             
              spec.summary       = %q{Clean your params hash with clean_params}
         | 
| 13 13 | 
             
              spec.homepage      = "https://github.com/ypendharkar/clean_params"
         | 
| 14 14 | 
             
              spec.license       = "MIT"
         | 
    
        data/lib/clean_params/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: clean_params
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.7
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Yogesh Pendharkar
         | 
| @@ -52,7 +52,7 @@ dependencies: | |
| 52 52 | 
             
                - - ! '>='
         | 
| 53 53 | 
             
                  - !ruby/object:Gem::Version
         | 
| 54 54 | 
             
                    version: '0'
         | 
| 55 | 
            -
            description:  | 
| 55 | 
            +
            description: A better way to operate on Rails params.
         | 
| 56 56 | 
             
            email:
         | 
| 57 57 | 
             
            - yogesh.pendharkar@gmail.com
         | 
| 58 58 | 
             
            executables: []
         |