ecoportal-api-v2 2.0.8 → 2.0.10

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: 3df004ef45ea643952802e19774bfaa2f6941ea21904f5d28a00fa0eb4a252a1
4
+ data.tar.gz: e491e2111d01d551225289e91a32129ee1dd91638951315429b6598a0ca872ad
5
5
  SHA512:
6
- metadata.gz: 623cae68b91271a72b7375aca1987d87b05a3393721a6322b8aead8f28973bc39f5bd99cc2a7d1eb4f3bcdfb78031b99158f99efad1f4f1b12a9ddaf65448e9e
7
- data.tar.gz: 292fba88900b90ea513271253b3d066297f0bd3e8f07e4ca23f2092067b9457f9608bec8574620356cef8cf9ed16d7657c137f985eb0f5206038c02f39a7b7c8
6
+ metadata.gz: 3dabbbe1c8c62ba1aef3f632e8d2cf38b468699c5a6e6eb6dd5d052a2a206ff81d8d60a4cee0a01263a90c7a8ba11c6531a484b647069d9008410c8e9966819f
7
+ data.tar.gz: cf999bb89aa0d15b4f210fa11e6ae7cf44efe780434a7cc35acaaa7df49e3a7a107f08ca43e832661a8236b87ecc8654433f1374014e70725675ee1af513bb47
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,15 +2,23 @@
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-10-01
6
6
 
7
7
  ### Added
8
8
 
9
+ - development dependency: `rubocop`
10
+
9
11
  ### Changed
10
12
 
13
+ - upgraded core `ecoportal-api` **gem** dependency
14
+
11
15
  ### Fixed
12
16
 
13
- - Force to load via `ecoportal/api-v2`
17
+ ## [2.0.9] - 2024-08-22
18
+
19
+ ### Added
20
+
21
+ - `force_complete` stage tasks
14
22
 
15
23
  ## [2.0.8] - 2024-08-08
16
24
 
data/README.md CHANGED
@@ -1,5 +1,3 @@
1
- **Originally ---> 'ecoportal-api-oozes'**
2
-
3
1
  # Ecoportal::API::V2
4
2
 
5
3
  This is a basic collection of helpers that can be used to interact with the
@@ -15,12 +13,11 @@ gem 'ecoportal-api-v2', require: %w[ecoportal/api-v2]
15
13
 
16
14
  And then execute:
17
15
 
18
- $ bundle
16
+ bundle
19
17
 
20
18
  Or install it yourself as:
21
19
 
22
- $ gem install ecoportal-api-v2
23
-
20
+ gem install ecoportal-api-v2
24
21
 
25
22
  ## Changelog
26
23
 
data/Rakefile CHANGED
@@ -1,5 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
+ require 'rubocop/rake_task'
3
4
  require "yard"
4
5
  require "redcarpet"
5
6
 
@@ -16,12 +17,20 @@ RSpec::Core::RakeTask.new(:spec_fast) do |task|
16
17
  task.rspec_opts = ['--fail-fast', '--backtrace']
17
18
  end
18
19
 
20
+ desc "run rubocop diaplying cop names"
21
+ RuboCop::RakeTask.new(:rubocop) do |t|
22
+ t.options = ['--display-cop-names']
23
+ end
24
+
19
25
  # default task name is yard
20
26
  desc "Yard: generate all the documentation"
21
27
  YARD::Rake::YardocTask.new(:doc) do |t|
22
28
  #t.files = ['lib/**/*.rb']
23
29
  end
24
30
 
25
- task :default => [:spec]
26
- task :rspec_trace => :spec_trace
27
- task :rspec_fast => :spec_fast
31
+ desc "default task: runs rubocop and rspec"
32
+ task :default do
33
+ Rake::Task[:rubocop].invoke
34
+ ensure
35
+ Rake::Task[:spec].invoke
36
+ end
@@ -1,12 +1,14 @@
1
+ # rubocop:disable Gemspec/DevelopmentDependencies
1
2
  lib = File.expand_path('lib', __dir__)
2
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require "ecoportal/api/v2_version"
4
+
5
+ require 'ecoportal/api/v2_version'
4
6
 
5
7
  Gem::Specification.new do |spec|
6
- spec.name = "ecoportal-api-v2"
8
+ spec.name = 'ecoportal-api-v2'
7
9
  spec.version = Ecoportal::API::GEM2_VERSION
8
- spec.authors = ["Oscar Segura"]
9
- spec.email = ["rien@ecoportal.co.nz", "oscar@ecoportal.co.nz", "bozydar@ecoportal.co.nz"]
10
+ spec.authors = ['Oscar Segura']
11
+ spec.email = ['oscar@ecoportal.co.nz']
10
12
 
11
13
  spec.summary = "A collection of helpers for interacting with the ecoPortal MS's V2 API"
12
14
  spec.homepage = "https://www.ecoportal.com"
