singapore_cpf_calculator 1.4.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build.yml +6 -2
  3. data/.rubocop.yml +81 -0
  4. data/.rubocop_todo.yml +326 -0
  5. data/Gemfile +0 -1
  6. data/README.md +1 -0
  7. data/lib/singapore_cpf_calculator/version.rb +1 -1
  8. data/lib/singapore_cpf_calculator/year_2022.rb +2 -2
  9. data/lib/singapore_cpf_calculator/year_2023/citizen_or_spr_3/age_55_below_contribution_calculator.rb +8 -0
  10. data/lib/singapore_cpf_calculator/year_2023/citizen_or_spr_3/age_55_to_60_contribution_calculator.rb +32 -0
  11. data/lib/singapore_cpf_calculator/year_2023/citizen_or_spr_3/age_60_to_65_contribution_calculator.rb +32 -0
  12. data/lib/singapore_cpf_calculator/year_2023/citizen_or_spr_3/age_65_to_70_contribution_calculator.rb +32 -0
  13. data/lib/singapore_cpf_calculator/year_2023/citizen_or_spr_3/age_70_up_contribution_calculator.rb +9 -0
  14. data/lib/singapore_cpf_calculator/year_2023/citizen_or_spr_3/citizen_or_spr3_base.rb +8 -0
  15. data/lib/singapore_cpf_calculator/year_2023/citizen_or_spr_3.rb +40 -0
  16. data/lib/singapore_cpf_calculator/year_2023/spr_1_fg/age_55_below_contribution_calculator.rb +11 -0
  17. data/lib/singapore_cpf_calculator/year_2023/spr_1_fg/age_55_to_60_contribution_calculator.rb +32 -0
  18. data/lib/singapore_cpf_calculator/year_2023/spr_1_fg/age_60_to_65_contribution_calculator.rb +32 -0
  19. data/lib/singapore_cpf_calculator/year_2023/spr_1_fg/age_65_to_70_contribution_calculator.rb +32 -0
  20. data/lib/singapore_cpf_calculator/year_2023/spr_1_fg/age_70_up_contribution_calculator.rb +8 -0
  21. data/lib/singapore_cpf_calculator/year_2023/spr_1_fg.rb +40 -0
  22. data/lib/singapore_cpf_calculator/year_2023/spr_1_gg.rb +29 -0
  23. data/lib/singapore_cpf_calculator/year_2023/spr_2_fg/age_55_below_contribution_calculator.rb +11 -0
  24. data/lib/singapore_cpf_calculator/year_2023/spr_2_fg/age_55_to_60_contribution_calculator.rb +32 -0
  25. data/lib/singapore_cpf_calculator/year_2023/spr_2_fg/age_60_to_65_contribution_calculator.rb +32 -0
  26. data/lib/singapore_cpf_calculator/year_2023/spr_2_fg/age_65_to_70_contribution_calculator.rb +32 -0
  27. data/lib/singapore_cpf_calculator/year_2023/spr_2_fg/age_70_up_contribution_calculator.rb +8 -0
  28. data/lib/singapore_cpf_calculator/year_2023/spr_2_fg.rb +40 -0
  29. data/lib/singapore_cpf_calculator/year_2023/spr_2_gg.rb +29 -0
  30. data/lib/singapore_cpf_calculator/year_2023/year_2023.rb +35 -0
  31. data/lib/singapore_cpf_calculator/year_2023.rb +35 -0
  32. data/lib/singapore_cpf_calculator.rb +3 -1
  33. data/singapore_cpf_calculator.gemspec +3 -1
  34. data/spec/singapore_cpf_calculator/year_2023/citizen_or_spr_3/age_55_below_contribution_calculator_spec.rb +63 -0
  35. data/spec/singapore_cpf_calculator/year_2023/citizen_or_spr_3/age_55_to_60_contribution_calculator_spec.rb +63 -0
  36. data/spec/singapore_cpf_calculator/year_2023/citizen_or_spr_3/age_60_to_65_contribution_calculator_spec.rb +63 -0
  37. data/spec/singapore_cpf_calculator/year_2023/citizen_or_spr_3/age_65_to_70_contribution_calculator_spec.rb +63 -0
  38. data/spec/singapore_cpf_calculator/year_2023/citizen_or_spr_3/age_70_up_contribution_spec.rb +63 -0
  39. data/spec/singapore_cpf_calculator/year_2023/citizen_or_spr_3_spec.rb +242 -0
  40. data/spec/singapore_cpf_calculator/year_2023/spr_1_fg/age_55_below_contribution_calculator_spec.rb +63 -0
  41. data/spec/singapore_cpf_calculator/year_2023/spr_1_fg/age_55_to_60_contribution_calculator_spec.rb +63 -0
  42. data/spec/singapore_cpf_calculator/year_2023/spr_1_fg/age_60_to_65_contribution_calculator_spec.rb +63 -0
  43. data/spec/singapore_cpf_calculator/year_2023/spr_1_fg/age_65_to_70_contribution_calculator_spec.rb +63 -0
  44. data/spec/singapore_cpf_calculator/year_2023/spr_1_fg/age_70_up_contribution_calculator_spec.rb +63 -0
  45. data/spec/singapore_cpf_calculator/year_2023/spr_1_fg_spec.rb +176 -0
  46. data/spec/singapore_cpf_calculator/year_2023/spr_1_gg_spec.rb +158 -0
  47. data/spec/singapore_cpf_calculator/year_2023/spr_2_fg/age_55_below_contribution_calculator_spec.rb +63 -0
  48. data/spec/singapore_cpf_calculator/year_2023/spr_2_fg/age_55_to_60_contribution_calculator_spec.rb +63 -0
  49. data/spec/singapore_cpf_calculator/year_2023/spr_2_fg/age_60_to_65_contribution_calculator_spec.rb +63 -0
  50. data/spec/singapore_cpf_calculator/year_2023/spr_2_fg/age_65_to_70_contribution_calculator_spec.rb +63 -0
  51. data/spec/singapore_cpf_calculator/year_2023/spr_2_fg/age_70_up_contribution_calculator_spec.rb +63 -0
  52. data/spec/singapore_cpf_calculator/year_2023/spr_2_fg_spec.rb +176 -0
  53. data/spec/singapore_cpf_calculator/year_2023/spr_2_gg_spec.rb +158 -0
  54. data/spec/singapore_cpf_calculator/year_2023_spec.rb +193 -0
  55. data/spec/singapore_cpf_calculator_spec.rb +2 -1
  56. metadata +83 -131
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ab4079969915c3c23853647786c1c5efd8dc25d2d6a6eec899a0a1010507d4e
4
- data.tar.gz: e3f883954c14bca4c37229c775569fdb35ea0b44214ead4e3f0d47c70f707d30
3
+ metadata.gz: c5d73210cfb9f5e676f359b3cbc8b9e1c1347ac3a15f9b20b756c0cc75ff3a42
4
+ data.tar.gz: d92d6224d9ce6182f0f873fa5486a04e4bd63d77e30a8f2745a16a0eeb4a8ba7
5
5
  SHA512:
6
- metadata.gz: 5edca58bb84bb05da19a45ef8a55b24ba001f1127adbb62496248676a4bbd1851beae44b7ac462861278a951690017254ec8723c7b166bd1b718984c0b461a6f
7
- data.tar.gz: e5bd02a156326d4439ba542d7222e8a274f543ccbe43fd01c1fafe305d570dd5f06d055005f1cd34b2adbd3174440401dd96a37960bba6f6f8af2ee5186dacce
6
+ metadata.gz: 10ea4f24853e174f7eeb0919741deddbc590707d8f4257d3e39d1745477e26e60bbc5dbc2ee365354737793c84d09b3688dba97252265d0cbfd89a7720a994fb
7
+ data.tar.gz: 9addd8695942ed6eba95ee6f02558c24110325532446b0ecd079336ef53fd9cbc3933465d224bab80f608ee3287a30c09aad60e07dc4314f63306e5ce019e133
@@ -16,7 +16,8 @@ jobs:
16
16
  fail-fast: false
17
17
  matrix:
18
18
  ruby:
19
- - '3.1'
19
+ - 3.2
20
+ - 3.1
20
21
  - '3.0'
21
22
  - 2.7
22
23
  - 2.6
@@ -30,4 +31,7 @@ jobs:
30
31
  with:
31
32
  ruby-version: ${{ matrix.ruby }}
32
33
  bundler-cache: true
