use 1.3.3 → 1.4.0
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 +5 -5
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGES +8 -0
- data/MANIFEST +1 -0
- data/README +39 -51
- data/Rakefile +3 -6
- data/certs/djberg96_pub.pem +26 -0
- data/lib/use.rb +23 -21
- data/test/test_use.rb +101 -100
- data/use.gemspec +27 -18
- metadata +56 -20
- metadata.gz.sig +0 -0
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 | 
            -
             | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 2 | 
            +
            SHA256:
         | 
| 3 | 
            +
              metadata.gz: 1d50a37c0e3b6cbfe5e77016d5793c72ea77dc750247eefbe6884ccf49b4ab7a
         | 
| 4 | 
            +
              data.tar.gz: d00189cc5ccab9f283682e7d387eb3df27ce2e2dd05c2fd97d10794801223589
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 565131064b4d05ccd920be0f82a8b5b25e36167680783b183f57264ed3e0a86cc22420ab8b0aa2e3620eb32c395582dadd4fe8402aa33f9b7d34c8927228e6e8
         | 
| 7 | 
            +
              data.tar.gz: 76442a405e520607d37d9ac2d7d0a3d514d472dc261a1c8d4467c2bdf05c520fdd505e249d14e025c77abdf3f2ea57f00adb98c03f31fa8af47ec759e2af9b64
         | 
    
        checksums.yaml.gz.sig
    ADDED
    
    | Binary file | 
    
        data.tar.gz.sig
    ADDED
    
    | Binary file | 
    
        data/CHANGES
    CHANGED
    
    | @@ -1,3 +1,11 @@ | |
| 1 | 
            +
            == 1.4.0 - 4-Feb-2019
         | 
| 2 | 
            +
            * Change the license to Apache 2.0.
         | 
| 3 | 
            +
            * The USE_VERSION constant is now frozen.
         | 
| 4 | 
            +
            * Updated the structured_warnings dependency, and apply related changes.
         | 
| 5 | 
            +
            * Updated the gemspec license and depedencies, and added metadata.
         | 
| 6 | 
            +
            * Rakefile now assumes Rubygems 2 or later.
         | 
| 7 | 
            +
            * This gem is now signed.
         | 
| 8 | 
            +
             | 
| 1 9 | 
             
            == 1.3.3 - 12-Oct-2014
         | 
| 2 10 | 
             
            * Rakefile, gemspec and README updates.
         | 
| 3 11 | 
             
            * Fixed an unused variable warning.
         | 
    
        data/MANIFEST
    CHANGED
    
    
    
        data/README
    CHANGED
    
    | @@ -1,60 +1,53 @@ | |
| 1 1 | 
             
            == Description
         | 
| 2 | 
            -
             | 
| 3 | 
            -
             | 
| 2 | 
            +
              The 'use' library allows you to selectively mixin methods from a given
         | 
| 3 | 
            +
              module and alias them on the fly if desired.
         | 
| 4 4 |  | 
| 5 5 | 
             
            == Prerequisites
         | 
| 6 | 
            -
             | 
| 7 | 
            -
               structured_warnings 0.1.1 or later
         | 
| 6 | 
            +
              structured_warnings 0.3.0 or later
         | 
| 8 7 |  | 
| 9 8 | 
             
            == Installation
         | 
| 10 | 
            -
             | 
| 11 | 
            -
               rake test (optional)
         | 
| 12 | 
            -
               rake install
         | 
| 13 | 
            -
               
         | 
| 14 | 
            -
            === Gem install
         | 
| 15 | 
            -
               rake test (optional)
         | 
| 16 | 
            -
               rake install_gem
         | 
| 9 | 
            +
              gem install use
         | 
| 17 10 |  | 
| 18 11 | 
             
            == Synopsis
         | 
| 19 | 
            -
             | 
| 12 | 
            +
              require 'use'
         | 
| 20 13 |  | 
| 21 | 
            -
             | 
| 22 | 
            -
             | 
| 23 | 
            -
             | 
| 24 | 
            -
             | 
| 25 | 
            -
             | 
| 26 | 
            -
             | 
| 27 | 
            -
             | 
| 28 | 
            -
             | 
| 14 | 
            +
              module Foo
         | 
| 15 | 
            +
                def bar
         | 
| 16 | 
            +
                  puts "hello"
         | 
| 17 | 
            +
                end
         | 
| 18 | 
            +
                def baz
         | 
| 19 | 
            +
                  puts "world"
         | 
| 20 | 
            +
                end
         | 
| 21 | 
            +
              end
         | 
| 29 22 |  | 
| 30 | 
            -
             | 
| 31 | 
            -
             | 
| 32 | 
            -
             | 
| 33 | 
            -
             | 
| 34 | 
            -
             | 
| 35 | 
            -
             | 
| 36 | 
            -
             | 
| 37 | 
            -
             | 
| 23 | 
            +
              module Test
         | 
| 24 | 
            +
                def bar
         | 
| 25 | 
            +
                  puts "goodbye"
         | 
| 26 | 
            +
                end
         | 
| 27 | 
            +
                def blah
         | 
| 28 | 
            +
                  puts "new york"
         | 
| 29 | 
            +
                end
         | 
| 30 | 
            +
              end
         | 
| 38 31 |  | 
| 39 | 
            -
             | 
| 40 | 
            -
             | 
| 41 | 
            -
             | 
| 42 | 
            -
             | 
| 32 | 
            +
              class Zap
         | 
| 33 | 
            +
                use Foo, :bar
         | 
| 34 | 
            +
                use Test, :blah
         | 
| 35 | 
            +
              end
         | 
| 43 36 |  | 
| 44 | 
            -
             | 
| 37 | 
            +
              z = Zap.new
         | 
| 45 38 |  | 
| 46 | 
            -
             | 
| 47 | 
            -
             | 
| 48 | 
            -
             | 
| 39 | 
            +
              z.bar  # => "hello"
         | 
| 40 | 
            +
              z.blah # => "new york"
         | 
| 41 | 
            +
              z.baz  # => NoMethodError
         | 
| 49 42 |  | 
| 50 | 
            -
             | 
| 51 | 
            -
             | 
| 52 | 
            -
             | 
| 53 | 
            -
             | 
| 43 | 
            +
              # Using the new keywords
         | 
| 44 | 
            +
              class MyKlass
         | 
| 45 | 
            +
                use Foo, :alias => {:bar => :test}
         | 
| 46 | 
            +
              end
         | 
| 54 47 |  | 
| 55 | 
            -
             | 
| 56 | 
            -
             | 
| 57 | 
            -
             | 
| 48 | 
            +
              m = MyKlass.new
         | 
| 49 | 
            +
              m.test # => "hello"
         | 
| 50 | 
            +
              m.bar  # => NoMethodError
         | 
| 58 51 |  | 
| 59 52 | 
             
            == Constants
         | 
| 60 53 | 
             
            USE_VERSION
         | 
| @@ -75,18 +68,13 @@ USE_VERSION | |
| 75 68 | 
             
               bug in Ruby 1.9.x and can be ignored.
         | 
| 76 69 |  | 
| 77 70 | 
             
               If you find any bugs please log them on the project page at
         | 
| 78 | 
            -
                | 
| 71 | 
            +
               https://github.com/djberg96/use
         | 
| 79 72 |  | 
| 80 | 
            -
            == Questions?
         | 
| 81 | 
            -
               Please post your comment or question on one of the forums on the project
         | 
| 82 | 
            -
               page at http://www.rubyforge.org/projects/shards.  Just click the 'Forums'
         | 
| 83 | 
            -
               link.
         | 
| 84 | 
            -
             | 
| 85 73 | 
             
            == License
         | 
| 86 | 
            -
                | 
| 74 | 
            +
               Apache-2.0
         | 
| 87 75 |  | 
| 88 76 | 
             
            == Copyright
         | 
| 89 | 
            -
               (C) 2005- | 
| 77 | 
            +
               (C) 2005-2019, Daniel J. Berger
         | 
| 90 78 | 
             
               All Rights Reserved
         | 
| 91 79 |  | 
| 92 80 | 
             
            == Author
         | 
    
        data/Rakefile
    CHANGED
    
    | @@ -7,13 +7,10 @@ CLEAN.include("**/*.gem", "**/*.rbc", "**/*.rbx") | |
| 7 7 | 
             
            namespace :gem do
         | 
| 8 8 | 
             
              desc "Create the use gem"
         | 
| 9 9 | 
             
              task :create => [:clean] do
         | 
| 10 | 
            +
                require 'rubygems/package'
         | 
| 10 11 | 
             
                spec = eval(IO.read('use.gemspec'))
         | 
| 11 | 
            -
                 | 
| 12 | 
            -
             | 
| 13 | 
            -
                else
         | 
| 14 | 
            -
                  require 'rubygems/package'
         | 
| 15 | 
            -
                  Gem::Package.build(spec)
         | 
| 16 | 
            -
                end
         | 
| 12 | 
            +
                spec.signing_key = File.join(Dir.home, '.ssh', 'gem-private_key.pem')
         | 
| 13 | 
            +
                Gem::Package.build(spec, true)
         | 
| 17 14 | 
             
              end
         | 
| 18 15 |  | 
| 19 16 | 
             
              desc "Install the use gem"
         | 
| @@ -0,0 +1,26 @@ | |
| 1 | 
            +
            -----BEGIN CERTIFICATE-----
         | 
| 2 | 
            +
            MIIEcDCCAtigAwIBAgIBATANBgkqhkiG9w0BAQsFADA/MREwDwYDVQQDDAhkamJl
         | 
| 3 | 
            +
            cmc5NjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
         | 
| 4 | 
            +
            MB4XDTE4MDMxODE1MjIwN1oXDTI4MDMxNTE1MjIwN1owPzERMA8GA1UEAwwIZGpi
         | 
| 5 | 
            +
            ZXJnOTYxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
         | 
| 6 | 
            +
            bTCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBALgfaroVM6CI06cxr0/h
         | 
| 7 | 
            +
            A+j+pc8fgpRgBVmHFaFunq28GPC3IvW7Nvc3Y8SnAW7pP1EQIbhlwRIaQzJ93/yj
         | 
