punch_time 0.1.5 → 0.1.6
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/.gitignore +2 -1
- data/CHANGELOG.md +10 -0
- data/README.md +33 -3
- data/bin/console +1 -1
- data/lib/punch_time/version.rb +1 -1
- data/punch_time.gemspec +3 -2
- metadata +24 -11
- data/Gemfile.lock +0 -69
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 2bba49e33ef9ed12b8fae81b3356d9f6628fa3484d0b4e5a154ec48a531b2a33
         | 
| 4 | 
            +
              data.tar.gz: 2d9cb26844479f93a6d785012df6039a17dfd47691f28aa5f094d3e4f53fd4b4
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 2a3a68ec6c6de05c372740731363d207077df6a5b6d8dc0754d61e31d3888e4b1d1b11128b939e51dfc8bc374a56cdfb8ffd7f524a2515fb0a5990bdedeedaea
         | 
| 7 | 
            +
              data.tar.gz: 84ef1e81b1bd152ef74e9569d029b9a33604295e95423b182ec7b11f6c8e12a11f688087ff8d43afbb525c7539412dcfe56ac8367cd10742e8bc81909b185c26
         | 
    
        data/.gitignore
    CHANGED
    
    
    
        data/CHANGELOG.md
    CHANGED
    
    
    
        data/README.md
    CHANGED
    
    | @@ -1,11 +1,17 @@ | |
| 1 1 | 
             
            # punch_time
         | 
| 2 2 |  | 
| 3 | 
            +
            
         | 
