ecoportal-api-v2 2.0.8 → 2.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 56339cf5002076d4308e6948c31a5f580eea1e6ebe526df75b8b419d4c405ed1
4
- data.tar.gz: 9d55dc7bea7782bb0edd9aedbae6c42d36844c09f5acc0136c43ea090cb63a9c
3
+ metadata.gz: 5640c86f2f87990f7d4c3906f4732ee196b757966c3c3cc08f0a87e458ccb4a5
4
+ data.tar.gz: c90366a05f7c35fc77a0d8374384258277092e9d7b3ee25f458ab815a41162ce
5
5
  SHA512:
6
- metadata.gz: 623cae68b91271a72b7375aca1987d87b05a3393721a6322b8aead8f28973bc39f5bd99cc2a7d1eb4f3bcdfb78031b99158f99efad1f4f1b12a9ddaf65448e9e
7
- data.tar.gz: 292fba88900b90ea513271253b3d066297f0bd3e8f07e4ca23f2092067b9457f9608bec8574620356cef8cf9ed16d7657c137f985eb0f5206038c02f39a7b7c8
6
+ metadata.gz: 2aa98c2d721ff735425e9c21aee036698e5467a3c010e35d84921d9352ae12400f627c8a2a16359177ac22e583a417b05302c852b513b3d6d6bc4743b8cac170
7
+ data.tar.gz: f356407dfd38797be43f29ad02d7a1772c7136cf1d686eb2554dc226316184aa70e27c89b9de39d52725ab6b95505149a1d7b38a39897915862d8a0dfa33e3ca
data/.rubocop.yml CHANGED
@@ -29,6 +29,11 @@ Style/ConditionalAssignment:
29
29
  Enabled: false
30
30
  Style/BlockDelimiters:
31
31
  BracesRequiredMethods: ['log']
32
+ Style/HashSyntax:
33
+ EnforcedShorthandSyntax: either
34
+ EnforcedStyle: no_mixed_keys
35
+ Style/ArgumentsForwarding:
36
+ UseAnonymousForwarding: false
32
37
  Style/ClassAndModuleChildren:
33
38
  Enabled: false
34
39
  Style/FrozenStringLiteralComment:
@@ -92,3 +97,5 @@ Naming/MethodParameterName:
92
97
  AllowedNames: ['x', 'y', 'i', 'j', 'id', 'io']
93
98
  Naming/RescuedExceptionsVariableName:
94
99
  Enabled: false
100
+ Naming/BlockForwarding:
101
+ Enabled: false
data/CHANGELOG.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
- ## [2.0.9] - 2024-08-xx
5
+ ## [2.0.10] - 2024-08-xx
6
6
 
7
7
  ### Added
8
8
 
@@ -10,7 +10,11 @@ All notable changes to this project will be documented in this file.
10
10
 
11
11
  ### Fixed
12
12
 
13
- - Force to load via `ecoportal/api-v2`
13
+ ## [2.0.9] - 2024-08-22
14
+
15
+ ### Added
16
+
17
+ - `force_complete` stage tasks
14
18
 
15
19
  ## [2.0.8] - 2024-08-08
16
20
 
@@ -41,19 +41,23 @@ module Ecoportal
41
41
  type == 'review_page'
42
42
  end
43
43
 
44
- def complete!
45
- return mark_as_submit if fill_in?
46
- return mark_as_sign_off if review?
44
+ def complete!(force: false)
45
+ return mark_as_submit(force: force) if fill_in?
46
+ return mark_as_sign_off(force: force) if review?
47
47
  end
48
48
 
49
49
  private
50
50
 
51
- def mark_as_submit
52
- doc['submitted'] = true
51
+ def mark_as_submit(force: false)
52
+ return doc['submitted'] = true unless force
53
+
54
+ doc['forced_complete'] = true
53
55
  end
54
56
 
55
- def mark_as_sign_off
56
- doc['sign_off'] = true
57
+ def mark_as_sign_off(force: false)
58
+ return doc['sign_off'] = true unless force
59
+
60
+ doc['forced_complete'] = true
57
61
  end
58
62
  end
59
63
  end
@@ -66,13 +66,17 @@ module Ecoportal
66
66
  msg.empty?? true : msg
67
67
  end
68
68
 
69
- def mark_as_submit
70
- tasks.fill_in(active: true).each(&:complete!)
69
+ def mark_as_submit(force: false)
70
+ tasks.fill_in(active: true).each do |task|
71
+ task.complete!(force: force)
72
+ end
71
73
  end
72
74
  alias_method :submit!, :mark_as_submit
73
75
 
74
- def mark_as_sign_off
75
- tasks.review(active: true).each(&:complete!)
76
+ def mark_as_sign_off(force: false)
77
+ tasks.review(active: true).each do |task|
78
+ task.complete!(force: force)
79
+ end
76
80
  end
77
81
  alias_method :sign_off!, :mark_as_sign_off
78
82
  end
@@ -1,5 +1,5 @@
1
1
  module Ecoportal
2
2
  module API
3
- GEM2_VERSION = '2.0.8'.freeze
3
+ GEM2_VERSION = '2.0.9'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecoportal-api-v2
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.8
4
+ version: 2.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-07 00:00:00.000000000 Z
11
+ date: 2024-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry