calc_working_hours 0.1.2 → 0.1.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
    ADDED
    
    | @@ -0,0 +1,7 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            SHA1:
         | 
| 3 | 
            +
              metadata.gz: 43b442d4e77191f65533344781ba9659132c8cdc
         | 
| 4 | 
            +
              data.tar.gz: 9b3d97cbb7750cf22d6770a0153edc21d62801a1
         | 
| 5 | 
            +
            SHA512:
         | 
| 6 | 
            +
              metadata.gz: c107a7196c471a54f3f420b37a5841bb1dc19693835e0d44a3145d9160855fbbc1226183b4c601f9c09c87678b9cfc315ce3281856407d3807b24af0e16653c7
         | 
| 7 | 
            +
              data.tar.gz: d7c0b1d7100223528da6841dcb157edb9e36b4ded084a13923a0ccd71073d799cff1c10a4fd7dcf0fdbe1061d8f135e6811ef864c1885ddb1eb32d0ba038ff43
         | 
| @@ -49,7 +49,7 @@ module CalcWorkingHours | |
| 49 49 | 
             
                end
         | 
| 50 50 |  | 
| 51 51 | 
             
                def set_fixed_working_hours(time)
         | 
| 52 | 
            -
                  if @working_hours. | 
| 52 | 
            +
                  if @working_hours.minute < WorkingHours.new(time).minute
         | 
| 53 53 | 
             
                    @overtime = @working_hours.minus_time(@working_hours.time_string)
         | 
| 54 54 | 
             
                  else
         | 
| 55 55 | 
             
                    @overtime = @working_hours.minus_time(time)
         | 
| @@ -21,10 +21,14 @@ describe TimeCardRow do | |
| 21 21 | 
             
                  @time_card_row.working_hours.time_string.should == "8:00"
         | 
| 22 22 | 
             
                end
         | 
| 23 23 |  | 
| 24 | 
            -
                it "set_date | 
| 24 | 
            +
                it "set_dateに日付(任意の文字列)を設定できる" do
         | 
| 25 25 | 
             
                  @time_card_row.set_date("2013/8/1").date_string.class.should == String
         | 
| 26 26 | 
             
                end
         | 
| 27 27 |  | 
| 28 | 
            +
                it "set_dateにString以外を設定すると例外が発生する" do
         | 
| 29 | 
            +
                  proc { @time_card_row.set_date(Date.new(2013,8,1)) }.should raise_error
         | 
| 30 | 
            +
                end
         | 
| 31 | 
            +
             | 
| 28 32 | 
             
                it "time_pointは9:00,11:00,12:00,15:00,16:00,19:00" do 
         | 
| 29 33 | 
             
                  @time_card_row.time_point.should == ["9:00", "11:00", "12:00", "15:00", "16:00", "19:00"]
         | 
| 30 34 | 
             
                end
         | 
| @@ -49,9 +53,19 @@ describe TimeCardRow do | |
| 49 53 | 
             
                  @time_card_row.set_fixed_working_hours("8:20").overtime.time_string.should == "0:00"
         | 
| 50 54 | 
             
                end
         | 
| 51 55 |  | 
| 56 | 
            +
              end
         | 
| 57 | 
            +
             | 
| 58 | 
            +
              context "始業11:30、終業23:34、休憩15:38〜17:14のとき" do
         | 
| 59 | 
            +
                before do
         | 
| 60 | 
            +
                  @time_card_row = TimeCardRow.new("11:30", "23:34", ["15:38", "17:14"])
         | 
| 61 | 
            +
                end
         | 
| 52 62 |  | 
| 63 | 
            +
                it "所定労働時間を8:00とすると、残業時間は2:28となる" do 
         | 
| 64 | 
            +
                  @time_card_row.set_fixed_working_hours("8:00").overtime.time_string.should == "2:28"
         | 
| 65 | 
            +
                end
         | 
| 53 66 | 
             
              end
         | 
| 54 67 |  | 
| 68 | 
            +
             | 
| 55 69 | 
             
              context "適正な時間設定と、不適な設定時間を設定したとき" do
         | 
| 56 70 | 
             
                it "始業22:00、終業28:00は適正な始業・終業時間設定(0:00〜48:00)なので、エラーは発生しないこと" do
         | 
| 57 71 | 
             
                  proc{ TimeCardRow.new("22:00", "28:00") }.should_not raise_error
         | 
    
        metadata
    CHANGED
    
    | @@ -1,49 +1,57 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: calc_working_hours
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 5 | 
            -
              prerelease: 
         | 
| 4 | 
            +
              version: 0.1.3
         | 
| 6 5 | 
             
            platform: ruby
         | 
| 7 6 | 
             
            authors:
         | 
| 8 7 | 
             
            - Takashi_U
         | 
| 9 8 | 
             
            autorequire: 
         | 
| 10 9 | 
             
            bindir: bin
         | 
| 11 10 | 
             
            cert_chain: []
         | 