| 8 | 
            +
            u95KpkP7tA9erypnV7dpzBkzNlX14ACaFD/6pHoXoe2ltBxk3CCyyzx70mTqJpph
         | 
| 9 | 
            +
            75IB03ni9a8yqn8pmse+s83bFJOAqddSj009sGPcQO+QOWiNxqYv1n5EHcvj2ebO
         | 
| 10 | 
            +
            6hN7YTmhx7aSia4qL/quc4DlIaGMWoAhvML7u1fmo53CYxkKskfN8MOecq2vfEmL
         | 
| 11 | 
            +
            iLu+SsVVEAufMDDFMXMJlvDsviolUSGMSNRTujkyCcJoXKYYxZSNtIiyd9etI0X3
         | 
| 12 | 
            +
            ctu0uhrFyrMZXCedutvXNjUolD5r9KGBFSWH1R9u2I3n3SAyFF2yzv/7idQHLJJq
         | 
| 13 | 
            +
            74BMnx0FIq6fCpu5slAipvxZ3ZkZpEXZFr3cIBtO1gFvQWW7E/Y3ijliWJS1GQFq
         | 
| 14 | 
            +
            058qERadHGu1yu1dojmFRo6W2KZvY9al2yIlbkpDrD5MYQIDAQABo3cwdTAJBgNV
         | 
| 15 | 
            +
            HRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUFZsMapgzJimzsbaBG2Tm8j5e
         | 
| 16 | 
            +
            AzgwHQYDVR0RBBYwFIESZGpiZXJnOTZAZ21haWwuY29tMB0GA1UdEgQWMBSBEmRq
         | 
| 17 | 
            +
            YmVyZzk2QGdtYWlsLmNvbTANBgkqhkiG9w0BAQsFAAOCAYEAW2tnYixXQtKxgGXq
         | 
| 18 | 
            +
            /3iSWG2bLwvxS4go3srO+aRXZHrFUMlJ5W0mCxl03aazxxKTsVVpZD8QZxvK91OQ
         | 
| 19 | 
            +
            h9zr9JBYqCLcCVbr8SkmYCi/laxIZxsNE5YI8cC8vvlLI7AMgSfPSnn/Epq1GjGY
         | 
| 20 | 
            +
            6L1iRcEDtanGCIvjqlCXO9+BmsnCfEVehqZkQHeYczA03tpOWb6pon2wzvMKSsKH
         | 
| 21 | 
            +
            ks0ApVdstSLz1kzzAqem/uHdG9FyXdbTAwH1G4ZPv69sQAFAOCgAqYmdnzedsQtE
         | 
| 22 | 
            +
            1LQfaQrx0twO+CZJPcRLEESjq8ScQxWRRkfuh2VeR7cEU7L7KqT10mtUwrvw7APf
         | 
| 23 | 
            +
            DYoeCY9KyjIBjQXfbj2ke5u1hZj94Fsq9FfbEQg8ygCgwThnmkTrrKEiMSs3alYR
         | 
| 24 | 
            +
            ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
         | 
| 25 | 
            +
            WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
         | 
| 26 | 
            +
            -----END CERTIFICATE-----
         | 
    
        data/lib/use.rb
    CHANGED
    
    | @@ -2,13 +2,12 @@ require 'structured_warnings' | |
| 2 2 |  | 
| 3 3 | 
             
            unless defined? MethodRedefinedWarning
         | 
| 4 4 | 
             
              # Warning raised in $VERBOSE mode if a method is shadowed.
         | 
| 5 | 
            -
              class MethodRedefinedWarning <  | 
| 6 | 
            -
              end
         | 
| 5 | 
            +
              class MethodRedefinedWarning < StructuredWarnings::Base; end
         | 
| 7 6 | 
             
            end
         | 
| 8 7 |  | 
| 9 8 | 
             
            class Class
         | 
| 10 9 | 
             
              # The version of the 'use' library
         | 
| 11 | 
            -
              USE_VERSION = '1. | 
| 10 | 
            +
              USE_VERSION = '1.4.0'.freeze
         | 
| 12 11 |  | 
| 13 12 | 
             
              # Allows you to include mixins in a fine grained manner. Instead of
         | 
| 14 13 | 
             
              # including all methods from a given module, you can can instead mixin
         | 
| @@ -19,32 +18,35 @@ class Class | |
| 19 18 | 
             
              #
         | 
| 20 19 | 
             
              #  # Defines a 'bar' and 'baz' method
         | 
| 21 20 | 
             
              #  module Alpha
         | 
| 22 | 
            -
              # | 
| 23 | 
            -
              # | 
| 24 | 
            -
              # | 
| 25 | 
            -
              # | 
| 26 | 
            -
              # | 
| 27 | 
            -
              # | 
| 21 | 
            +
              #    def bar
         | 
| 22 | 
            +
              #      puts 'hello'
         | 
| 23 | 
            +
              #    end
         | 
| 24 | 
            +
              #
         | 
| 25 | 
            +
              #    def baz
         | 
| 26 | 
            +
              #      puts 'world'
         | 
| 27 | 
            +
              #    end
         | 
| 28 28 | 
             
              #  end
         | 
| 29 29 | 
             
              #
         | 