@@ -19,16 +21,20 @@ Gem::Specification.new do |spec|
19
21
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
20
22
  f.match(%r{^(test|spec|features)/})
21
23
  end
22
- spec.bindir = "exe"
24
+ spec.bindir = 'exe'
23
25
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
- spec.require_paths = ["lib"]
26
+ spec.require_paths = ['lib']
25
27
 
26
- spec.add_development_dependency "pry" , '~> 0.14'
27
- spec.add_development_dependency "rake", '>= 13.0.3', "< 14"
28
- spec.add_development_dependency "redcarpet", '>= 3.6.0', "< 4"
29
- spec.add_development_dependency "rspec", '>= 3.12.0', "< 4"
30
- spec.add_development_dependency "yard", '~> 0.9.34'
28
+ spec.add_development_dependency 'pry' , '~> 0.14'
29
+ spec.add_development_dependency 'rake', '>= 13.0.3', '< 14'
30
+ spec.add_development_dependency 'redcarpet', '>= 3.6.0', '< 4'
31
+ spec.add_development_dependency 'rspec', '>= 3.12.0', '< 4'
32
+ spec.add_development_dependency 'rubocop', '~> 1'
33
+ spec.add_development_dependency 'rubocop-rake', '~> 0'
34
+ spec.add_development_dependency 'yard', '~> 0.9'
31
35
 
32
- spec.add_dependency 'ecoportal-api', '~> 0.10'
33
- spec.add_dependency 'mime-types', '~> 3.5', '>= 3.5.2'
36
+ spec.add_dependency 'ecoportal-api', '~> 0.10', '>= 0.10.2'
37
+ spec.add_dependency 'mime-types', '~> 3.5', '>= 3.5.2'
34
38
  end
39
+
40
+ # rubocop:enable Gemspec/DevelopmentDependencies
@@ -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.10'.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.10
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-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -84,20 +84,48 @@ dependencies:
84
84
  - - "<"
85
85
  - !ruby/object:Gem::Version
86
86
  version: '4'
87
+ - !ruby/object:Gem::Dependency
88
+ name: rubocop
89
+ requirement: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - "~>"
92
+ - !ruby/object:Gem::Version
93
+ version: '1'
94
+ type: :development
95
+ prerelease: false
96
+ version_requirements: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - "~>"
99
+ - !ruby/object:Gem::Version
100
+ version: '1'
101
+ - !ruby/object:Gem::Dependency
102
+ name: rubocop-rake
103
+ requirement: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - "~>"
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ type: :development
109
+ prerelease: false
110
+ version_requirements: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - - "~>"
113
+ - !ruby/object:Gem::Version
114
+ version: '0'
87
115
  - !ruby/object:Gem::Dependency
88
116
  name: yard
89
117
  requirement: !ruby/object:Gem::Requirement
90
118
  requirements:
91
119
  - - "~>"
92
120
  - !ruby/object:Gem::Version
93
- version: 0.9.34
121
+ version: '0.9'
94
122
  type: :development
95
123
  prerelease: false
96
124
  version_requirements: !ruby/object:Gem::Requirement
97
125
  requirements:
98
126
  - - "~>"
99
127
  - !ruby/object:Gem::Version
100
- version: 0.9.34
128
+ version: '0.9'
101
129
  - !ruby/object:Gem::Dependency
102
130
  name: ecoportal-api
103
131
  requirement: !ruby/object:Gem::Requirement
@@ -105,6 +133,9 @@ dependencies:
105
133
  - - "~>"
106
134
  - !ruby/object:Gem::Version
107
135
  version: '0.10'
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: 0.10.2
108
139
  type: :runtime
109
140
  prerelease: false
110
141
  version_requirements: !ruby/object:Gem::Requirement
@@ -112,6 +143,9 @@ dependencies:
112
143
  - - "~>"
113
144
  - !ruby/object:Gem::Version
114
145
  version: '0.10'
146
+ - - ">="
147
+ - !ruby/object:Gem::Version
148
+ version: 0.10.2
115
149
  - !ruby/object:Gem::Dependency
116
150
  name: mime-types
117
151
  requirement: !ruby/object:Gem::Requirement
@@ -134,9 +168,7 @@ dependencies:
134
168
  version: 3.5.2
135
169
  description:
136
170
  email:
137
- - rien@ecoportal.co.nz
138
171
  - oscar@ecoportal.co.nz
139
- - bozydar@ecoportal.co.nz
140
172
  executables: []
141
173
  extensions: []
142
174
  extra_rdoc_files: []
@@ -270,7 +302,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
270
302
  - !ruby/object:Gem::Version
271
303
  version: '0'
272
304
  requirements: []
273
- rubygems_version: 3.5.6
305
+ rubygems_version: 3.5.18
274
306
  signing_key:
275
307
  specification_version: 4
276
308
  summary: A collection of helpers for interacting with the ecoPortal MS's V2 API