nobody 0.1 → 0.2
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.
- data/README.md +12 -0
 - data/lib/nobody.rb +1 -1
 - data/lib/nobody/version.rb +1 -1
 - data/test/lib/nobody/inclusion_test.rb +3 -0
 - metadata +10 -6
 
    
        data/README.md
    CHANGED
    
    | 
         @@ -1,3 +1,5 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            [](https://travis-ci.org/GordonDiggs/nobody)
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
       1 
3 
     | 
    
         
             
            # nobody / personne
         
     | 
| 
       2 
4 
     | 
    
         | 
| 
       3 
5 
     | 
    
         
             
            ## English
         
     | 
| 
         @@ -28,6 +30,11 @@ class NullOdysseus 
     | 
|
| 
       28 
30 
     | 
    
         
             
                'Itaca'
         
     | 
| 
       29 
31 
     | 
    
         
             
              end
         
     | 
| 
       30 
32 
     | 
    
         
             
            end
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
            o = NullOdysseus.new
         
     | 
| 
      
 35 
     | 
    
         
            +
            o.name #=> nil
         
     | 
| 
      
 36 
     | 
    
         
            +
            o.alive? #=> true
         
     | 
| 
      
 37 
     | 
    
         
            +
            o.dead? #=> false
         
     | 
| 
       31 
38 
     | 
    
         
             
            ```  
         
     | 
| 
       32 
39 
     | 
    
         | 
| 
       33 
40 
     | 
    
         
             
            ## Français
         
     | 
| 
         @@ -58,6 +65,11 @@ class NullOdysseus 
     | 
|
| 
       58 
65 
     | 
    
         
             
                'Itaca'
         
     | 
| 
       59 
66 
     | 
    
         
             
              end
         
     | 
| 
       60 
67 
     | 
    
         
             
            end
         
     | 
| 
      
 68 
     | 
    
         
            +
             
     | 
| 
      
 69 
     | 
    
         
            +
            o = NullOdysseus.new
         
     | 
| 
      
 70 
     | 
    
         
            +
            o.name #=> nil
         
     | 
| 
      
 71 
     | 
    
         
            +
            o.alive? #=> true
         
     | 
| 
      
 72 
     | 
    
         
            +
            o.dead? #=> false
         
     | 
| 
       61 
73 
     | 
    
         
             
            ```
         
     | 
| 
       62 
74 
     | 
    
         | 
| 
       63 
75 
     | 
    
         
             
            ## Acknowledgements
         
     | 
    
        data/lib/nobody.rb
    CHANGED
    
    | 
         @@ -19,7 +19,7 @@ module Nobody 
     | 
|
| 
       19 
19 
     | 
    
         
             
                    # takes a value and method array, defines instance methods returning that value
         
     | 
| 
       20 
20 
     | 
    
         
             
                    def define_methods_with_return_value(value, methods)
         
     | 
| 
       21 
21 
     | 
    
         
             
                      methods.each do |name|
         
     | 
| 
       22 
     | 
    
         
            -
                        define_method name do
         
     | 
| 
      
 22 
     | 
    
         
            +
                        define_method name do |*args, &block|
         
     | 
| 
       23 
23 
     | 
    
         
             
                          value
         
     | 
| 
       24 
24 
     | 
    
         
             
                        end
         
     | 
| 
       25 
25 
     | 
    
         
             
                      end
         
     | 
    
        data/lib/nobody/version.rb
    CHANGED
    
    
| 
         @@ -12,12 +12,15 @@ describe Nobody do 
     | 
|
| 
       12 
12 
     | 
    
         | 
| 
       13 
13 
     | 
    
         
             
                  TestClass.new.must_respond_to(:true_method)
         
     | 
| 
       14 
14 
     | 
    
         
             
                  assert TestClass.new.true_method
         
     | 
| 
      
 15 
     | 
    
         
            +
                  assert TestClass.new.true_method('with', 'arguments')
         
     | 
| 
       15 
16 
     | 
    
         | 
| 
       16 
17 
     | 
    
         
             
                  TestClass.new.must_respond_to(:false_method)
         
     | 
| 
       17 
18 
     | 
    
         
             
                  assert_equal false, TestClass.new.false_method
         
     | 
| 
      
 19 
     | 
    
         
            +
                  assert_equal false, TestClass.new.false_method('with', 'arguments')
         
     | 
| 
       18 
20 
     | 
    
         | 
| 
       19 
21 
     | 
    
         
             
                  TestClass.new.must_respond_to(:nil_method)
         
     | 
| 
       20 
22 
     | 
    
         
             
                  assert_nil TestClass.new.nil_method
         
     | 
| 
      
 23 
     | 
    
         
            +
                  assert_nil TestClass.new.nil_method('with', 'arguments')
         
     | 
| 
       21 
24 
     | 
    
         
             
                end
         
     | 
| 
       22 
25 
     | 
    
         
             
              end
         
     | 
| 
       23 
26 
     | 
    
         
             
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: nobody
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: '0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: '0.2'
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: 
         
     | 
| 
       6 
6 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       7 
7 
     | 
    
         
             
            authors:
         
     | 
| 
         @@ -9,11 +9,11 @@ authors: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
            date:  
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2013-07-30 00:00:00.000000000 Z
         
     | 
| 
       13 
13 
     | 
    
         
             
            dependencies:
         
     | 
| 
       14 
14 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       15 
15 
     | 
    
         
             
              name: rake
         
     | 
| 
       16 
     | 
    
         
            -
              requirement:  
     | 
| 
      
 16 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       17 
17 
     | 
    
         
             
                none: false
         
     | 
| 
       18 
18 
     | 
    
         
             
                requirements:
         
     | 
| 
       19 
19 
     | 
    
         
             
                - - ! '>='
         
     | 
| 
         @@ -21,7 +21,12 @@ dependencies: 
     | 
|
| 
       21 
21 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       22 
22 
     | 
    
         
             
              type: :development
         
     | 
| 
       23 
23 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       24 
     | 
    
         
            -
              version_requirements:  
     | 
| 
      
 24 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 25 
     | 
    
         
            +
                none: false
         
     | 
| 
      
 26 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 27 
     | 
    
         
            +
                - - ! '>='
         
     | 
| 
      
 28 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 29 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
       25 
30 
     | 
    
         
             
            description: Null Object Pattern shorthand
         
     | 
| 
       26 
31 
     | 
    
         
             
            email:
         
     | 
| 
       27 
32 
     | 
    
         
             
            - gordon@gordondiggs.com
         
     | 
| 
         @@ -60,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       60 
65 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       61 
66 
     | 
    
         
             
            requirements: []
         
     | 
| 
       62 
67 
     | 
    
         
             
            rubyforge_project: 
         
     | 
| 
       63 
     | 
    
         
            -
            rubygems_version: 1.8. 
     | 
| 
      
 68 
     | 
    
         
            +
            rubygems_version: 1.8.23
         
     | 
| 
       64 
69 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       65 
70 
     | 
    
         
             
            specification_version: 3
         
     | 
| 
       66 
71 
     | 
    
         
             
            summary: Easily use the Null Object Pattern in a class
         
     | 
| 
         @@ -69,4 +74,3 @@ test_files: 
     | 
|
| 
       69 
74 
     | 
    
         
             
            - test/lib/nobody/version_test.rb
         
     | 
| 
       70 
75 
     | 
    
         
             
            - test/minitest_helper.rb
         
     | 
| 
       71 
76 
     | 
    
         
             
            - test/test_helper.rb
         
     | 
| 
       72 
     | 
    
         
            -
            has_rdoc: 
         
     |