| 30 30 | 
             
              #  # Defines a 'bar', 'blah', and 'zap' methods
         | 
| 31 31 | 
             
              #  module Beta
         | 
| 32 | 
            -
              # | 
| 33 | 
            -
              # | 
| 34 | 
            -
              # | 
| 35 | 
            -
              # | 
| 36 | 
            -
              # | 
| 37 | 
            -
              # | 
| 38 | 
            -
              # | 
| 39 | 
            -
              # | 
| 40 | 
            -
              # | 
| 32 | 
            +
              #    def bar
         | 
| 33 | 
            +
              #      puts 'goodbye'
         | 
| 34 | 
            +
              #    end
         | 
| 35 | 
            +
              #
         | 
| 36 | 
            +
              #    def blah
         | 
| 37 | 
            +
              #      puts 'new york'
         | 
| 38 | 
            +
              #    end
         | 
| 39 | 
            +
              #
         | 
| 40 | 
            +
              #    def zap
         | 
| 41 | 
            +
              #      puts 'zap'
         | 
| 42 | 
            +
              #    end
         | 
| 41 43 | 
             
              #  end
         | 
| 42 44 | 
             
              #
         | 
| 43 45 | 
             
              #  # From the Alpha module, only mixin the 'bar' method. From the Beta
         | 
| 44 46 | 
             
              #  # module exclude the 'bar' and 'zap' methods.
         | 
| 45 47 | 
             
              #  class Zap
         | 
| 46 | 
            -
              # | 
| 47 | 
            -
              # | 
| 48 | 
            +
              #    use Alpha, :bar
         | 
| 49 | 
            +
              #    use Beta, :exclude => [:bar, :zap]
         | 
| 48 50 | 
             
              #  end
         | 
| 49 51 | 
             
              #
         | 
| 50 52 | 
             
              #  z = Zap.new
         | 
| @@ -56,7 +58,7 @@ class Class | |
| 56 58 | 
             
              #
         | 
| 57 59 | 
             
              #  # Alias a method on the fly
         | 
| 58 60 | 
             
              #  class MyKlass
         | 
| 59 | 
            -
              # | 
| 61 | 
            +
              #    use Alpha, :alias => {:bar, :test}
         | 
| 60 62 | 
             
              #  end
         | 
| 61 63 | 
             
              #
         | 
| 62 64 | 
             
              #  m = MyKlass.new
         | 
    
        data/test/test_use.rb
    CHANGED
    
    | @@ -10,104 +10,105 @@ require 'sample_data' | |
| 10 10 | 
             
            require 'test/unit'
         | 
| 11 11 |  | 
| 12 12 | 
             
            class TC_Use < Test::Unit::TestCase
         | 
| 13 | 
            -
             | 
| 14 | 
            -
             | 
| 15 | 
            -
             | 
| 16 | 
            -
             | 
| 17 | 
            -
             | 
| 18 | 
            -
             | 
| 19 | 
            -
             | 
| 20 | 
            -
             | 
| 21 | 
            -
             | 
| 22 | 
            -
             | 
| 23 | 
            -
             | 
| 24 | 
            -
             | 
| 25 | 
            -
             | 
| 26 | 
            -
             | 
| 27 | 
            -
             | 
| 28 | 
            -
             | 
| 29 | 
            -
             | 
| 30 | 
            -
             | 
| 31 | 
            -
             | 
| 32 | 
            -
             | 
| 33 | 
            -
             | 
| 34 | 
            -
             | 
| 35 | 
            -
             | 
| 36 | 
            -
             | 
| 37 | 
            -
             | 
| 38 | 
            -
             | 
| 39 | 
            -
             | 
| 40 | 
            -
             | 
| 41 | 
            -
             | 
| 42 | 
            -
             | 
| 43 | 
            -
             | 
| 44 | 
            -
             | 
| 45 | 
            -
             | 
| 46 | 
            -
             | 
| 47 | 
            -
             | 
| 48 | 
            -
             | 
| 49 | 
            -
             | 
| 50 | 
            -
             | 
| 51 | 
            -
             | 
| 52 | 
            -
             | 
| 53 | 
            -
             | 
| 54 | 
            -
             | 
| 55 | 
            -
             | 
| 56 | 
            -
             | 
| 57 | 
            -
             | 
| 58 | 
            -
             | 
| 59 | 
            -
             | 
| 60 | 
            -
             | 
| 61 | 
            -
             | 
| 62 | 
            -
             | 
| 63 | 
            -
             | 
| 64 | 
            -
             | 
| 65 | 
            -
             | 
| 66 | 
            -
             | 
| 67 | 
            -
             | 
| 68 | 
            -
             | 
| 69 | 
            -
             | 
| 70 | 
            -
             | 
| 71 | 
            -
             | 
| 72 | 
            -
             | 
| 73 | 
            -
             | 
| 74 | 
            -
             | 
| 75 | 
            -
             | 
| 76 | 
            -
             | 
| 77 | 
            -
             | 
| 78 | 
            -
             | 
| 79 | 
            -
             | 
| 80 | 
            -
             | 
| 81 | 
            -
             | 
| 82 | 
            -
             | 
| 83 | 
            -
             | 
| 84 | 
            -
             | 
