subunit 0.8.1 → 0.8.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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/subunit.rb +6 -3
- metadata +2 -2
- metadata.gz.sig +0 -0
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 34b54eb81abbfd37f7def79d99b84475dc1b94f1aef8fa575a62c5c8ecf78766
         | 
| 4 | 
            +
              data.tar.gz: 9db454bb941bd1bf7c21deb81e9e0a5c8c618eec5bb00272719f3302c63227a6
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 42582c6fe9f108f9ea21c4e59618743f3515c82368bda8dd18ed806d9e39fb75a5353425337c130682214c2b84aac5b11c20597156ef3515be4df2077f30ed02
         | 
| 7 | 
            +
              data.tar.gz: b3c218d7d4099d000af39426e89d7ec79d3c7a703af0e8a75994f1a444a597fc4a3aeba8603dcced3af0c3fd0ec902b81f1ddbb4f73a8039c00799d98458fd5c
         | 
    
        checksums.yaml.gz.sig
    CHANGED
    
    | Binary file | 
    
        data.tar.gz.sig
    CHANGED
    
    | Binary file | 
    
        data/lib/subunit.rb
    CHANGED
    
    | @@ -16,10 +16,13 @@ end | |
| 16 16 |  | 
| 17 17 | 
             
            class Subunit
         | 
| 18 18 |  | 
| 19 | 
            -
              def self.seconds(val)
         | 
| 20 | 
            -
                new(units={minutes:60, hours:60}, seconds: val)
         | 
| 19 | 
            +
              def self.seconds(val, units: nil)
         | 
| 20 | 
            +
                new(units={minutes:60, hours:60, days:24}, seconds: val)
         | 
| 21 21 | 
             
              end
         | 
| 22 22 |  | 
| 23 | 
            +
              # e.g. Subunit.hms_to_seconds('5 minutes and 4 seconds')
         | 
| 24 | 
            +
              # => 304   
         | 
| 25 | 
            +
              #
         | 
| 23 26 | 
             
              def self.hms_to_seconds(obj)
         | 
| 24 27 | 
             
                new(units={hours:60, minutes:60,seconds: 60, }, obj).to_i
         | 
| 25 28 | 
             
              end  
         | 
| @@ -41,7 +44,7 @@ class Subunit | |
| 41 44 |  | 
| 42 45 | 
             
                if obj.is_a? String
         | 
| 43 46 |  | 
| 44 | 
            -
                  @to_i = accumulate.call obj.split( | 
| 47 | 
            +
                  @to_i = accumulate.call obj.split(/\D+/).map(&:to_i)
         | 
| 45 48 |  | 
| 46 49 | 
             
                elsif obj.is_a? Array then
         | 
| 47 50 |  | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: subunit
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.8. | 
| 4 | 
            +
              version: 0.8.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - James Robertson
         | 
| @@ -35,7 +35,7 @@ cert_chain: | |
| 35 35 | 
             
              HowcHg4GymtLLITCF/QtA5tta5SmHAca1POGncsO9QiramFQ9S3Q4O4wcjboVJOp
         | 
| 36 36 | 
             
              SSxk4InmYoY9Cl2GVQ+d9owo
         | 
| 37 37 | 
             
              -----END CERTIFICATE-----
         | 
| 38 | 
            -
            date: 2020- | 
| 38 | 
            +
            date: 2020-11-06 00:00:00.000000000 Z
         | 
| 39 39 | 
             
            dependencies: []
         | 
| 40 40 | 
             
            description: 
         | 
| 41 41 | 
             
            email: james@jamesrobertson.eu
         | 
    
        metadata.gz.sig
    CHANGED
    
    | Binary file |