33
- - run: bundle exec rspec
34
+ - name: RSpec Test suite
35
+ run: bundle exec rspec
36
+ - name: Rubocop Linter
37
+ run: bundle exec rubocop
data/.rubocop.yml ADDED
@@ -0,0 +1,81 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ AllCops:
4
+ NewCops: enable
5
+
6
+ Style/StringLiterals:
7
+ Enabled: false
8
+ Layout/SpaceInsideParens:
9
+ Enabled: false
10
+ Layout/SpaceInsideStringInterpolation:
11
+ Enabled: false
12
+ Layout/EmptyLinesAroundBlockBody:
13
+ Enabled: false
14
+ Style/FrozenStringLiteralComment:
15
+ Enabled: false
16
+ Layout/SpaceInsideBlockBraces:
17
+ Enabled: false
18
+ Metrics/BlockLength:
19
+ IgnoredMethods:
20
+ - describe
21
+ - context
22
+ - foreach # CSV parsing
23
+
24
+ Layout/DotPosition:
25
+ EnforcedStyle: trailing
26
+ Enabled: true
27
+
28
+ Layout/LineLength:
29
+ Max: 120
30
+
31
+ Metrics/AbcSize:
32
+ Max: 15
33
+ IgnoredMethods:
34
+ - is_cpf_equal?
35
+ - calculated_employee_contribution
36
+ - calculated_total_contribution
37
+ - age_grouping_for_2022_and_later
38
+ - age_grouping_for_2015_and_earlier
39
+
40
+ Metrics/ClassLength:
41
+ Max: 40
42
+ Exclude:
43
+ - lib/singapore_cpf_calculator/age_group.rb
44
+ - lib/singapore_cpf_calculator/base_calculator.rb
45
+
46
+ Metrics/CyclomaticComplexity:
47
+ Max: 6
48
+ IgnoredMethods:
49
+ - is_cpf_equal?
50
+ - age_grouping_for_2015_and_earlier
51
+ - age_grouping_for_2015_and_later
52
+ - age_grouping_for_2022_and_later
53
+ - validate_params
54
+
55
+ ## Configuration parameters: CountComments, CountAsOne, ExcludedMethods, .
56
+ Metrics/MethodLength:
57
+ Max: 7
58
+ IgnoredMethods:
59
+ - is_cpf_equal?
60
+ - age_grouping_for_2015_and_earlier
61
+ - age_grouping_for_2016_and_later
62
+ - age_grouping_for_2022_and_later
63
+ - calculated_employee_contribution
64
+ - calculated_total_contribution
65
+ - calculate
66
+ - residency_modules
67
+ - validate_params
68
+
69
+ Metrics/ParameterLists:
70
+ Max: 5
71
+ Exclude:
72
+ - lib/singapore_cpf_calculator.rb
73
+
74
+ Metrics/PerceivedComplexity:
75
+ Max: 7
76
+ IgnoredMethods:
77
+ - is_cpf_equal?
78
+ - age_grouping_for_2015_and_earlier
79
+ - age_grouping_for_2015_and_later
80
+ - age_grouping_for_2022_and_later
81
+ - validate_params
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,326 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2022-03-16 01:46:16 UTC using RuboCop version 1.26.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ # This cop supports safe auto-correction (--auto-correct).
11
+ # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
12
+ # Include: **/*.gemfile, **/Gemfile, **/gems.rb
13
+ Bundler/OrderedGems:
14
+ Exclude:
15
+ - 'Gemfile'
16
+
17
+ # Offense count: 1
18
+ # Configuration parameters: Include.
19
+ # Include: **/*.gemspec
20
+ Gemspec/RequiredRubyVersion:
21
+ Exclude:
22
+ - 'singapore_cpf_calculator.gemspec'
23
+
24
+ # Offense count: 3
25
+ # This cop supports safe auto-correction (--auto-correct).
26
+ # Configuration parameters: EnforcedStyle, IndentationWidth.
27
+ # SupportedStyles: with_first_argument, with_fixed_indentation
28
+ Layout/ArgumentAlignment:
29
+ Exclude:
30
+ - 'spec/singapore_cpf_calculator_spec.rb'
31
+
32
+ # Offense count: 1
33
+ # This cop supports safe auto-correction (--auto-correct).
34
+ # Configuration parameters: EnforcedStyleAlignWith.
35
+ # SupportedStylesAlignWith: either, start_of_block, start_of_line
36
+ Layout/BlockAlignment:
37
+ Exclude:
38
+ - 'spec/singapore_cpf_calculator/year_2014/citizen_or_spr_3_spec.rb'
39
+
40
+ # Offense count: 2
41
+ # This cop supports safe auto-correction (--auto-correct).
42
+ Layout/ClosingParenthesisIndentation:
43
+ Exclude:
44
+ - 'lib/singapore_cpf_calculator/citizen_or_spr_3_common.rb'
45
+
46
+ # Offense count: 1
47
+ # This cop supports safe auto-correction (--auto-correct).
48
+ # Configuration parameters: EnforcedStyleAlignWith, Severity.
49
+ # SupportedStylesAlignWith: start_of_line, def
50
+ Layout/DefEndAlignment:
51
+ Exclude:
52
+ - 'lib/singapore_cpf_calculator/year_2022.rb'
53
+
54
+ # Offense count: 1
55
+ # This cop supports safe auto-correction (--auto-correct).
56
+ Layout/EmptyLineAfterGuardClause:
57
+ Exclude:
58
+ - 'lib/singapore_cpf_calculator.rb'
59
+
60
+ # Offense count: 1
61
+ # This cop supports safe auto-correction (--auto-correct).
62
+ Layout/EmptyLineAfterMagicComment:
63
+ Exclude:
64
+ - 'singapore_cpf_calculator.gemspec'
65
+
66
+ # Offense count: 21
67
+ # This cop supports safe auto-correction (--auto-correct).
68
+ Layout/EmptyLines:
69
+ Exclude:
70
+ - 'lib/singapore_cpf_calculator/year_2014/citizen_or_spr_3/age_50_to_55_contribution_calculator.rb'
71
+ - 'lib/singapore_cpf_calculator/year_2014/spr_1_fg/age_50_below_contribution_calculator.rb'
72
+ - 'lib/singapore_cpf_calculator/year_2015/spr_1_fg.rb'
73
+ - 'lib/singapore_cpf_calculator/year_2016/spr_1_fg.rb'
74
+ - 'spec/singapore_cpf_calculator/year_2014_spec.rb'
75
+ - 'spec/singapore_cpf_calculator/year_2015_spec.rb'
76
+ - 'spec/singapore_cpf_calculator/year_2016_spec.rb'
77
+ - 'spec/singapore_cpf_calculator/year_2022_spec.rb'
78
+
79
+ # Offense count: 230
80
+ # This cop supports safe auto-correction (--auto-correct).
81
+ # Configuration parameters: EnforcedStyle.
82
+ # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only
83
+ Layout/EmptyLinesAroundClassBody:
84
+ Enabled: false
85
+
86
+ # Offense count: 327
87
+ # This cop supports safe auto-correction (--auto-correct).
88
+ # Configuration parameters: EnforcedStyle.
89
+ # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
90
+ Layout/EmptyLinesAroundModuleBody:
91
+ Enabled: false
92
+
93
+ # Offense count: 2
94
+ # This cop supports safe auto-correction (--auto-correct).
95
+ # Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
96
+ Layout/ExtraSpacing:
97
+ Exclude:
98
+ - 'lib/singapore_cpf_calculator/year_2016/citizen_or_spr_3/age_55_to_60_contribution_calculator.rb'
99
+ - 'lib/singapore_cpf_calculator/year_2022/citizen_or_spr_3/age_55_to_60_contribution_calculator.rb'
100
+
101
+ # Offense count: 3
102
+ # This cop supports safe auto-correction (--auto-correct).
103
+ # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
104
+ # SupportedHashRocketStyles: key, separator, table
105
+ # SupportedColonStyles: key, separator, table
106
+ # SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
107
+ Layout/HashAlignment:
108
+ Exclude:
109
+ - 'spec/singapore_cpf_calculator_spec.rb'
110
+
111
+ # Offense count: 2
112
+ # This cop supports safe auto-correction (--auto-correct).
113
+ # Configuration parameters: EnforcedStyle.
114
+ # SupportedStyles: normal, indented_internal_methods
115
+ Layout/IndentationConsistency:
116
+ Exclude:
117
+ - 'lib/singapore_cpf_calculator/year_2022.rb'
118
+ - 'spec/singapore_cpf_calculator/year_2014/citizen_or_spr_3_spec.rb'
119
+
120
+ # Offense count: 2
121
+ # This cop supports safe auto-correction (--auto-correct).
122
+ # Configuration parameters: Width, IgnoredPatterns.
123
+ Layout/IndentationWidth:
124
+ Exclude:
125
+ - 'lib/singapore_cpf_calculator/year_2022.rb'
126
+
127
+ # Offense count: 4
128
+ # This cop supports safe auto-correction (--auto-correct).
129
+ Layout/LeadingEmptyLines:
130
+ Exclude:
131
+ - 'lib/singapore_cpf_calculator/spr_1_fg_common.rb'
132
+ - 'lib/singapore_cpf_calculator/spr_1_gg_common.rb'
133
+ - 'lib/singapore_cpf_calculator/spr_2_fg_common.rb'
134
+ - 'lib/singapore_cpf_calculator/spr_2_gg_common.rb'
135
+
136
+ # Offense count: 2
137
+ # This cop supports safe auto-correction (--auto-correct).
138
+ # Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator.
139
+ # SupportedStylesForExponentOperator: space, no_space
140
+ Layout/SpaceAroundOperators:
141
+ Exclude:
142
+ - 'lib/singapore_cpf_calculator/year_2016/citizen_or_spr_3/age_55_to_60_contribution_calculator.rb'
143
+ - 'lib/singapore_cpf_calculator/year_2022/citizen_or_spr_3/age_55_to_60_contribution_calculator.rb'
144
+
145
+ # Offense count: 2
146
+ # This cop supports safe auto-correction (--auto-correct).
147
+ Layout/SpaceBeforeComma:
148
+ Exclude:
149
+ - 'spec/singapore_cpf_calculator/year_2016/spr_2_gg/age_55_to_60_contribution_calculator_spec.rb'
150
+ - 'spec/singapore_cpf_calculator/year_2022/spr_2_gg/age_55_to_60_contribution_calculator_spec.rb'
151
+
152
+ # Offense count: 2
153
+ # This cop supports safe auto-correction (--auto-correct).
154
+ # Configuration parameters: EnforcedStyleForEmptyBraces.
155
+ # SupportedStyles: space, no_space, compact
156
+ # SupportedStylesForEmptyBraces: space, no_space
157
+ Layout/SpaceInsideHashLiteralBraces:
158
+ EnforcedStyle: no_space
159
+
160
+ # Offense count: 2
161
+ # This cop supports safe auto-correction (--auto-correct).
162
+ # Configuration parameters: EnforcedStyle.
163
+ # SupportedStyles: final_newline, final_blank_line
164
+ Layout/TrailingEmptyLines:
165
+ Exclude:
166
+ - 'Rakefile'
167
+ - 'lib/singapore_cpf_calculator/requirements.rb'
168
+
169
+ # Offense count: 2
170
+ # This cop supports safe auto-correction (--auto-correct).
171
+ # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods.
172
+ Lint/UnusedMethodArgument:
173
+ Exclude:
174
+ - 'lib/singapore_cpf_calculator/before_spr.rb'
175
+
176
+ # Offense count: 152
177
+ # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers.
178
+ # SupportedStyles: snake_case, normalcase, non_integer
179
+ Naming/VariableNumber:
180
+ Enabled: false
181
+
182
+ # Offense count: 1
183
+ # This cop supports safe auto-correction (--auto-correct).
184
+ Style/BlockComments:
185
+ Exclude:
186
+ - 'spec/spec_helper.rb'
187
+
188
+ # Offense count: 127
189
+ # This cop supports safe auto-correction (--auto-correct).
190
+ # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, IgnoredMethods, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
191
+ # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
192
+ # ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
193
+ # FunctionalMethods: let, let!, subject, watch
194
+ # IgnoredMethods: lambda, proc, it
195
+ Style/BlockDelimiters:
196
+ Enabled: false
197
+
198
+ # Offense count: 1
199
+ # This cop supports safe auto-correction (--auto-correct).
200
+ # Configuration parameters: EnforcedStyle.
201
+ # SupportedStyles: is_a?, kind_of?
202
+ Style/ClassCheck:
203
+ Exclude:
204
+ - 'lib/singapore_cpf_calculator/cpf_contribution.rb'
205
+
206
+ # Offense count: 14
207
+ # Configuration parameters: AllowedConstants.
208
+ Style/Documentation:
209
+ Exclude:
210
+ - 'spec/**/*'
211
+ - 'test/**/*'
212
+ - 'lib/singapore_cpf_calculator.rb'
213
+ - 'lib/singapore_cpf_calculator/requirements.rb'
214
+ - 'lib/singapore_cpf_calculator/requirements/group_50_years_and_below.rb'
215
+ - 'lib/singapore_cpf_calculator/requirements/group_55_years_and_below.rb'
216
+ - 'lib/singapore_cpf_calculator/requirements/group_above_50_to_55_years.rb'
217
+ - 'lib/singapore_cpf_calculator/requirements/group_above_55_to_60_years.rb'
218
+ - 'lib/singapore_cpf_calculator/requirements/group_above_60_to_65_years.rb'
219
+ - 'lib/singapore_cpf_calculator/requirements/group_above_65_to_70_years.rb'
220
+ - 'lib/singapore_cpf_calculator/requirements/group_above_65_years.rb'
221
+ - 'lib/singapore_cpf_calculator/requirements/group_above_70_years.rb'
222
+ - 'lib/singapore_cpf_calculator/residency_module_common.rb'
223
+ - 'lib/singapore_cpf_calculator/spr_status.rb'
224
+ - 'lib/singapore_cpf_calculator/year_2012_to_2015_aw_ceiling_module.rb'
225
+ - 'lib/singapore_cpf_calculator/year_common.rb'
226
+
227
+ # Offense count: 6
228
+ # This cop supports safe auto-correction (--auto-correct).
229
+ Style/EmptyCaseCondition:
230
+ Exclude:
231
+ - 'lib/singapore_cpf_calculator/age_group.rb'
232
+ - 'lib/singapore_cpf_calculator/base_calculator.rb'
233
+ - 'lib/singapore_cpf_calculator/spr_status.rb'
234
+
235
+ # Offense count: 1
236
+ # This cop supports safe auto-correction (--auto-correct).
237
+ # Configuration parameters: EnforcedStyle.
238
+ # SupportedStyles: empty, nil, both
239
+ Style/EmptyElse:
240
+ Exclude:
241
+ - 'lib/singapore_cpf_calculator/spr_status.rb'
242
+
243
+ # Offense count: 1
244
+ # This cop supports safe auto-correction (--auto-correct).
245
+ Style/Encoding:
246
+ Exclude:
247
+ - 'singapore_cpf_calculator.gemspec'
248
+
249
+ # Offense count: 1
250
+ # This cop supports safe auto-correction (--auto-correct).
251
+ Style/ExpandPathArguments:
252
+ Exclude:
253
+ - 'singapore_cpf_calculator.gemspec'
254
+
255
+ # Offense count: 2
256
+ # Configuration parameters: MinBodyLength.
257
+ Style/GuardClause:
258
+ Exclude:
259
+ - 'lib/singapore_cpf_calculator.rb'
260
+ - 'lib/singapore_cpf_calculator/base_calculator.rb'
261
+
262
+ # Offense count: 1
263
+ # This cop supports safe auto-correction (--auto-correct).
264
+ Style/KeywordParametersOrder:
265
+ Exclude:
266
+ - 'lib/singapore_cpf_calculator.rb'
267
+
268
+ # Offense count: 1
269
+ # This cop supports safe auto-correction (--auto-correct).
270
+ Style/LineEndConcatenation:
271
+ Exclude:
272
+ - 'spec/spec_helper.rb'
273
+
274
+ # Offense count: 1
275
+ # This cop supports safe auto-correction (--auto-correct).
276
+ # Configuration parameters: IgnoredMethods.
277
+ Style/MethodCallWithoutArgsParentheses:
278
+ Exclude:
279
+ - 'lib/singapore_cpf_calculator/base_calculator.rb'
280
+
281
+ # Offense count: 1
282
+ # This cop supports safe auto-correction (--auto-correct).
283
+ # Configuration parameters: EnforcedStyle.
284
+ # SupportedStyles: literals, strict
285
+ Style/MutableConstant:
286
+ Exclude:
287
+ - 'lib/singapore_cpf_calculator/version.rb'
288
+
289
+ # Offense count: 12
290
+ # This cop supports safe auto-correction (--auto-correct).
291
+ # Configuration parameters: AllowedMethods.
292
+ # AllowedMethods: be, be_a, be_an, be_between, be_falsey, be_kind_of, be_instance_of, be_truthy, be_within, eq, eql, end_with, include, match, raise_error, respond_to, start_with
293
+ Style/NestedParenthesizedCalls:
294
+ Exclude:
295
+ - 'spec/singapore_cpf_calculator/year_2014_spec.rb'
296
+ - 'spec/singapore_cpf_calculator/year_2015_spec.rb'
297
+ - 'spec/singapore_cpf_calculator/year_2016_spec.rb'
298
+ - 'spec/singapore_cpf_calculator/year_2022_spec.rb'
299
+
300
+ # Offense count: 24
301
+ # This cop supports safe auto-correction (--auto-correct).
302
+ # Configuration parameters: EnforcedStyleForMultiline.
303
+ # SupportedStylesForMultiline: comma, consistent_comma, no_comma
304
+ Style/TrailingCommaInArrayLiteral:
305
+ Enabled: false
306
+
307
+ # Offense count: 1
308
+ # This cop supports safe auto-correction (--auto-correct).
309
+ # Configuration parameters: MinSize, WordRegex.
310
+ # SupportedStyles: percent, brackets
311
+ Style/WordArray:
312
+ EnforcedStyle: brackets
313
+
314
+ # Offense count: 8
315
+ # This cop supports unsafe auto-correction (--auto-correct-all).
316
+ # Configuration parameters: EnforcedStyle.
317
+ # SupportedStyles: forbid_for_all_comparison_operators, forbid_for_equality_operators_only, require_for_all_comparison_operators, require_for_equality_operators_only
318
+ Style/YodaCondition:
319
+ Exclude:
320
+ - 'lib/singapore_cpf_calculator/age_group.rb'
321
+
322
+ # Offense count: 1
323
+ # This cop supports safe auto-correction (--auto-correct).
324
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
325
+ # URISchemes: http, https
326
+
data/Gemfile CHANGED
@@ -2,4 +2,3 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in singapore_cpf_calculator.gemspec
4
4
  gemspec