| 85 | 
            -
             | 
| 86 | 
            -
             | 
| 87 | 
            -
             | 
| 88 | 
            -
             | 
| 89 | 
            -
             | 
| 90 | 
            -
             | 
| 91 | 
            -
             | 
| 92 | 
            -
             | 
| 93 | 
            -
             | 
| 94 | 
            -
             | 
| 95 | 
            -
             | 
| 96 | 
            -
             | 
| 97 | 
            -
             | 
| 98 | 
            -
             | 
| 99 | 
            -
             | 
| 100 | 
            -
             | 
| 101 | 
            -
             | 
| 102 | 
            -
             | 
| 103 | 
            -
             | 
| 104 | 
            -
             | 
| 105 | 
            -
             | 
| 106 | 
            -
             | 
| 107 | 
            -
             | 
| 108 | 
            -
             | 
| 109 | 
            -
             | 
| 110 | 
            -
             | 
| 111 | 
            -
             | 
| 112 | 
            -
             | 
| 13 | 
            +
              def setup
         | 
| 14 | 
            +
                @a = ClassA.new
         | 
| 15 | 
            +
                @b = ClassB.new
         | 
| 16 | 
            +
                @c = ClassC.new
         | 
| 17 | 
            +
                @d = ClassD.new
         | 
| 18 | 
            +
                @e = ClassE.new
         | 
| 19 | 
            +
              end
         | 
| 20 | 
            +
             | 
| 21 | 
            +
              # Convert symbols to strings for 1.9.x
         | 
| 22 | 
            +
              def assert_methods(array, methods)
         | 
| 23 | 
            +
                methods = methods.map{ |m| m.to_s }
         | 
| 24 | 
            +
                assert_equal(array, methods)
         | 
| 25 | 
            +
              end
         | 
| 26 | 
            +
             | 
| 27 | 
            +
              def test_version
         | 
| 28 | 
            +
                assert_equal('1.4.0', Class::USE_VERSION)
         | 
| 29 | 
            +
                assert_true(Class::USE_VERSION.frozen?)
         | 
| 30 | 
            +
              end
         | 
| 31 | 
            +
             | 
| 32 | 
            +
              def test_mod_a_methods
         | 
| 33 | 
            +
                assert_methods(['meth_a', 'meth_b', 'meth_c'], ModA.instance_methods.sort)
         | 
| 34 | 
            +
              end
         | 
| 35 | 
            +
             | 
| 36 | 
            +
              def test_mod_b_methods
         | 
| 37 | 
            +
                assert_methods(['meth_a', 'meth_b', 'meth_c'], ModB.instance_methods.sort)
         | 
| 38 | 
            +
              end
         | 
| 39 | 
            +
             | 
| 40 | 
            +
              def test_mod_c_methods
         | 
| 41 | 
            +
                assert_methods(['meth_x', 'meth_y', 'meth_z'], ModC.instance_methods.sort)
         | 
| 42 | 
            +
              end
         | 
| 43 | 
            +
             | 
| 44 | 
            +
              def test_mod_d_methods
         | 
| 45 | 
            +
                assert_methods(['meth_a', 'meth_b'], ModD.instance_methods.sort)
         | 
| 46 | 
            +
              end
         | 
| 47 | 
            +
             | 
| 48 | 
            +
              def test_class_a_methods
         | 
| 49 | 
            +
                assert_respond_to(@a, :meth_a)
         | 
| 50 | 
            +
                assert_equal('ModA#meth_a', @a.meth_a)
         | 
| 51 | 
            +
              end
         | 
| 52 | 
            +
             | 
| 53 | 
            +
              def test_class_a_expected_errors
         | 
| 54 | 
            +
                assert_raise(NoMethodError){ @a.meth_b }
         | 
| 55 | 
            +
                assert_raise(NoMethodError){ @a.meth_c }
         | 
| 56 | 
            +
              end
         | 
| 57 | 
            +
             | 
| 58 | 
            +
              def test_class_b_methods
         | 
| 59 | 
            +
                assert_respond_to(@b, :meth_c)
         | 
| 60 | 
            +
                assert_respond_to(@b, :meth_z)
         | 
| 61 | 
            +
                assert_equal('ModA#meth_c', @b.meth_c)
         | 
| 62 | 
            +
                assert_equal('ModB#meth_b', @b.meth_z)
         | 
| 63 | 
            +
              end
         | 
| 64 | 
            +
             | 
| 65 | 
            +
              def test_class_b_expected_errors
         | 
| 66 | 
            +
                assert_raise(NoMethodError){ @b.meth_a }
         | 
| 67 | 
            +
                assert_raise(NoMethodError){ @b.meth_b }
         | 
| 68 | 
            +
              end
         | 
| 69 | 
            +
             | 
| 70 | 
            +
              def test_class_c_methods
         | 
| 71 | 
            +
                assert_respond_to(@c, :meth_a)
         | 
| 72 | 
            +
                assert_respond_to(@c, :meth_c)
         | 
| 73 | 
            +
                assert_respond_to(@c, :meth_x)
         | 
| 74 | 
            +
                assert_respond_to(@c, :meth_y)
         | 
| 75 | 
            +
                assert_respond_to(@c, :meth_z)
         | 
| 76 | 
            +
             | 
| 77 | 
            +
                assert_equal('ModA#meth_a', @c.meth_a)
         | 
| 78 | 
            +
                assert_equal('ClassC#meth_c', @c.meth_c)
         | 
| 79 | 
            +
                assert_equal('ModC#meth_x', @c.meth_x)
         | 
| 80 | 
            +
                assert_equal('ModC#meth_y', @c.meth_y)
         | 
| 81 | 
            +
                assert_equal('ModC#meth_z', @c.meth_z)
         | 
| 82 | 
            +
              end
         | 
| 83 | 
            +
             | 
| 84 | 
            +
              def test_class_c_expected_errors
         | 
| 85 | 
            +
                assert_raise(NoMethodError){ @c.meth_b }
         | 
| 86 | 
            +
              end
         | 
| 87 | 
            +
             | 
| 88 | 
            +
              def test_class_d_methods
         | 
| 89 | 
            +
                assert_respond_to(@d, :meth_x)
         | 
| 90 | 
            +
                assert_respond_to(@d, :meth_z)
         | 
| 91 | 
            +
             | 
| 92 | 
            +
                assert_equal('ModA#meth_a', @d.meth_x)
         | 
| 93 | 
            +
                assert_equal('ModA#meth_c', @d.meth_z)
         | 
| 94 | 
            +
              end
         | 
| 95 | 
            +
             | 
| 96 | 
            +
              def test_class_d_expected_errors
         | 
| 97 | 
            +
                assert_raise(NoMethodError){ @d.meth_a }
         | 
| 98 | 
            +
                assert_raise(NoMethodError){ @d.meth_b }
         | 
| 99 | 
            +
                assert_raise(NoMethodError){ @d.meth_c }
         | 
| 100 | 
            +
              end
         | 
| 101 | 
            +
             | 
| 102 | 
            +
              def test_class_e_methods
         | 
| 103 | 
            +
                assert_respond_to(@e, :meth_a)
         | 
| 104 | 
            +
                assert_respond_to(@e, :meth_b)
         | 
| 105 | 
            +
              end
         | 
| 106 | 
            +
             | 
| 107 | 
            +
              def teardown
         | 
| 108 | 
            +
                @a = nil
         | 
| 109 | 
            +
                @b = nil
         | 
| 110 | 
            +
                @c = nil
         | 
| 111 | 
            +
                @d = nil
         | 
| 112 | 
            +
                @e = nil
         | 
| 113 | 
            +
              end
         | 
| 113 114 | 
             
            end
         | 
    
        data/use.gemspec
    CHANGED
    
    | @@ -1,26 +1,35 @@ | |
| 1 1 | 
             
            require 'rubygems'
         | 
| 2 2 |  | 
| 3 | 
            -
            Gem::Specification.new do | | 
| 4 | 
            -
               | 
| 5 | 
            -
               | 
| 6 | 
            -
               | 
| 7 | 
            -
               | 
| 8 | 
            -
               | 
| 9 | 
            -
               | 
| 10 | 
            -
               | 
| 11 | 
            -
               | 
| 12 | 
            -
               | 
| 3 | 
            +
            Gem::Specification.new do |spec|
         | 
| 4 | 
            +
              spec.name       = 'use'
         | 
| 5 | 
            +
              spec.version    = '1.4.0'
         | 
| 6 | 
            +
              spec.author     = 'Daniel J. Berger'
         | 
| 7 | 
            +
              spec.license    = 'Apache-2.0'
         | 
| 8 | 
            +
              spec.email      = 'djberg96@gmail.com'
         | 
| 9 | 
            +
              spec.homepage   = 'https://github.com/djberg96/use'
         | 
| 10 | 
            +
              spec.summary    = 'Selectively mixin methods from a given module'
         | 
| 11 | 
            +
              spec.test_file  = 'test/test_use.rb'
         | 
| 12 | 
            +
              spec.files      = Dir['**/*'].reject{ |f| f.include?('git') }
         | 
| 13 | 
            +
              spec.cert_chain = ['certs/djberg96_pub.pem']
         | 
| 13 14 |  | 
| 14 | 
            -
               | 
| 15 | 
            +
              spec.extra_rdoc_files  = ['MANIFEST', 'README', 'CHANGES']
         | 
| 15 16 |  | 
| 16 | 
            -
               | 
| 17 | 
            -
               | 
| 17 | 
            +
              spec.add_dependency('structured_warnings', '~> 0.3.0')
         | 
| 18 | 
            +
              spec.add_development_dependency('rake')
         | 
| 18 19 |  | 
| 19 | 
            -
               | 
| 20 | 
            +
              spec.metadata = {
         | 
| 21 | 
            +
                'homepage_uri'      => 'https://github.com/djberg96/use',
         | 
| 22 | 
            +
                'bug_tracker_uri'   => 'https://github.com/djberg96/use/issues',
         | 
| 23 | 
            +
                'changelog_uri'     => 'https://github.com/djberg96/use/blob/master/CHANGES',
         | 
| 24 | 
            +
                'documentation_uri' => 'https://github.com/djberg96/use/wiki',
         | 
| 25 | 
            +
                'source_code_uri'   => 'https://github.com/djberg96/use',
         | 
| 26 | 
            +
                'wiki_uri'          => 'https://github.com/djberg96/use/wiki'
         | 
| 27 | 
            +
              }
         | 
