arbeitszeitkonto 0.5.0 → 0.5.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fd0818b871b0e3d470536a15ea1f490d1ade255c
4
- data.tar.gz: 00609473385424125a12fefb5b7361bef0aad76c
3
+ metadata.gz: f6425691fd8e0be9593c714dbe38bf1d92376292
4
+ data.tar.gz: c763585e354f589312bc797f68eaf593c0b55419
5
5
  SHA512:
6
- metadata.gz: b54984d5489c0acd3a4a3f91970aa80f7a0021fc4cdbbefab5cb5588040583d82a6fa4bd3405418326ed306b144fbc71f9ea6fd40fb41454b99e08ca476a4382
7
- data.tar.gz: 2bda86232f966449026622cbd84d15d13e4897d73dad41fc02e909082ef52d979f7dd84699001c971a530c34d6a2e270ecd2b967fd754e79f048b64c3a66af58
6
+ metadata.gz: 0b1a911f03c6ffe8bcaae03e7d49a55c05212d9450a87399d341f5c5a9de30422ac154e34b5925bc1f97d036f6d3b0279c3bd2955704055cf30752a5eaf38551
7
+ data.tar.gz: a532b4d2a031131a26e228975f7a840be13199af18a944d4e2737c7fab7c6242c0b7e0cb6dbba95e640dd34e469e1b90fc113a467a5eeeafcf584289a14f4b30
data/README.md CHANGED
@@ -5,6 +5,8 @@ Berechnet die Zetien einer Zeitspanne für die einzelnen Zeitkonti.
5
5
  ## Versionen
6
6
  ### 0.5.0 27. August 2015
7
7
  * Initialversion, für die Bedürfnisse von ATG erstellt
8
+ ### 0.5.1 11. September 2015
9
+ * Initialversion, Namespace 'Planik'
8
10
 
9
11
 
10
12
  ## gem erstellen und auf rubygems raufladen
@@ -5,7 +5,7 @@ require 'arbeitszeitkonto/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "arbeitszeitkonto"
8
- spec.version = Arbeitszeitkonto::VERSION
8
+ spec.version = Planik::Arbeitszeitkonto::VERSION
9
9
  spec.authors = ["Christian Mühlethaler"]
10
10
  spec.email = ["christian.muehlethaler@optor.ch"]
11
11
 
@@ -6,8 +6,10 @@ require "arbeitszeitkonto/zeitkonto_calculator"
6
6
  require "arbeitszeitkonto/taeglich_zeitkonto_calculator"
7
7
  require "arbeitszeitkonto/woechentlich_zeitkonto_calculator"
8
8
  require "arbeitszeitkonto/feiertag_zeitkonto_calculator"
9
-
10
- module Arbeitszeitkonto
11
- class ArbeitszeitkontoError < StandardError; end
12
- # Your code goes here...
9
+ module Planik
10
+ module Arbeitszeitkonto
11
+ class ArbeitszeitkontoError < StandardError;
12
+ end
13
+ # Your code goes here...
14
+ end
13
15
  end
@@ -1,4 +1,5 @@
1
- module Arbeitszeitkonto
1
+ module Planik
2
+ module Arbeitszeitkonto
2
3
  ##
3
4
  # Feiertag
4
5
  ##
@@ -36,3 +37,4 @@ module Arbeitszeitkonto
36
37
 
37
38
  end
38
39
  end
40
+ end
@@ -1,35 +1,37 @@
1
- module Arbeitszeitkonto
2
-
3
- ##
4
- # Ein Zeitkonto im Rhythmus :täglich
5
- ##
6
- class TaeglichZeitkontoCalculator < ZeitkontoCalculator
1
+ module Planik
2
+ module Arbeitszeitkonto
7
3
 
8
4
  ##
9
- #
10
- #
11
- def initialize zeit_von, zeit_bis
12
- @zeit_von = zeit_von
13
- @zeit_bis = zeit_bis
14
- end
5
+ # Ein Zeitkonto im Rhythmus :täglich
6
+ ##
7
+ class TaeglichZeitkontoCalculator < ZeitkontoCalculator
15
8
 
9
+ ##
10
+ #
11
+ #
12
+ def initialize zeit_von, zeit_bis
13
+ @zeit_von = zeit_von
14
+ @zeit_bis = zeit_bis
15
+ end
16
16
 
