encoding-kawai 0.3 → 0.4
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/encoding-kawai.gemspec +3 -3
- data/lib/encoding-kawai/object.rb +2 -2
- data/spec/encoding-kawai_spec.rb +3 -2
- metadata +14 -26
    
        checksums.yaml
    ADDED
    
    | @@ -0,0 +1,7 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            SHA1:
         | 
| 3 | 
            +
              metadata.gz: 1add93496f5b308b837daaf291c675d2e47d7303
         | 
| 4 | 
            +
              data.tar.gz: 5ad2a432535740ade578b064dae09d185da6727a
         | 
| 5 | 
            +
            SHA512:
         | 
| 6 | 
            +
              metadata.gz: f46bd703dea63a0404d5413e223b5e88ecfeaa6e43bfcd8680a8cf972d4b5e333f9b1be92ca2f3d91f35e3b8c8cd5180aba79cdd42189a5fa968a06e2c75be08
         | 
| 7 | 
            +
              data.tar.gz: 3b33ac1762f5de38c1fc4f29f8b457e24b496d450309296385ebf906e0be720d8a5840e62d291bd6189aea1e9c5f1b61bfba688cc9733617ea4d0fc0d6eb43db
         | 
    
        data/encoding-kawai.gemspec
    CHANGED
    
    | @@ -2,7 +2,7 @@ | |
| 2 2 |  | 
| 3 3 | 
             
            Gem::Specification.new do |s|
         | 
| 4 4 | 
             
              s.name = %q{encoding-kawai}
         | 
| 5 | 
            -
              s.version = "0. | 
| 5 | 
            +
              s.version = "0.4"
         | 
| 6 6 |  | 
| 7 7 | 
             
              s.authors = ["Makarchev K"]
         | 
| 8 8 |  | 
| @@ -17,7 +17,7 @@ Gem::Specification.new do |s| | |
| 17 17 | 
             
              s.executables   = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
         | 
| 18 18 | 
             
              s.require_paths = ["lib"]
         | 
| 19 19 |  | 
| 20 | 
            -
              s.add_development_dependency "rspec"
         | 
| 20 | 
            +
              s.add_development_dependency "rspec", '<3'
         | 
| 21 21 | 
             
              s.add_development_dependency "rake"
         | 
| 22 22 |  | 
| 23 | 
            -
            end
         | 
| 23 | 
            +
            end
         | 
| @@ -32,13 +32,13 @@ if RUBY_VERSION >= '1.9' | |
| 32 32 | 
             
              class Hash
         | 
| 33 33 | 
             
                def utf8!
         | 
| 34 34 | 
             
                  {}.tap{|h| 
         | 
| 35 | 
            -
                    keys.each { |k| h[k.frozen? ? k.dup.utf8! : k.utf8!] = self[k].utf8! }
         | 
| 35 | 
            +
                    keys.each { |k| h[(k.frozen? && !k.is_a?(Symbol)) ? k.dup.utf8! : k.utf8!] = self[k].utf8! }
         | 
| 36 36 | 
             
                  }
         | 
| 37 37 | 
             
                end
         | 
| 38 38 |  | 
| 39 39 | 
             
                def binary!
         | 
| 40 40 | 
             
                  {}.tap{|h| 
         | 
| 41 | 
            -
                    keys.each { |k| h[k.frozen? ? k.dup.binary! : k.binary!] = self[k].binary! }
         | 
| 41 | 
            +
                    keys.each { |k| h[(k.frozen? && !k.is_a?(Symbol)) ? k.dup.binary! : k.binary!] = self[k].binary! }
         | 
| 42 42 | 
             
                  }
         | 
| 43 43 | 
             
                end
         | 
| 44 44 | 
             
              end
         | 
    
        data/spec/encoding-kawai_spec.rb
    CHANGED
    
    | @@ -2,7 +2,7 @@ | |
| 2 2 | 
             
            require File.dirname(__FILE__) + '/spec_helper'
         | 
| 3 3 |  | 
| 4 4 | 
             
            OBJS = ["bla", 'бла', ['bla', 'бла'], nil]
         | 
| 5 | 
            -
            H = {:bla => 'bla', 'бла' => 1}
         | 
| 5 | 
            +
            H = {:bla => 'bla', 'бла' => 1, :url => nil, :x => [:a => "идф", :b => true]}
         | 
| 6 6 |  | 
| 7 7 | 
             
            describe "encoding-kawai" do
         | 
| 8 8 |  | 
| @@ -31,7 +31,8 @@ describe "encoding-kawai" do | |
| 31 31 |  | 
| 32 32 | 
             
                  it "should word for each object to code with #{enc} on obj: #{H.inspect}" do
         | 
| 33 33 | 
             
                    str = enc == 'utf8' ? "бла".force_encoding('utf-8') : "бла".force_encoding('binary')
         | 
| 34 | 
            -
                     | 
| 34 | 
            +
                    str2 = enc == 'utf8' ? "идф".force_encoding('utf-8') : "идф".force_encoding('binary')
         | 
| 35 | 
            +
                    H.send("#{enc}!").should == {:bla => 'bla', str => 1, :url => nil, :x => [:a => str2, :b => true]}
         | 
| 35 36 | 
             
                  end              
         | 
| 36 37 |  | 
| 37 38 | 
             
                  it "should set encoding" do
         | 
    
        metadata
    CHANGED
    
    | @@ -1,46 +1,41 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: encoding-kawai
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: '0. | 
| 5 | 
            -
              prerelease: 
         | 
| 4 | 
            +
              version: '0.4'
         | 
| 6 5 | 
             
            platform: ruby
         | 
| 7 6 | 
             
            authors:
         | 
| 8 7 | 
             
            - Makarchev K
         | 
| 9 8 | 
             
            autorequire: 
         | 
| 10 9 | 
             
            bindir: bin
         | 
| 11 10 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date:  | 
| 11 | 
            +
            date: 2014-10-10 00:00:00.000000000 Z
         | 
| 13 12 | 
             
            dependencies:
         | 
| 14 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 14 | 
             
              name: rspec
         | 
| 16 15 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 17 | 
            -
                none: false
         | 
| 18 16 | 
             
                requirements:
         | 
| 19 | 
            -
                - -  | 
| 17 | 
            +
                - - "<"
         | 
| 20 18 | 
             
                  - !ruby/object:Gem::Version
         | 
| 21 | 
            -
                    version: ' | 
| 19 | 
            +
                    version: '3'
         | 
| 22 20 | 
             
              type: :development
         | 
| 23 21 | 
             
              prerelease: false
         | 
| 24 22 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 25 | 
            -
                none: false
         | 
| 26 23 | 
             
                requirements:
         | 
| 27 | 
            -
                - -  | 
| 24 | 
            +
                - - "<"
         | 
| 28 25 | 
             
                  - !ruby/object:Gem::Version
         | 
| 29 | 
            -
                    version: ' | 
| 26 | 
            +
                    version: '3'
         | 
| 30 27 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 31 28 | 
             
              name: rake
         | 
| 32 29 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 33 | 
            -
                none: false
         | 
| 34 30 | 
             
                requirements:
         | 
| 35 | 
            -
                - -  | 
| 31 | 
            +
                - - ">="
         | 
| 36 32 | 
             
                  - !ruby/object:Gem::Version
         | 
| 37 33 | 
             
                    version: '0'
         | 
| 38 34 | 
             
              type: :development
         | 
| 39 35 | 
             
              prerelease: false
         | 
| 40 36 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 41 | 
            -
                none: false
         | 
| 42 37 | 
             
                requirements:
         | 
| 43 | 
            -
                - -  | 
| 38 | 
            +
                - - ">="
         | 
| 44 39 | 
             
                  - !ruby/object:Gem::Version
         | 
| 45 40 | 
             
                    version: '0'
         | 
| 46 41 | 
             
            description: EncodingKawai - little sintax sugar for ruby force_encoding, also working
         | 
| @@ -50,7 +45,7 @@ executables: [] | |
| 50 45 | 
             
            extensions: []
         | 
| 51 46 | 
             
            extra_rdoc_files: []
         | 
| 52 47 | 
             
            files:
         | 
| 53 | 
            -
            - .gitignore
         | 
| 48 | 
            +
            - ".gitignore"
         | 
| 54 49 | 
             
            - Gemfile
         | 
| 55 50 | 
             
            - LICENSE
         | 
| 56 51 | 
             
            - README.md
         | 
| @@ -62,33 +57,26 @@ files: | |
| 62 57 | 
             
            - spec/spec_helper.rb
         | 
| 63 58 | 
             
            homepage: 
         | 
| 64 59 | 
             
            licenses: []
         | 
| 60 | 
            +
            metadata: {}
         | 
| 65 61 | 
             
            post_install_message: 
         | 
| 66 62 | 
             
            rdoc_options: []
         | 
| 67 63 | 
             
            require_paths:
         | 
| 68 64 | 
             
            - lib
         | 
| 69 65 | 
             
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 70 | 
            -
              none: false
         | 
| 71 66 | 
             
              requirements:
         | 
| 72 | 
            -
              - -  | 
| 67 | 
            +
              - - ">="
         | 
| 73 68 | 
             
                - !ruby/object:Gem::Version
         | 
| 74 69 | 
             
                  version: '0'
         | 
| 75 | 
            -
                  segments:
         | 
| 76 | 
            -
                  - 0
         | 
| 77 | 
            -
                  hash: -951121923
         | 
| 78 70 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 79 | 
            -
              none: false
         | 
| 80 71 | 
             
              requirements:
         | 
| 81 | 
            -
              - -  | 
| 72 | 
            +
              - - ">="
         | 
| 82 73 | 
             
                - !ruby/object:Gem::Version
         | 
| 83 74 | 
             
                  version: '0'
         | 
| 84 | 
            -
                  segments:
         | 
| 85 | 
            -
                  - 0
         | 
| 86 | 
            -
                  hash: -951121923
         | 
| 87 75 | 
             
            requirements: []
         | 
| 88 76 | 
             
            rubyforge_project: 
         | 
| 89 | 
            -
            rubygems_version:  | 
| 77 | 
            +
            rubygems_version: 2.2.2
         | 
| 90 78 | 
             
            signing_key: 
         | 
| 91 | 
            -
            specification_version:  | 
| 79 | 
            +
            specification_version: 4
         | 
| 92 80 | 
             
            summary: Encodingkawai - little sintax sugar for ruby force_encoding, also working
         | 
| 93 81 | 
             
              on 1.8.7.
         | 
| 94 82 | 
             
            test_files: []
         |