| 28 | 
            +
             | 
| 29 | 
            +
              spec.description = <<-EOF
         | 
| 20 30 | 
             
                The use library solves the multi-mixin problem by allowing you to
         | 
| 21 | 
            -
                selectively mixin specific methods from a module rather than mixing
         | 
| 22 | 
            -
                 | 
| 23 | 
            -
                 | 
| 24 | 
            -
                method.
         | 
| 31 | 
            +
                selectively mixin specific methods from a module rather than mixing in
         | 
| 32 | 
            +
                all of them. In addition, you can alias methods on the fly as they are
         | 
| 33 | 
            +
                mixed in, effectively allowing you to change the name of the mixin method.
         | 
| 25 34 | 
             
              EOF
         | 
| 26 35 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,29 +1,56 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: use
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1. | 
| 4 | 
            +
              version: 1.4.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Daniel J. Berger
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 | 
            -
            cert_chain: | 
| 11 | 
            -
             | 
| 10 | 
            +
            cert_chain:
         | 
| 11 | 
            +
            - |
         | 
| 12 | 
            +
              -----BEGIN CERTIFICATE-----
         | 
| 13 | 
            +
              MIIEcDCCAtigAwIBAgIBATANBgkqhkiG9w0BAQsFADA/MREwDwYDVQQDDAhkamJl
         | 
| 14 | 
            +
              cmc5NjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
         | 
| 15 | 
            +
              MB4XDTE4MDMxODE1MjIwN1oXDTI4MDMxNTE1MjIwN1owPzERMA8GA1UEAwwIZGpi
         | 
| 16 | 
            +
              ZXJnOTYxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
         | 
| 17 | 
            +
              bTCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBALgfaroVM6CI06cxr0/h
         | 
| 18 | 
            +
              A+j+pc8fgpRgBVmHFaFunq28GPC3IvW7Nvc3Y8SnAW7pP1EQIbhlwRIaQzJ93/yj
         | 
| 19 | 
            +
              u95KpkP7tA9erypnV7dpzBkzNlX14ACaFD/6pHoXoe2ltBxk3CCyyzx70mTqJpph
         | 
| 20 | 
            +
              75IB03ni9a8yqn8pmse+s83bFJOAqddSj009sGPcQO+QOWiNxqYv1n5EHcvj2ebO
         | 
| 21 | 
            +
              6hN7YTmhx7aSia4qL/quc4DlIaGMWoAhvML7u1fmo53CYxkKskfN8MOecq2vfEmL
         | 
| 22 | 
            +
              iLu+SsVVEAufMDDFMXMJlvDsviolUSGMSNRTujkyCcJoXKYYxZSNtIiyd9etI0X3
         | 
| 23 | 
            +
              ctu0uhrFyrMZXCedutvXNjUolD5r9KGBFSWH1R9u2I3n3SAyFF2yzv/7idQHLJJq
         | 
| 24 | 
            +
              74BMnx0FIq6fCpu5slAipvxZ3ZkZpEXZFr3cIBtO1gFvQWW7E/Y3ijliWJS1GQFq
         | 
| 25 | 
            +
              058qERadHGu1yu1dojmFRo6W2KZvY9al2yIlbkpDrD5MYQIDAQABo3cwdTAJBgNV
         | 
| 26 | 
            +
              HRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUFZsMapgzJimzsbaBG2Tm8j5e
         | 
| 27 | 
            +
              AzgwHQYDVR0RBBYwFIESZGpiZXJnOTZAZ21haWwuY29tMB0GA1UdEgQWMBSBEmRq
         | 
| 28 | 
            +
              YmVyZzk2QGdtYWlsLmNvbTANBgkqhkiG9w0BAQsFAAOCAYEAW2tnYixXQtKxgGXq
         | 
| 29 | 
            +
              /3iSWG2bLwvxS4go3srO+aRXZHrFUMlJ5W0mCxl03aazxxKTsVVpZD8QZxvK91OQ
         | 
| 30 | 
            +
              h9zr9JBYqCLcCVbr8SkmYCi/laxIZxsNE5YI8cC8vvlLI7AMgSfPSnn/Epq1GjGY
         | 
| 31 | 
            +
              6L1iRcEDtanGCIvjqlCXO9+BmsnCfEVehqZkQHeYczA03tpOWb6pon2wzvMKSsKH
         | 
| 32 | 
            +
              ks0ApVdstSLz1kzzAqem/uHdG9FyXdbTAwH1G4ZPv69sQAFAOCgAqYmdnzedsQtE
         | 
| 33 | 
            +
              1LQfaQrx0twO+CZJPcRLEESjq8ScQxWRRkfuh2VeR7cEU7L7KqT10mtUwrvw7APf
         | 
| 34 | 
            +
              DYoeCY9KyjIBjQXfbj2ke5u1hZj94Fsq9FfbEQg8ygCgwThnmkTrrKEiMSs3alYR
         | 
| 35 | 
            +
              ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
         | 