5
- gem 'simplecov'
data/README.md CHANGED
@@ -11,6 +11,7 @@ Central Provident Fund (CPF) contributions.
11
11
 
12
12
  ## Support
13
13
 
14
+ * [Year 2023](https://www.cpf.gov.sg/content/dam/web/employer/employer-obligations/documents/CPF%20con%20rates%20from%201%20January%202023.pdf)
14
15
  * [Year 2022](https://www.cpf.gov.sg/content/dam/web/employer/employer-obligations/documents/CPFContributionRatesTable_1Jan2022.pdf)
15
16
  * [Year 2015](http://mycpf.cpf.gov.sg/NR/rdonlyres/9F38419D-1342-4426-820E-32BA8FDE5C6D/0/CPFContributionandAllocationRatesfrom1January2015.pdf)
16
17
  * Singapore Citizens or Singapore Permanent Residents (3rd Year Onwards)
@@ -1,3 +1,3 @@
1
1
  module SingaporeCPFCalculator
2
- VERSION = "1.4.0"
2
+ VERSION = "1.5.1"
3
3
  end
@@ -12,9 +12,9 @@ module SingaporeCPFCalculator
12
12
  include YearCommon
13
13
 
14
14
  # @param [Date] date when the CPF contribution is to be calculated for.
15
- # @return [true, false] true when the date's year is 2022 and later
15
+ # @return [true, false] true when the date's year is in 2022
16
16
  def applies_to?(date)
17
- date.year >= 2022
17
+ date.year >= 2022 && date.year < 2023
18
18
  end
19
19
 
20
20
  private
@@ -0,0 +1,8 @@
1
+ module SingaporeCPFCalculator
2
+ module Year2023
3
+ module CitizenOrSPR3
4
+ class Age55BelowContributionCalculator < Year2016::CitizenOrSPR3::Age55BelowContributionCalculator
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,32 @@
1
+ module SingaporeCPFCalculator
2
+ module Year2023
3
+ module CitizenOrSPR3
4
+
5
+ # Payment calculator for Singapore's Central Provident Fund for employee's age 55 to 60.
6
+ class Age55To60ContributionCalculator < CitizenOrSpr3Base
7
+
8
+ extend Requirements::GroupAbove55To60Years
9
+
10
+ private
11
+
12
+ def tc_rate_1
13
+ "0.145"
14
+ end
15
+
16
+ def tc_rate_2
17
+ "0.295"
18
+ end
19
+
20
+ def ec_rate
21
+ "0.15"
22
+ end
23
+
24
+ def adjustment_rate
25
+ "0.45"
26
+ end
27
+
28
+ end
29
+
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,32 @@
1
+ module SingaporeCPFCalculator
2
+ module Year2023
3
+ module CitizenOrSPR3
4
+
5
+ # Payment calculator for Singapore's Central Provident Fund for employee's age 60 to 65.
6
+ class Age60To65ContributionCalculator < CitizenOrSpr3Base
7
+
8
+ extend Requirements::GroupAbove60To65Years
9
+
10
+ private
11
+
12
+ def tc_rate_1
13
+ "0.11"
14
+ end
15
+
16
+ def tc_rate_2
17
+ "0.205"
18
+ end
19
+
20
+ def ec_rate
21
+ "0.095"
22
+ end
23
+
24
+ def adjustment_rate
25
+ "0.285"
26
+ end
27
+
28
+ end
29
+
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,32 @@
1
+ module SingaporeCPFCalculator
2
+ module Year2023
3
+ module CitizenOrSPR3
4
+
5
+ # Payment calculator for Singapore's Central Provident Fund for employee's age 65~70.
6
+ class Age65To70ContributionCalculator < CitizenOrSpr3Base
7
+
8
+ extend Requirements::GroupAbove65To70Years
9
+
10
+ private
11
+
12
+ def tc_rate_1
13
+ "0.085"
14
+ end
15
+
16
+ def tc_rate_2
17
+ "0.155"
18
+ end
19
+
20
+ def ec_rate
21
+ "0.07"
22
+ end
23
+
24
+ def adjustment_rate
25
+ "0.21"
26
+ end
27
+
28
+ end
29
+
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,9 @@
1
+ module SingaporeCPFCalculator
2
+ module Year2023
3
+ module CitizenOrSPR3
4
+ # Payment calculator for Singapore's Central Provident Fund for employee's age 70 and above.
5
+ class Age70UpContributionCalculator < Year2022::CitizenOrSPR3::Age70UpContributionCalculator
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,8 @@
1
+ module SingaporeCPFCalculator
2
+ module Year2023
3
+ module CitizenOrSPR3
4
+ class CitizenOrSpr3Base < Year2016::Base
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,40 @@
1
+ require_relative 'citizen_or_spr_3/citizen_or_spr3_base'
2
+ require_relative "citizen_or_spr_3/age_55_below_contribution_calculator"
3
+ require_relative "citizen_or_spr_3/age_55_to_60_contribution_calculator"
4
+ require_relative "citizen_or_spr_3/age_60_to_65_contribution_calculator"
5
+ require_relative "citizen_or_spr_3/age_65_to_70_contribution_calculator"
6
+ require_relative "citizen_or_spr_3/age_70_up_contribution_calculator"
7
+
8
+ module SingaporeCPFCalculator
9
+ module Year2023
10
+
11
+ # Residency module for Singaporean Citizen and Permanent Residents on their 3rd year.
12
+ module CitizenOrSPR3
13
+
14
+ extend ResidencyModuleCommon
15
+ extend CitizenOrSPR3Common
16
+
17
+ class << self
18
+
19
+ private
20
+
21
+ def has_70_up
22
+ true
23
+ end
24
+
25
+ def calculators
26
+ [
27
+ Age55BelowContributionCalculator,
28
+ Age55To60ContributionCalculator,
29
+ Age60To65ContributionCalculator,
30
+ Age65To70ContributionCalculator,
31
+ Age70UpContributionCalculator,
32
+ ]
33
+ end
34
+
35
+ end
36
+
37
+ end
38
+
39
+ end
40
+ end
@@ -0,0 +1,11 @@
1
+ module SingaporeCPFCalculator
2
+ module Year2023
3
+ module SPR1FG
4
+
5
+ # Payment calculator for Singapore's Central Provident Fund for employee's age 50 and below.
6
+ class Age55BelowContributionCalculator < Year2016::SPR1FG::Age55BelowContributionCalculator
7
+ end
8
+
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,32 @@
1
+ module SingaporeCPFCalculator
2
+ module Year2023
3
+ module SPR1FG
4
+
5
+ # Payment calculator for Singapore's Central Provident Fund for employee's age 55 to 60.
6
+ class Age55To60ContributionCalculator < Year2016::Base
7
+
8
+ extend Requirements::GroupAbove55To60Years
9
+
10
+ private
11
+
12
+ def tc_rate_1
13
+ "0.145"
14
+ end
15
+
16
+ def tc_rate_2
17
+ "0.195"
18
+ end
19
+
20
+ def ec_rate
21
+ "0.05"
22
+ end
23
+
24
+ def adjustment_rate
25
+ "0.15"
26
+ end
27
+
28
+ end
29
+
30
+ end
31
+ end
32
+ end