runby_pace 0.2.59 → 0.2.60
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 +8 -8
- data/lib/runby_pace/pace_time.rb +30 -6
- metadata +3 -3
    
        checksums.yaml
    CHANGED
    
    | @@ -1,15 +1,15 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            !binary "U0hBMQ==":
         | 
| 3 3 | 
             
              metadata.gz: !binary |-
         | 
| 4 | 
            -
                 | 
| 4 | 
            +
                MGEzNDliZTk3MjYwZmYzZmE5NGU5ZTMzMjMxMmVmZThhZDE5NjViYQ==
         | 
| 5 5 | 
             
              data.tar.gz: !binary |-
         | 
| 6 | 
            -
                 | 
| 6 | 
            +
                MmE0Y2I0YzE4OGI4Y2EzMmM4Yzg1YjE1MTZjMjA3NDBhYTg5MGNmMg==
         | 
| 7 7 | 
             
            SHA512:
         | 
| 8 8 | 
             
              metadata.gz: !binary |-
         | 
| 9 | 
            -
                 | 
| 10 | 
            -
                 | 
| 11 | 
            -
                 | 
| 9 | 
            +
                YWE3ZDVmNDViOGJlZmYwYTM5NWU3ZWQyM2JhMjQ0NWZiNzlmYjgyYzliYWRl
         | 
| 10 | 
            +
                MTE0MjExMTMwNmM1ODk4YWRjMmM3ODlhY2FjYTZiMzMzZTlkODVhOWRhODE0
         | 
| 11 | 
            +
                NjY1MmRkMWY4NmI2NWIyZDQwODBmNjNjMDQ2ZmYxYzcwODJlZWU=
         | 
| 12 12 | 
             
              data.tar.gz: !binary |-
         | 
| 13 | 
            -
                 | 
| 14 | 
            -
                 | 
| 15 | 
            -
                 | 
| 13 | 
            +
                Y2NlYmQxM2FjZGQ5MzcwZmU5MDVjMDljODk5NjM0ZTAyMmM5NDYwZTRjYWU1
         | 
| 14 | 
            +
                NTA5NThjYzcxOTU0MmMzZmE2NTI5ZWZjOTA4YWQ2YjJiMTUwYTQ1MzFiYmEw
         | 
| 15 | 
            +
                ZGM0MmE3MjJmNjE4MGY0OGE3ODY1MmQ1NzI3MjQyNDFhM2JjYTM=
         | 
    
        data/lib/runby_pace/pace_time.rb
    CHANGED
    
    | @@ -92,12 +92,36 @@ module RunbyPace | |
| 92 92 | 
             
                private
         | 
| 93 93 |  | 
| 94 94 | 
             
                def init_from_string(time)
         | 
| 95 | 
            -
                   | 
| 96 | 
            -
                   | 
| 97 | 
            -
             | 
| 98 | 
            -
                   | 
| 99 | 
            -
             | 
| 100 | 
            -
             | 
| 95 | 
            +
                  time = time.to_s.strip.chomp
         | 
| 96 | 
            +
                  is_negative = false
         | 
| 97 | 
            +
             | 
| 98 | 
            +
                  if time[0] == '-'
         | 
| 99 | 
            +
                    is_negative = true
         | 
| 100 | 
            +
                    time = time[1..-1]
         | 
| 101 | 
            +
                  end
         | 
| 102 | 
            +
             | 
| 103 | 
            +
                  if time.match(/^\d?\d:\d\d$/)
         | 
| 104 | 
            +
                    parts = time.split(':')
         | 
| 105 | 
            +
                    @minutes_part = parts[0].to_i
         | 
| 106 | 
            +
                    @seconds_part = parts[1].to_i
         | 
| 107 | 
            +
                  elsif time.match(/^\d+$/)
         | 
| 108 | 
            +
                    @minutes_part = time.to_i
         | 
| 109 | 
            +
                    @seconds_part = 0
         | 
| 110 | 
            +
                  elsif time.match(/^\d+[,\. ]\d+$/)
         | 
| 111 | 
            +
                    parts = time.split(/[,\. ]/)
         | 
| 112 | 
            +
                    @minutes_part = parts[0].to_i
         | 
| 113 | 
            +
                    @seconds_part = (parts[1].to_i / 10.0 * 60).to_i
         | 
| 114 | 
            +
                  else
         | 
| 115 | 
            +
                    raise 'Invalid time format'
         | 
| 116 | 
            +
                  end
         | 
| 117 | 
            +
             | 
| 118 | 
            +
                  raise 'Minutes must be less than 100' if @minutes_part > 99
         | 
| 119 | 
            +
                  raise 'Seconds must be less than 60' if @seconds_part > 59
         | 
| 120 | 
            +
                  if is_negative
         | 
| 121 | 
            +
                    @minutes_part *= -1
         | 
| 122 | 
            +
                    @seconds_part *= -1
         | 
| 123 | 
            +
                  end
         | 
| 124 | 
            +
                  @time_s = "#{@minutes_part.to_s.rjust(2, '0')}:#{@seconds_part.to_s.rjust(2, '0')}"
         | 
| 101 125 | 
             
                end
         | 
| 102 126 |  | 
| 103 127 | 
             
                # @param [PaceTime] time
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: runby_pace
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.2. | 
| 4 | 
            +
              version: 0.2.60
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Ty Walls
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2016-07- | 
| 11 | 
            +
            date: 2016-07-09 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         | 
| @@ -91,7 +91,7 @@ homepage: https://github.com/tygerbytes/runby-pace | |
| 91 91 | 
             
            licenses:
         | 
| 92 92 | 
             
            - MIT
         | 
| 93 93 | 
             
            metadata:
         | 
| 94 | 
            -
              commit-hash:  | 
| 94 | 
            +
              commit-hash: 5956578952d079e9c18e45869a7562903d56f6ea
         | 
| 95 95 | 
             
            post_install_message: 
         | 
| 96 96 | 
             
            rdoc_options: []
         | 
| 97 97 | 
             
            require_paths:
         |