| 36 | 
            +
              WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
         | 
| 37 | 
            +
              -----END CERTIFICATE-----
         | 
| 38 | 
            +
            date: 
         | 
| 12 39 | 
             
            dependencies:
         | 
| 13 40 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 41 | 
             
              name: structured_warnings
         | 
| 15 42 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 16 43 | 
             
                requirements:
         | 
| 17 | 
            -
                - - " | 
| 44 | 
            +
                - - "~>"
         | 
| 18 45 | 
             
                  - !ruby/object:Gem::Version
         | 
| 19 | 
            -
                    version: 0. | 
| 46 | 
            +
                    version: 0.3.0
         | 
| 20 47 | 
             
              type: :runtime
         | 
| 21 48 | 
             
              prerelease: false
         | 
| 22 49 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 23 50 | 
             
                requirements:
         | 
| 24 | 
            -
                - - " | 
| 51 | 
            +
                - - "~>"
         | 
| 25 52 | 
             
                  - !ruby/object:Gem::Version
         | 
| 26 | 
            -
                    version: 0. | 
| 53 | 
            +
                    version: 0.3.0
         | 
| 27 54 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 28 55 | 
             
              name: rake
         | 
| 29 56 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -40,10 +67,9 @@ dependencies: | |
| 40 67 | 
             
                    version: '0'
         | 
| 41 68 | 
             
            description: |2
         | 
| 42 69 | 
             
                  The use library solves the multi-mixin problem by allowing you to
         | 
| 43 | 
            -
                  selectively mixin specific methods from a module rather than mixing
         | 
| 44 | 
            -
                   | 
| 45 | 
            -
                   | 
| 46 | 
            -
                  method.
         | 
| 70 | 
            +
                  selectively mixin specific methods from a module rather than mixing in
         | 
| 71 | 
            +
                  all of them. In addition, you can alias methods on the fly as they are
         | 
| 72 | 
            +
                  mixed in, effectively allowing you to change the name of the mixin method.
         | 
| 47 73 | 
             
            email: djberg96@gmail.com
         | 
| 48 74 | 
             
            executables: []
         | 
| 49 75 | 
             
            extensions: []
         | 
| @@ -53,18 +79,29 @@ extra_rdoc_files: | |
| 53 79 | 
             
            - CHANGES
         | 
| 54 80 | 
             
            files:
         | 
| 55 81 | 
             
            - CHANGES
         | 
| 56 | 
            -
            -  | 
| 57 | 
            -
            - README
         | 
| 58 | 
            -
            - Rakefile
         | 
| 59 | 
            -
            - examples/example_use.rb
         | 
| 60 | 
            -
            - lib/use.rb
         | 
| 82 | 
            +
            - test
         | 
| 61 83 | 
             
            - test/sample_data.rb
         | 
| 62 84 | 
             
            - test/test_use.rb
         | 
| 85 | 
            +
            - examples
         | 
| 86 | 
            +
            - examples/example_use.rb
         | 
| 63 87 | 
             
            - use.gemspec
         | 
| 88 | 
            +
            - README
         | 
| 89 | 
            +
            - Rakefile
         | 
| 90 | 
            +
            - MANIFEST
         | 
| 91 | 
            +
            - lib
         | 
| 92 | 
            +
            - lib/use.rb
         | 
| 93 | 
            +
            - certs
         | 
| 94 | 
            +
            - certs/djberg96_pub.pem
         | 
| 64 95 | 
             
            homepage: https://github.com/djberg96/use
         | 
| 65 96 | 
             
            licenses:
         | 
| 66 | 
            -
            -  | 
| 67 | 
            -
            metadata: | 
| 97 | 
            +
            - Apache-2.0
         | 
| 98 | 
            +
            metadata:
         | 
| 99 | 
            +
              homepage_uri: https://github.com/djberg96/use
         | 
| 100 | 
            +
              bug_tracker_uri: https://github.com/djberg96/use/issues
         | 
| 101 | 
            +
              changelog_uri: https://github.com/djberg96/use/blob/master/CHANGES
         | 
| 102 | 
            +
              documentation_uri: https://github.com/djberg96/use/wiki
         | 
| 103 | 
            +
              source_code_uri: https://github.com/djberg96/use
         | 
| 104 | 
            +
              wiki_uri: https://github.com/djberg96/use/wiki
         | 
| 68 105 | 
             
            post_install_message: 
         | 
| 69 106 | 
             
            rdoc_options: []
         | 
| 70 107 | 
             
            require_paths:
         | 
| @@ -80,8 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 80 117 | 
             
                - !ruby/object:Gem::Version
         | 
| 81 118 | 
             
                  version: '0'
         | 
| 82 119 | 
             
            requirements: []
         | 
| 83 | 
            -
             | 
| 84 | 
            -
            rubygems_version: 2.4.2
         | 
| 120 | 
            +
            rubygems_version: 3.0.2
         | 
| 85 121 | 
             
            signing_key: 
         | 
| 86 122 | 
             
            specification_version: 4
         | 
| 87 123 | 
             
            summary: Selectively mixin methods from a given module
         | 
    
        metadata.gz.sig
    ADDED
    
    | Binary file |