| 12 | 
            -
            date: 2013-09- | 
| 11 | 
            +
            date: 2013-09-23 00:00:00.000000000 Z
         | 
| 13 12 | 
             
            dependencies:
         | 
| 14 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 14 | 
             
              name: bundler
         | 
| 16 | 
            -
              requirement:  | 
| 17 | 
            -
                none: false
         | 
| 15 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 18 16 | 
             
                requirements:
         | 
| 19 17 | 
             
                - - ~>
         | 
| 20 18 | 
             
                  - !ruby/object:Gem::Version
         | 
| 21 19 | 
             
                    version: '1.3'
         | 
| 22 20 | 
             
              type: :development
         | 
| 23 21 | 
             
              prerelease: false
         | 
| 24 | 
            -
              version_requirements:  | 
| 22 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 23 | 
            +
                requirements:
         | 
| 24 | 
            +
                - - ~>
         | 
| 25 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 26 | 
            +
                    version: '1.3'
         | 
| 25 27 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 26 28 | 
             
              name: rake
         | 
| 27 | 
            -
              requirement:  | 
| 28 | 
            -
                none: false
         | 
| 29 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 29 30 | 
             
                requirements:
         | 
| 30 | 
            -
                - -  | 
| 31 | 
            +
                - - '>='
         | 
| 31 32 | 
             
                  - !ruby/object:Gem::Version
         | 
| 32 33 | 
             
                    version: '0'
         | 
| 33 34 | 
             
              type: :development
         | 
| 34 35 | 
             
              prerelease: false
         | 
| 35 | 
            -
              version_requirements:  | 
| 36 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 37 | 
            +
                requirements:
         | 
| 38 | 
            +
                - - '>='
         | 
| 39 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 40 | 
            +
                    version: '0'
         | 
| 36 41 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 37 42 | 
             
              name: rspec
         | 
| 38 | 
            -
              requirement:  | 
| 39 | 
            -
                none: false
         | 
| 43 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 40 44 | 
             
                requirements:
         | 
| 41 | 
            -
                - -  | 
| 45 | 
            +
                - - '>='
         | 
| 42 46 | 
             
                  - !ruby/object:Gem::Version
         | 
| 43 47 | 
             
                    version: '0'
         | 
| 44 48 | 
             
              type: :development
         | 
| 45 49 | 
             
              prerelease: false
         | 
| 46 | 
            -
              version_requirements:  | 
| 50 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 51 | 
            +
                requirements:
         | 
| 52 | 
            +
                - - '>='
         | 
| 53 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 54 | 
            +
                    version: '0'
         | 
| 47 55 | 
             
            description: 例えば、173:08のような表記の時間を計算するライブラリです
         | 
| 48 56 | 
             
            email:
         | 
| 49 57 | 
             
            - ''
         | 
| @@ -76,33 +84,26 @@ files: | |
| 76 84 | 
             
            homepage: https://github.com/Takashi-U/calc_working_hours
         | 
| 77 85 | 
             
            licenses:
         | 
| 78 86 | 
             
            - MIT
         | 
| 87 | 
            +
            metadata: {}
         | 
| 79 88 | 
             
            post_install_message: 
         | 
| 80 89 | 
             
            rdoc_options: []
         | 
| 81 90 | 
             
            require_paths:
         | 
| 82 91 | 
             
            - lib
         | 
| 83 92 | 
             
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 84 | 
            -
              none: false
         | 
| 85 93 | 
             
              requirements:
         | 
| 86 | 
            -
              - -  | 
| 94 | 
            +
              - - '>='
         | 
| 87 95 | 
             
                - !ruby/object:Gem::Version
         | 
| 88 96 | 
             
                  version: '0'
         | 
| 89 | 
            -
                  segments:
         | 
| 90 | 
            -
                  - 0
         | 
| 91 | 
            -
                  hash: -646011693737778433
         | 
| 92 97 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 93 | 
            -
              none: false
         | 
| 94 98 | 
             
              requirements:
         | 
| 95 | 
            -
              - -  | 
| 99 | 
            +
              - - '>='
         | 
| 96 100 | 
             
                - !ruby/object:Gem::Version
         | 
| 97 101 | 
             
                  version: '0'
         | 
| 98 | 
            -
                  segments:
         | 
| 99 | 
            -
                  - 0
         | 
| 100 | 
            -
                  hash: -646011693737778433
         | 
| 101 102 | 
             
            requirements: []
         | 
| 102 103 | 
             
            rubyforge_project: 
         | 
| 103 | 
            -
            rubygems_version:  | 
| 104 | 
            +
            rubygems_version: 2.0.3
         | 
| 104 105 | 
             
            signing_key: 
         | 
| 105 | 
            -
            specification_version:  | 
| 106 | 
            +
            specification_version: 4
         | 
| 106 107 | 
             
            summary: 時間計算
         | 
| 107 108 | 
             
            test_files:
         | 
| 108 109 | 
             
            - spec/calc_working_hours/data_sample.csv
         |