getth 0.0.2 → 0.0.3
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/lib/getth.rb +4 -16
 - metadata +19 -4
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 6d5c4264706b60b462682d939065703143ab10e5
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 218a559f620b72c5ce015fbc343c6ec002c42530
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 731a3c0cf41bfed8223523664ddb8c1190244d43f309d14440aa1a03d5b92c84d3eb41887e51daf78dc9d23b36219319012a86ed2bc101cb1a392559a3439294
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 971cfdb2632ae73c80967fc2242ad52606d6c10627dd87276c1d4941680162dd7869845065cfb62e87f01c64dfcff5e74507fc6c85f987c119c15e4a754619cb
         
     | 
    
        data/lib/getth.rb
    CHANGED
    
    | 
         @@ -1,27 +1,15 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            require 'ordinalize'
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            module Getth
         
     | 
| 
       4 
     | 
    
         
            -
               
     | 
| 
       5 
     | 
    
         
            -
              (2..10).each do |i|
         
     | 
| 
      
 4 
     | 
    
         
            +
              (1..10).each do |i|
         
     | 
| 
       6 
5 
     | 
    
         
             
                define_method(i.ordinalize) { self[i.pred] }
         
     | 
| 
       7 
6 
     | 
    
         
             
              end
         
     | 
| 
       8 
7 
     | 
    
         
             
            end
         
     | 
| 
       9 
8 
     | 
    
         | 
| 
       10 
9 
     | 
    
         
             
            class Array
         
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
      
 10 
     | 
    
         
            +
              include Getth
         
     | 
| 
       12 
11 
     | 
    
         
             
            end
         
     | 
| 
       13 
12 
     | 
    
         | 
| 
       14 
13 
     | 
    
         
             
            class String
         
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
            end
         
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
       18 
     | 
    
         
            -
            =begin
         
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
            ###########Example#############
         
     | 
| 
       21 
     | 
    
         
            -
            arr = (1..10).to_a.shuffle => [9, 2, 7, 10, 3, 8, 4, 1, 5, 6]
         
     | 
| 
       22 
     | 
    
         
            -
            arr.second     =>  2
         
     | 
| 
       23 
     | 
    
         
            -
            arr.third      =>  7
         
     | 
| 
       24 
     | 
    
         
            -
            arr.fourth     => 10
         
     | 
| 
       25 
     | 
    
         
            -
            arr.tenth      =>  6
         
     | 
| 
       26 
     | 
    
         
            -
            "Hello".second => "e"
         
     | 
| 
       27 
     | 
    
         
            -
            =end
         
     | 
| 
      
 14 
     | 
    
         
            +
              include Getth
         
     | 
| 
      
 15 
     | 
    
         
            +
            end
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: getth
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.3
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Sagar Pandya
         
     | 
| 
         @@ -9,9 +9,24 @@ autorequire: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
11 
     | 
    
         
             
            date: 2017-01-19 00:00:00.000000000 Z
         
     | 
| 
       12 
     | 
    
         
            -
            dependencies: 
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
               
     | 
| 
      
 12 
     | 
    
         
            +
            dependencies:
         
     | 
| 
      
 13 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 14 
     | 
    
         
            +
              name: ordinalize
         
     | 
| 
      
 15 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 16 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 17 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 18 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 19 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 20 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 21 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 22 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 23 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 24 
     | 
    
         
            +
                - - ">="
         
     | 
| 
      
 25 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 26 
     | 
    
         
            +
                    version: '0'
         
     | 
| 
      
 27 
     | 
    
         
            +
            description: This gem defines methods _first, second, third ... ninth, tenth_ for
         
     | 
| 
      
 28 
     | 
    
         
            +
              retrieving values from strings and arrays. The Array and String classes are monkey-patched
         
     | 
| 
      
 29 
     | 
    
         
            +
              with the module Getth.
         
     | 
| 
       15 
30 
     | 
    
         
             
            email: sarg@outlook.com
         
     | 
| 
       16 
31 
     | 
    
         
             
            executables: []
         
     | 
| 
       17 
32 
     | 
    
         
             
            extensions: []
         
     |