| 4 | 
            +
            [](https://badge.fury.io/rb/punch_time)
         | 
| 5 | 
            +
            
         | 
| 6 | 
            +
            [](https://github.com/rubocop-hq/rubocop)
         | 
| 3 7 | 
             
            [](https://circleci.com/bb/smapira/punch_time)
         | 
| 4 8 |  | 
| 5 | 
            -
            [logo]: https://bitbucket.org/smapira/punch_time/raw/c0df4f773da9bd66822186350f6516efe3be5a72/support/body_punch_hand.png "punch"
         | 
| 6 | 
            -
             | 
| 7 9 | 
             
            Work time calculations using punch clock.
         | 
| 8 10 |  | 
| 11 | 
            +
            ## See It Work
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            [](https://asciinema.org/a/489536)
         | 
| 14 | 
            +
             | 
| 9 15 | 
             
            ## Features
         | 
| 10 16 |  | 
| 11 17 | 
             
            Calculates a work, a tardy, a overtime work and a night work times.
         | 
| @@ -60,14 +66,22 @@ PunchTime.punch(DateTime.parse('20200101 10:10'), DateTime.parse('20200101 19:00 | |
| 60 66 |  | 
| 61 67 | 
             
            # Calculations can be performed in minutes, hours, or days
         | 
| 62 68 | 
             
            p PunchTime.sum_work.hours
         | 
| 69 | 
            +
            # => 8
         | 
| 70 | 
            +
             | 
| 71 | 
            +
            p PunchTime.sum_work.minutes
         | 
| 72 | 
            +
            # => 480
         | 
| 63 73 |  | 
| 64 74 | 
             
            # When need calculate holiday work time (use with business_time)
         | 
| 75 | 
            +
             | 
| 76 | 
            +
            require 'business_time'
         | 
| 77 | 
            +
             | 
| 65 78 | 
             
            sum_works = []
         | 
| 66 79 | 
             
            Date.parse('20200101').upto(Date.parse('20200105')) do |x|
         | 
| 67 80 | 
             
              PunchTime.punch(DateTime.parse(x.to_s + ' 10:10'), DateTime.parse(x.to_s + ' 19:00'))
         | 
| 68 81 | 
             
              sum_works.append(PunchTime.sum_work.hours) unless x.workday?
         | 
| 69 82 | 
             
            end
         | 
| 70 83 | 
             
            p sum_works.inject(:+).to_i
         | 
| 84 | 
            +
            # => 16
         | 
| 71 85 |  | 
| 72 86 | 
             
            # Other methods
         | 
| 73 87 | 
             
            PunchTime.sum_work
         | 
| @@ -87,11 +101,27 @@ Bug reports and pull requests are welcome on GitHub at https://bitbucket.org/sma | |
| 87 101 |  | 
| 88 102 | 
             
            The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
         | 
| 89 103 |  | 
| 104 | 
            +
            ## Changelog
         | 
| 105 | 
            +
             | 
| 106 | 
            +
            punch_time's changelog is available [here](https://bitbucket.org/smapira/punch_time/blob/master/CHANGELOG.md.md).
         | 
| 107 | 
            +
             | 
| 90 108 | 
             
            ## Code of Conduct
         | 
| 91 109 |  | 
| 92 110 | 
             
            Everyone interacting in the PunchClock project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://bitbucket.org/smapira/punch_time/blob/master/CODE_OF_CONDUCT.md).
         | 
| 93 111 |  | 
| 94 | 
            -
            ##  | 
| 112 | 
            +
            ## You may enjoy owning other libraries and my company.
         | 
| 113 | 
            +
             | 
| 114 | 
            +
            * [routeflagsinc / jma — Bitbucket](https://bitbucket.org/routeflagsinc/jma/src/main/)
         | 
| 115 | 
            +
            - for the Japan Meteorological Agency (気象庁) for searching new information simplifies.
         | 
| 116 | 
            +
            * [smapira / punch_time — Bitbucket](https://bitbucket.org/smapira/punch_time/src/master/)
         | 
| 117 | 
            +
            - Work time calculations using punch clock.
         | 
| 118 | 
            +
            * [smapira / rspec-css — Bitbucket](https://bitbucket.org/smapira/rspec-css/src/master/)
         | 
| 119 | 
            +
            - Record your test suite's computed CSS during future test runs for deterministic and accurate tests.
         | 
| 120 | 
            +
            * [routeflags/timeline_rails_helper: The TimelineRailsHelper provides a timeline_molecules_tag helper to draw a vertical time line usable with vanilla CSS.](https://github.com/routeflags/timeline_rails_helper)
         | 
| 121 | 
            +
            * [routeflags/acts_as_tree_diagram: ActsAsTreeDiagram extends ActsAsTree to add simple function for draw tree diagram with html.](https://github.com/routeflags/acts_as_tree_diagram)
         | 
| 122 | 
            +
            * [株式会社旗指物](https://blog.routeflags.com/)
         | 
| 123 | 
            +
             | 
| 124 | 
            +
            ## Аcknowledgments
         | 
| 95 125 |  | 
| 96 126 | 
             
            - [biz](https://github.com/zendesk/biz)
         | 
| 97 127 | 
             
            - [business_time](https://github.com/bokmann/business_time)
         | 
    
        data/bin/console
    CHANGED
    
    
    
        data/lib/punch_time/version.rb
    CHANGED
    
    
    
        data/punch_time.gemspec
    CHANGED
    
    | @@ -39,7 +39,8 @@ Gem::Specification.new do |spec| | |
| 39 39 | 
             
              spec.add_dependency 'activemodel'
         | 
| 40 40 | 
             
              spec.add_dependency 'activesupport'
         | 
| 41 41 | 
             
              spec.add_development_dependency 'bundler'
         | 
| 42 | 
            -
              spec.add_development_dependency ' | 
| 43 | 
            -
              spec.add_development_dependency ' | 
| 42 | 
            +
              spec.add_development_dependency 'business_time'
         | 
| 43 | 
            +
              spec.add_development_dependency 'rake'
         | 
| 44 | 
            +
              spec.add_development_dependency 'rspec'
         | 
| 44 45 | 
             
              spec.add_development_dependency 'rubocop'
         | 
| 45 46 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: punch_time
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 4 | 
            +
              version: 0.1.6
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - smapira
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2022-04-23 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: activemodel
         | 
| @@ -52,34 +52,48 @@ dependencies: | |
| 52 52 | 
             
                - - ">="
         | 
| 53 53 | 
             
                  - !ruby/object:Gem::Version
         | 
| 54 54 | 
             
                    version: '0'
         | 
| 55 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 56 | 
            +
              name: business_time
         | 
| 57 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 58 | 
            +
                requirements:
         | 
| 59 | 
            +
                - - ">="
         | 
| 60 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 61 | 
            +
                    version: '0'
         | 
| 62 | 
            +
              type: :development
         | 
| 63 | 
            +
              prerelease: false
         | 
| 64 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 65 | 
            +
                requirements:
         | 
| 66 | 
            +
                - - ">="
         | 
| 67 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 68 | 
            +
                    version: '0'
         | 
| 55 69 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 56 70 | 
             
              name: rake
         | 
| 57 71 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 58 72 | 
             
                requirements:
         | 
| 59 | 
            -
                - - " | 
| 73 | 
            +
                - - ">="
         | 
| 60 74 | 
             
                  - !ruby/object:Gem::Version
         | 
| 61 | 
            -
                    version: ' | 
| 75 | 
            +
                    version: '0'
         | 
| 62 76 | 
             
              type: :development
         | 
| 63 77 | 
             
              prerelease: false
         | 
| 64 78 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 65 79 | 
             
                requirements:
         | 
| 66 | 
            -
                - - " | 
| 80 | 
            +
                - - ">="
         | 
| 67 81 | 
             
                  - !ruby/object:Gem::Version
         | 
| 68 | 
            -
                    version: ' | 
| 82 | 
            +
                    version: '0'
         | 
| 69 83 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 70 84 | 
             
              name: rspec
         | 
| 71 85 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 72 86 | 
             
                requirements:
         | 
| 73 | 
            -
                - - " | 
| 87 | 
            +
                - - ">="
         | 
| 74 88 | 
             
                  - !ruby/object:Gem::Version
         | 
| 75 | 
            -
                    version: ' | 
| 89 | 
            +
                    version: '0'
         | 
| 76 90 | 
             
              type: :development
         | 
| 77 91 | 
             
              prerelease: false
         | 
| 78 92 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 79 93 | 
             
                requirements:
         | 
| 80 | 
            -
                - - " | 
| 94 | 
            +
                - - ">="
         | 
| 81 95 | 
             
                  - !ruby/object:Gem::Version
         | 
| 82 | 
            -
                    version: ' | 
| 96 | 
            +
                    version: '0'
         | 
| 83 97 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 84 98 | 
             
              name: rubocop
         | 
| 85 99 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -109,7 +123,6 @@ files: | |
| 109 123 | 
             
            - CHANGELOG.md
         | 
| 110 124 | 
             
            - CODE_OF_CONDUCT.md
         | 
| 111 125 | 
             
            - Gemfile
         | 
| 112 | 
            -
            - Gemfile.lock
         | 
| 113 126 | 
             
            - LICENSE.txt
         | 
| 114 127 | 
             
            - README.md
         | 
| 115 128 | 
             
            - Rakefile
         | 
    
        data/Gemfile.lock
    DELETED
    
    | @@ -1,69 +0,0 @@ | |
| 1 | 
            -
            PATH
         | 
| 2 | 
            -
              remote: .
         | 
| 3 | 
            -
              specs:
         | 
| 4 | 
            -
                punch_time (0.1.5)
         | 
| 5 | 
            -
                  activemodel
         | 
| 6 | 
            -
                  activesupport
         | 
| 7 | 
            -
             | 
| 8 | 
            -
            GEM
         | 
| 9 | 
            -
              remote: https://rubygems.org/
         | 
| 10 | 
            -
              specs:
         | 
| 11 | 
            -
                activemodel (6.0.2.1)
         | 
| 12 | 
            -
                  activesupport (= 6.0.2.1)
         | 
| 13 | 
            -
                activesupport (6.0.2.1)
         | 
| 14 | 
            -
                  concurrent-ruby (~> 1.0, >= 1.0.2)
         | 
| 15 | 
            -
                  i18n (>= 0.7, < 2)
         | 
| 16 | 
            -
                  minitest (~> 5.1)
         | 
| 17 | 
            -
                  tzinfo (~> 1.1)
         | 
| 18 | 
            -
                  zeitwerk (~> 2.2)
         | 
| 19 | 
            -
                ast (2.4.0)
         | 
| 20 | 
            -
                concurrent-ruby (1.1.5)
         | 
| 21 | 
            -
                diff-lcs (1.3)
         | 
| 22 | 
            -
                i18n (1.8.2)
         | 
| 23 | 
            -
                  concurrent-ruby (~> 1.0)
         | 
| 24 | 
            -
                jaro_winkler (1.5.4)
         | 
| 25 | 
            -
                minitest (5.14.0)
         | 
| 26 | 
            -
                parallel (1.19.1)
         | 
| 27 | 
            -
                parser (2.7.0.2)
         | 
| 28 | 
            -
                  ast (~> 2.4.0)
         | 
| 29 | 
            -
                rainbow (3.0.0)
         | 
| 30 | 
            -
                rake (10.5.0)
         | 
| 31 | 
            -
                rspec (3.9.0)
         | 
| 32 | 
            -
                  rspec-core (~> 3.9.0)
         | 
| 33 | 
            -
                  rspec-expectations (~> 3.9.0)
         | 
| 34 | 
            -
                  rspec-mocks (~> 3.9.0)
         | 
| 35 | 
            -
                rspec-core (3.9.1)
         | 
| 36 | 
            -
                  rspec-support (~> 3.9.1)
         | 
| 37 | 
            -
                rspec-expectations (3.9.0)
         | 
| 38 | 
            -
                  diff-lcs (>= 1.2.0, < 2.0)
         | 
| 39 | 
            -
                  rspec-support (~> 3.9.0)
         | 
| 40 | 
            -
                rspec-mocks (3.9.1)
         | 
| 41 | 
            -
                  diff-lcs (>= 1.2.0, < 2.0)
         | 
| 42 | 
            -
                  rspec-support (~> 3.9.0)
         | 
| 43 | 
            -
                rspec-support (3.9.2)
         | 
| 44 | 
            -
                rubocop (0.79.0)
         | 
| 45 | 
            -
                  jaro_winkler (~> 1.5.1)
         | 
| 46 | 
            -
                  parallel (~> 1.10)
         | 
| 47 | 
            -
                  parser (>= 2.7.0.1)
         | 
| 48 | 
            -
                  rainbow (>= 2.2.2, < 4.0)
         | 
| 49 | 
            -
                  ruby-progressbar (~> 1.7)
         | 
| 50 | 
            -
                  unicode-display_width (>= 1.4.0, < 1.7)
         | 
| 51 | 
            -
                ruby-progressbar (1.10.1)
         | 
| 52 | 
            -
                thread_safe (0.3.6)
         | 
| 53 | 
            -
                tzinfo (1.2.6)
         | 
| 54 | 
            -
                  thread_safe (~> 0.1)
         | 
| 55 | 
            -
                unicode-display_width (1.6.1)
         | 
| 56 | 
            -
                zeitwerk (2.2.2)
         | 
| 57 | 
            -
             | 
| 58 | 
            -
            PLATFORMS
         | 
| 59 | 
            -
              ruby
         | 
| 60 | 
            -
             | 
| 61 | 
            -
            DEPENDENCIES
         | 
| 62 | 
            -
              bundler
         | 
| 63 | 
            -
              punch_time!
         | 
| 64 | 
            -
              rake (~> 10.0)
         | 
| 65 | 
            -
              rspec (~> 3.0)
         | 
| 66 | 
            -
              rubocop
         | 
| 67 | 
            -
             | 
| 68 | 
            -
            BUNDLED WITH
         | 
| 69 | 
            -
               2.1.4
         |