17
- ##
18
- # Liefert
19
- # * Anzahl Sekunden, welche die gegebene :zeitspanne mit dem Zeitkonto überlappt
20
- # * Die Reste (Zeitspanne[n])
21
- ##
22
- def calculate zeitspannen
23
- reste = []
24
- seconds = 0
25
- Array(zeitspannen).each do |zeitspanne|
26
- zeitspanne_1 = Zeitspanne.relative(zeitspanne.datum - 1, @zeit_von, @zeit_bis)
27
- zeitspanne_2 = Zeitspanne.relative(zeitspanne.datum, @zeit_von, @zeit_bis)
28
- sec, r = calc(Array(zeitspanne), [zeitspanne_1, zeitspanne_2])
29
- seconds+=sec
30
- reste.push(*r)
17
+
18
+ ##
19
+ # Liefert
20
+ # * Anzahl Sekunden, welche die gegebene :zeitspanne mit dem Zeitkonto überlappt
21
+ # * Die Reste (Zeitspanne[n])
22
+ ##
23
+ def calculate zeitspannen
24
+ reste = []
25
+ seconds = 0
26
+ Array(zeitspannen).each do |zeitspanne|
27
+ zeitspanne_1 = Zeitspanne.relative(zeitspanne.datum - 1, @zeit_von, @zeit_bis)
28
+ zeitspanne_2 = Zeitspanne.relative(zeitspanne.datum, @zeit_von, @zeit_bis)
29
+ sec, r = calc(Array(zeitspanne), [zeitspanne_1, zeitspanne_2])
30
+ seconds+=sec
31
+ reste.push(*r)
32
+ end
33
+ [seconds, reste]
31
34
  end
32
- [seconds, reste]
33
35
  end
34
36
  end
35
37
  end
@@ -1,3 +1,5 @@
1
- module Arbeitszeitkonto
2
- VERSION = "0.5.0"
1
+ module Planik
2
+ module Arbeitszeitkonto
3
+ VERSION = "0.5.1"
4
+ end
3
5
  end
@@ -1,4 +1,5 @@
1
- module Arbeitszeitkonto
1
+ module Planik
2
+ module Arbeitszeitkonto
2
3
 
3
4
  ##
4
5
  # Ein Zeitkonto im Rhythmus :wöchentlich
@@ -60,3 +61,4 @@ module Arbeitszeitkonto
60
61
  end
61
62
  end
62
63
  end
64
+ end
@@ -1,4 +1,5 @@
1
- module Arbeitszeitkonto
1
+ module Planik
2
+ module Arbeitszeitkonto
2
3
 
3
4
  ##
4
5
  # Zulagen berechnen für Medphone
@@ -39,3 +40,4 @@ module Arbeitszeitkonto
39
40
  end
40
41
 
41
42
  end
43
+ end
@@ -1,4 +1,5 @@
1
- module Arbeitszeitkonto
1
+ module Planik
2
+ module Arbeitszeitkonto
2
3
 
3
4
  ##
4
5
  # Definiert eine Zeitspanne einer bestimmten Zeitkontos (Sa, den 03.08.15 von 22 - 24) oder eines Dienstes.
@@ -114,3 +115,4 @@ module Arbeitszeitkonto
114
115
 
115
116
  end
116
117
  end
118
+ end
@@ -20,16 +20,18 @@ require 'arbeitszeitkonto'
20
20
  # bis = Time.new(2014, 8, 27, 06, 0, 0) #Montag 6:00 Uhr
21
21
  # puts((bis.to_date - von.to_date).to_i)
22
22
 
23
+ module Planik
23
24
 
24
- def calculate_tage_zurueck(wday_calculator, wday_kandidat)
25
- #anzahl_tage_zurueck = wday_kandidat >= wday_calculator ? wday_kandidat - wday_calculator : (wday_kandidat + 6) - wday_calculator
26
- anzahl_tage_zurueck = (wday_kandidat - wday_calculator ) % 7
27
- #puts "WoechentlichZeitKontoCalculator#calculate: Zeitspanne: wday Kandidat = #{wday_kandidat}, wday Calculator: #{wday_calculator}, anzahl_tage_zurueck: #{anzahl_tage_zurueck}"
28
- end
25
+ def calculate_tage_zurueck(wday_calculator, wday_kandidat)
26
+ #anzahl_tage_zurueck = wday_kandidat >= wday_calculator ? wday_kandidat - wday_calculator : (wday_kandidat + 6) - wday_calculator
27
+ anzahl_tage_zurueck = (wday_kandidat - wday_calculator) % 7
28
+ #puts "WoechentlichZeitKontoCalculator#calculate: Zeitspanne: wday Kandidat = #{wday_kandidat}, wday Calculator: #{wday_calculator}, anzahl_tage_zurueck: #{anzahl_tage_zurueck}"
29
+ end
29
30
 
30
31
  # calculate_tage_zurueck(0, 1)
31
32
  # calculate_tage_zurueck(2, 3)
32
33
  # calculate_tage_zurueck(0, 6)
33
34
 
34
35
 
35
- calculate_tage_zurueck(3, 2)
36
+ calculate_tage_zurueck(3, 2)
37
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arbeitszeitkonto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Mühlethaler
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-08-27 00:00:00.000000000 Z
11
+ date: 2015-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler