ecoportal-api-v2 3.3.1 → 3.3.6

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
  SHA256:
3
- metadata.gz: 3bec4b516ab8e7355727c70598185b370f0165e944bae0cde0e852d94d80be95
4
- data.tar.gz: eb74199d7ea533a76b03b0db49f2260d6627c2c123538b5198ab504c2eec5a29
3
+ metadata.gz: 8804921ca6b6893fba5d2f775b2718bcbd8c7e23e840224ea792f8a11265951d
4
+ data.tar.gz: e0c1c47bd24c02bce9c729b3a5ac67bf246e07e726d9f218ae093ff4d5dfb1a7
5
5
  SHA512:
6
- metadata.gz: d787c2dab1e01fa783f1612193e1ae4c07a6c2fb131208de512cd48f8f30080c1c9c9816eba0738a14627d5af6b7c592e8dc606af5a809df2318f398fef37238
7
- data.tar.gz: aaa1fa2d08bde158aae7142673c497f7c0347fac765cc0cf397a209a8b7d6492cfdb1312767228f1b4ca83fb5c0db024099a1e2ba69b8b68ec92764e7e470c55
6
+ metadata.gz: 186d61f92d3d47212eb80bc16dc59b83d3fa2bd9c030c353e8098b837759a33464b6edb59d15842f69e797ae5d46a0a193d251ff5b28fd6bc9ff54aa64b9f418
7
+ data.tar.gz: b5741a4223c50560cff05dfa95f87e718b540016fb10faf5190998af91bac4ddbb0f12dea2a63c7fe35305e95976480f086da0beff52435d4f89237c6affa25f
data/CHANGELOG.md CHANGED
@@ -2,14 +2,97 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
- ## [3.3.2] - 2025-06-xx
5
+ ## [3.3.6] - 2026-09-30
6
+
7
+ ### Fixed
8
+
9
+ - **`Benchmarkable#memory_usage` crashed with `NoMethodError: undefined method 'chop' for nil`
10
+ on modern Windows.** The Windows branch shelled out to `wmic`, which has been deprecated and
11
+ removed from current Windows (Win 11 24H2 / Server 2025). A backtick to a missing command
12
+ returns an EMPTY string, not `nil`, so the `return 0 unless wmem` guard never fired;
13
+ `"".lines.first` is `nil`, and `nil.chop` raised. Because benchmarking wraps ordinary
14
+ operations (e.g. every `graphql.pages.get` in downstream `ecoportal-api-graphql`/`eco-helpers`
15
+ flows), the crash surfaced as a bogus "page not found" on EVERY page fetch on such a host,
16
+ with no real relation to the page or its permissions. `memory_usage` now guards nil AND empty,
17
+ falls back to `Get-CimInstance` (`wmic`'s PowerShell successor), and returns 0 when no reading
18
+ is available -- benchmarking never crashes the operation it wraps. Adds
19
+ `spec/ecoportal/api/common/concerns/benchmarkable_spec.rb` pinning the never-raise invariant
20
+ and the empty-`wmic`-output case.
21
+
22
+ - **`spec.files` allowlisted by root directory, not by full path.** The `3.3.4` fix replaced a
23
+ denylist with `f.start_with?('lib/', 'exe/')`, which stops a new top-level directory from
24
+ shipping but says nothing about what a file under `lib/` actually IS. `ecoportal-api-graphql`
25
+ hit exactly that blind spot in its `2.2.0` build, shipping five `CLAUDE.md` files that lived
26
+ inside its `lib/` tree under the equivalent rule. This gem was never caught leaking that way --
27
+ `git ls-files lib/ | grep -v '\.rb$'` is empty today -- but the same root-keyed rule sat here
28
+ too, so it is hardened pre-emptively rather than waiting for its own incident: `spec.files` now
29
+ requires both the `lib/` prefix and a `.rb` extension, still intersected with `git ls-files`.
30
+ Adds `spec/packaging_spec.rb` to pin the allowlist against regression.
31
+
32
+ ### Security
33
+
34
+ - Removes customer and internal identifiers from this changelog (shipped code comments re-scanned: clean). The
35
+ published `3.3.4` and `3.3.5` changelogs named a customer, and `3.3.2` shipped an internal
36
+ notes file; `3.3.6` is the clean replacement so those versions can be yanked. No code or
37
+ dependency change beyond the fixes above -- drop-in for `~> 3.3, >= 3.3.5`.
38
+
39
+ ## [3.3.5] - 2026-08-20
40
+
41
+ ### Fixed
42
+
43
+ - **`ClassHelpers#to_time` rescued a constant that does not exist.** The rescue clause read
44
+ `ArgumentArgument`, which appears nowhere in this gem, so the documented `exception: false`
45
+ mode could never work: a failed `Time.parse` raised
46
+ `NameError: uninitialized constant ...ClassHelpers::ArgumentArgument` while Ruby resolved the
47
+ rescue, instead of returning `nil`. Downstream, `ecoportal-api-graphql`'s models inherit this
48
+ helper through DoubleModel, so a null or object-shaped date reaching a `passdate` field
49
+ surfaced as that NameError rather than as nil or a clean `ArgumentError`.
50
+ Adds `spec/ecoportal/api/common/content/class_helpers_spec.rb` -- the first spec that file has
51
+ had -- covering both modes, `Time`/`nil` pass-through and `Date` conversion. The guard was
52
+ verified by re-introducing the typo, which fails the suite with exactly that NameError.
6
53
 
7
54
  ### Added
8
55
 
9
- ### Changed
56
+ - **CI runs on merge requests.** `.gitlab-ci.yml` previously carried only the `epai:sync`
57
+ include, whose rules exclude MR pipelines, so a merge request produced a pipeline with zero
58
+ jobs -- which GitLab does not create at all. With "only allow merge if pipeline succeeds"
59
+ enabled, every MR was blocked on a pipeline that could not exist. Now: `workflow:` rules that
60
+ admit `merge_request_event`, `rspec` blocking, `rubocop` non-blocking while four pre-existing
61
+ offences remain in `class_helpers.rb`.
62
+
63
+ ## [3.3.4] - 2026-08-13
64
+
65
+ ### Fixed
66
+
67
+ - Packaging-only republish with the allowlisted gemspec. `3.3.3` shipped internal repository
68
+ content (internal AI-tooling notes and editor settings) to rubygems.org via the
69
+ old denylist `spec.files`. `3.3.4` is the identical `lib/` code packaged clean; `3.3.3` will
70
+ be yanked.
71
+
72
+ ## [3.3.3] - 2026-07-05
10
73
 
11
74
  ### Fixed
12
75
 
76
+ - **`_cascaded_attributes_trace` — Ruby 3.x block-param order (TypeError crash).** In
77
+ `DoubleModel::Attributable::Nesting::CascadedCallback`, `_cascaded_attributes.each.with_object(out_trace)`
78
+ yields `(element, memo)`, but the block read them swapped (`|out, (attribute, obj_k)|`), so
79
+ `(attribute, obj_k)` destructured the **accumulator hash** and `attribute` became the trace `Hash` →
80
+ `send(<hash>)` raised `"… is not a symbol nor a string" (TypeError)` on **any** cascaded operation
81
+ (e.g. `Diffable#as_update` / `DiffService`) over a model with nested attributes. Latent because
82
+ Ruby 2.x tolerated the arg order; fatal under Ruby 3.x (crashed a live customer integration
83
+ via the `ecoportal-api-graphql` consumer). Swapped to `|(attribute, obj_k), out|` (commit `6a2b1b5`).
84
+ **Regression spec added** (`spec/…/double_model_spec.rb`).
85
+
86
+ ## [3.3.2] - 2026-06-05
87
+
88
+ ### Added
89
+
90
+ - **AI**: instructions
91
+
92
+ ### Changed
93
+
94
+ - upgraded `ecoportal-api` gem.
95
+
13
96
  ## [3.3.1] - 2025-06-11
14
97
 
15
98
  ### Changed
data/README.md CHANGED
@@ -1,7 +1,57 @@
1
1
  # Ecoportal::API::V2
2
2
 
3
- This is a basic collection of helpers that can be used to interact with the
4
- [ecoPortal](https://www.ecoportal.com) `APIv2`
3
+ ## Why this repo exists
4
+
5
+ This gem holds the **base models for GraphQL** -- the `DoubleModel` / `CollectionModel`
6
+ class-holder layer under `lib/ecoportal/api/common/content/` -- and it is
7
+ `ecoportal-api-graphql`'s pinned runtime dependency: its `Common::GraphQL::Model`
8
+ subclasses `Ecoportal::API::Common::Content::DoubleModel` directly.
9
+
10
+ In the owner's words (2026-09-24):
11
+
12
+ > "contains base models for GraphQL and must be documented, but excluding the api_v2
13
+ > part... as that is deprecated... this gem will become a DoubleModel class holder gem
14
+ > once we removed all the APIv2 stuff... and we will repurpose the repo :)"
15
+
16
+ ### What stays and matters
17
+
18
+ The `Ecoportal::API::Common::Content` base-model infrastructure, under
19
+ `lib/ecoportal/api/common/content/`:
20
+
21
+ - `DoubleModel` -- the foundational two-layer (live doc + patch doc) model abstraction;
22
+ almost all V2 models, and `ecoportal-api-graphql`'s `Common::GraphQL::Model`, inherit
23
+ from it.
24
+ - `CollectionModel` / `ArrayModel` -- ordered collections with upsert/delete/mutation
25
+ support.
26
+ - `ClassHelpers`, `DocHelpers`, `ModelHelpers`, `IncluderHelpers` -- supporting mixins
27
+ for model construction.
28
+
29
+ ### Deprecated -- do not build on
30
+
31
+ The `Ecoportal::API::V2` REST client namespace (`lib/ecoportal/api/v2/`: `page`,
32
+ `pages`, `people`, `registers`, `s3`) is the APIv2 REST client. It is **deprecated** and
33
+ being removed. Once it is gone, this gem becomes a pure `DoubleModel` class-holder gem
34
+ and the repo will be repurposed (name/scope not yet decided by the owner). The owner
35
+ flagged the same likely fate, tentatively, for `ecoportal-api` (its v0/v1 APIs are
36
+ deprecated and due to retire soon) -- not yet ruled, and out of scope here.
37
+
38
+ ### Who uses it
39
+
40
+ `ecoportal-api-graphql` depends on this gem for its base-model layer; `eco-helpers`
41
+ (the team's central integrations library) sits downstream of both.
42
+
43
+ ```mermaid
44
+ flowchart LR
45
+ A["ecoportal-api-v2<br/>Common::Content::DoubleModel"] --> B[ecoportal-api-graphql]
46
+ B --> C[eco-helpers]
47
+ ```
48
+ *Source: `CLAUDE.md` dependency chain + owner ruling, 2026-09-24.*
49
+
50
+ ### Current state
51
+
52
+ The APIv2 client removal and repo repurposing have not started; this section records
53
+ intent so the owner does not need to re-explain it. See `TODO.md` (`DOC-ROADMAP-1`,
54
+ `DOC-WHY-1`) for the tracked work.
5
55
 
6
56
  ## Installation
7
57
 
@@ -16,6 +16,7 @@ module Ecoportal
16
16
 
17
17
  def benchmarking(ref = nil, units: 1, print: false, &block)
18
18
  return yield unless benchmark_enabled?
19
+
19
20
  benchmark_mem(ref, units: units, print: false) do
20
21
  benchmark_time(ref, units: units, print: false, &block)
21
22
  end.tap do
@@ -155,17 +156,42 @@ module Ecoportal
155
156
  [parts[..-2].join(", "), parts.last].join(" and ")
156
157
  end
157
158
 
158
- # @return [Integer] total memory used by this process in KB
159
+ # @note Benchmarking must never crash the operation it wraps. When a memory
160
+ # reading cannot be obtained -- most notably on modern Windows, where `wmic`
161
+ # has been deprecated and removed (Win 11 24H2 / Server 2025) -- this returns
162
+ # 0 rather than raising. A failed backtick spawn yields an EMPTY string (not
163
+ # nil), so a bare `unless wmem` never guarded it and `"".lines.first` was nil,
164
+ # raising `NoMethodError: undefined method 'chop' for nil` on every wrapped call.
165
+ # @return [Float, Integer] total memory used by this process in KB, or 0 when unavailable
159
166
  def memory_usage
160
167
  if Gem.win_platform?
161
- wmem = `wmic process where processid=#{Process.pid} get WorkingSetSize | findstr "[0-9]"`
162
- return 0 unless wmem
163
-
164
- wmem.lines.first.chop.strip.to_i / 1024.0
168
+ windows_memory_usage
165
169
  else
166
170
  `ps -o rss= -p #{Process.pid}`.to_i
167
171
  end
168
172
  end
173
+
174
+ # Windows working-set in KB. Tries `wmic` (legacy) then `Get-CimInstance`
175
+ # (its PowerShell successor); returns 0 if neither is available. Never raises.
176
+ # @return [Float, Integer]
177
+ def windows_memory_usage
178
+ bytes = windows_working_set_bytes
179
+ bytes.positive? ? bytes / 1024.0 : 0
180
+ end
181
+
182
+ # @return [Integer] process working-set size in bytes, or 0 when unavailable
183
+ def windows_working_set_bytes
184
+ wmem = `wmic process where processid=#{Process.pid} get WorkingSetSize 2>NUL | findstr "[0-9]"`
185
+ line = wmem.to_s.lines.first
186
+ return line.strip.to_i if line && !line.strip.empty?
187
+
188
+ filter = "ProcessId=#{Process.pid}"
189
+ cmd = "(Get-CimInstance Win32_Process -Filter '#{filter}').WorkingSetSize"
190
+ ps = `powershell -NoProfile -Command "#{cmd}" 2>NUL`
191
+ ps.to_s.strip.to_i
192
+ rescue StandardError
193
+ 0
194
+ end
169
195
  end
170
196
  end
171
197
  end
@@ -99,7 +99,7 @@ module Ecoportal
99
99
  when String
100
100
  begin
101
101
  Time.parse(value)
102
- rescue ArgumentArgument
102
+ rescue ArgumentError
103
103
  raise if exception
104
104
  nil
105
105
  end
@@ -178,7 +178,7 @@ module Ecoportal::API::Common::Content::DoubleModel::Attributable::Nesting
178
178
  nested_attrs: _cascaded_attributes.keys,
179
179
  attributes: {}
180
180
  }.merge(trace || {}).tap do |out_trace|
181
- _cascaded_attributes.each.with_object(out_trace) do |out, (attribute, obj_k)|
181
+ _cascaded_attributes.each.with_object(out_trace) do |(attribute, obj_k), out|
182
182
  next unless (obj = send(attribute))
183
183
 
184
184
  obj_k_path = key_path.dup.push(obj_k)
@@ -35,6 +35,7 @@ module Ecoportal
35
35
  def as_json
36
36
  doc
37
37
  end
38
+ alias_method :to_h, :as_json
38
39
 
39
40
  def print_pretty
40
41
  puts JSON.pretty_generate(as_json)
@@ -3,7 +3,9 @@ module Ecoportal
3
3
  class V2
4
4
  class S3
5
5
  class Files
6
- # Class service to upload multiple files in one go
6
+ # Class service to upload multiple files in one go.
7
+ # Full cycle: from local files to the org file manager.
8
+ # @note it uploads to S3, and converts it into a file container as well.
7
9
  class BatchUpload
8
10
  include Ecoportal::API::Common::Concerns::Benchmarkable
9
11
  include Ecoportal::API::Common::Concerns::Threadable
@@ -1,5 +1,5 @@
1
1
  module Ecoportal
2
2
  module API
3
- GEM2_VERSION = '3.3.1'.freeze
3
+ GEM2_VERSION = '3.3.6'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecoportal-api-v2
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.1
4
+ version: 3.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-06-11 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: pry
@@ -135,7 +134,7 @@ dependencies:
135
134
  version: '0.10'
136
135
  - - ">="
137
136
  - !ruby/object:Gem::Version
138
- version: 0.10.12
137
+ version: 0.10.16
139
138
  type: :runtime
140
139
  prerelease: false
141
140
  version_requirements: !ruby/object:Gem::Requirement
@@ -145,7 +144,7 @@ dependencies:
145
144
  version: '0.10'
146
145
  - - ">="
147
146
  - !ruby/object:Gem::Version
148
- version: 0.10.12
147
+ version: 0.10.16
149
148
  - !ruby/object:Gem::Dependency
150
149
  name: mime-types
151
150
  requirement: !ruby/object:Gem::Requirement
@@ -166,27 +165,15 @@ dependencies:
166
165
  - - ">="
167
166
  - !ruby/object:Gem::Version
168
167
  version: 3.5.2
169
- description:
170
168
  email:
171
169
  - oscar@ecoportal.co.nz
172
170
  executables: []
173
171
  extensions: []
174
172
  extra_rdoc_files: []
175
173
  files:
176
- - ".gitignore"
177
- - ".markdownlint.json"
178
- - ".rspec"
179
- - ".rubocop.yml"
180
- - ".ruby-version"
181
- - ".yardopts"
182
174
  - CHANGELOG.md
183
- - Gemfile
184
175
  - LICENSE
185
176
  - README.md
186
- - Rakefile
187
- - bin/console
188
- - bin/setup
189
- - ecoportal-api-v2.gemspec
190
177
  - lib/ecoportal/api-v2.rb
191
178
  - lib/ecoportal/api/common.v2.rb
192
179
  - lib/ecoportal/api/common/concerns.rb
@@ -334,7 +321,6 @@ licenses:
334
321
  - MIT
335
322
  metadata:
336
323
  rubygems_mfa_required: 'true'
337
- post_install_message:
338
324
  rdoc_options: []
339
325
  require_paths:
340
326
  - lib
@@ -349,8 +335,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
349
335
  - !ruby/object:Gem::Version
350
336
  version: '0'
351
337
  requirements: []
352
- rubygems_version: 3.5.23
353
- signing_key:
338
+ rubygems_version: 4.0.8
354
339
  specification_version: 4
355
340
  summary: A collection of helpers for interacting with the ecoPortal MS's V2 API
356
341
  test_files: []
data/.gitignore DELETED
@@ -1,23 +0,0 @@
1
- # it's a gem, ignore the lockfile
2
- Gemfile.lock
3
-
4
- # build artifacts
5
- *.gem
6
- /.bundle/
7
- /vendor/bundle
8
- /spec/reports/
9
- /tmp/
10
- /pkg/
11
-
12
- /.vscode
13
- .solargraph.yml
14
-
15
- # docs
16
- /.yardoc
17
- /_yardoc/
18
- /coverage/
19
- /doc/
20
-
21
- # rspec failure tracking
22
- .rspec_status
23
- scratch.rb
data/.markdownlint.json DELETED
@@ -1,4 +0,0 @@
1
- {
2
- "MD013": false,
3
- "MD024": false
4
- }
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/.rubocop.yml DELETED
@@ -1,101 +0,0 @@
1
- AllCops:
2
- TargetRubyVersion: 3.2.2
3
- Exclude:
4
- - 'config/routes.rb'
5
- NewCops: enable
6
-
7
- Metrics/ClassLength:
8
- Max: 500
9
- Metrics/ModuleLength:
10
- Max: 300
11
- Metrics/MethodLength:
12
- Max: 50
13
- Metrics/AbcSize:
14
- Max: 30
15
- Metrics/ParameterLists:
16
- Max: 5
17
- CountKeywordArgs: false
18
- Metrics/BlockLength:
19
- CountAsOne: ['array', 'heredoc', 'method_call']
20
- Max: 50
21
- Metrics/CyclomaticComplexity:
22
- Max: 30
23
- Metrics/PerceivedComplexity:
24
- Max: 30
25
-
26
- Style/AccessorGrouping:
27
- Enabled: false
28
- Style/ConditionalAssignment:
29
- Enabled: false
30
- Style/BlockDelimiters:
31
- BracesRequiredMethods: ['log']
32
- Style/HashSyntax:
33
- EnforcedShorthandSyntax: either
34
- EnforcedStyle: no_mixed_keys
35
- Style/ArgumentsForwarding:
36
- UseAnonymousForwarding: false
37
- Style/ClassAndModuleChildren:
38
- Enabled: false
39
- Style/FrozenStringLiteralComment:
40
- Enabled: false
41
- Style/StringLiterals:
42
- Enabled: false
43
- Style/StringLiteralsInInterpolation:
44
- Enabled: false
45
- Style/Documentation:
46
- Enabled: false
47
- Style/CommentedKeyword:
48
- Enabled: false
49
- Style/MultilineBlockChain:
50
- Enabled: false
51
- Style/AndOr:
52
- Enabled: false
53
- Style/Alias:
54
- EnforcedStyle: prefer_alias_method
55
- Style/FetchEnvVar:
56
- Enabled: false
57
- Style/RegexpLiteral:
58
- EnforcedStyle: mixed
59
- AllowInnerSlashes: true
60
-
61
- Layout/HashAlignment:
62
- EnforcedColonStyle: table
63
- EnforcedHashRocketStyle: table
64
- Layout/LeadingCommentSpace:
65
- Enabled: false
66
- AllowGemfileRubyComment: true
67
- Layout/ParameterAlignment:
68
- Enabled: false
69
- Layout/MultilineMethodDefinitionBraceLayout:
70
- EnforcedStyle: symmetrical
71
- Layout/LineLength:
72
- Enabled: true
73
- Layout/SpaceInsideHashLiteralBraces:
74
- Enabled: false
75
- Layout/SpaceInsideBlockBraces:
76
- Enabled: false
77
- Layout/SpaceAroundOperators:
78
- Enabled: false
79
- Layout/ExtraSpacing:
80
- AllowForAlignment: true
81
- AllowBeforeTrailingComments: true
82
- Layout/AccessModifierIndentation:
83
- EnforcedStyle: indent
84
- Layout/DotPosition:
85
- EnforcedStyle: trailing
86
- Layout/MultilineMethodCallIndentation:
87
- EnforcedStyle: indented
88
- Layout/FirstHashElementIndentation:
89
- Enabled: false
90
- Layout/EmptyLineAfterGuardClause:
91
- Enabled: false
92
-
93
- Naming/VariableNumber:
94
- EnforcedStyle: snake_case
95
- CheckSymbols: false
96
- Naming/MethodParameterName:
97
- AllowedNames: ['x', 'y', 'i', 'j', 'id', 'io']
98
- Naming/RescuedExceptionsVariableName:
99
- Enabled: false
100
- Naming/BlockForwarding:
101
- Enabled: false
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 3.2.2
data/.yardopts DELETED
@@ -1,10 +0,0 @@
1
- --readme README.md
2
- --charset utf-8
3
- --markup-provider=redcarpet
4
- --markup=markdown
5
- --no-private
6
- --output-dir ./doc
7
- 'lib/**/*.rb'
8
- -
9
- CHANGELOG.md
10
- LICENSE
data/Gemfile DELETED
@@ -1,6 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
-
5
- # Specify your gem's dependencies in ecoportal-api.gemspec
6
- gemspec
data/Rakefile DELETED
@@ -1,36 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
- require 'rubocop/rake_task'
4
- require "yard"
5
- require "redcarpet"
6
-
7
- desc "run the specs"
8
- RSpec::Core::RakeTask.new(:spec)
9
-
10
- desc "run rspec showing backtrace"
11
- RSpec::Core::RakeTask.new(:spec_trace) do |task|
12
- task.rspec_opts = ['--backtrace']
13
- end
14
-
15
- desc "run rspec stopping on first fail, and show backtrace"
16
- RSpec::Core::RakeTask.new(:spec_fast) do |task|
17
- task.rspec_opts = ['--fail-fast', '--backtrace']
18
- end
19
-
20
- desc "run rubocop diaplying cop names"
21
- RuboCop::RakeTask.new(:rubocop) do |t|
22
- t.options = ['--display-cop-names']
23
- end
24
-
25
- # default task name is yard
26
- desc "Yard: generate all the documentation"
27
- YARD::Rake::YardocTask.new(:doc) do |t|
28
- #t.files = ['lib/**/*.rb']
29
- end
30
-
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
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "ecoportal/api-v2"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "pry"
14
- Pry.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
@@ -1,40 +0,0 @@
1
- # rubocop:disable Gemspec/DevelopmentDependencies
2
- lib = File.expand_path('lib', __dir__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
-
5
- require 'ecoportal/api/v2_version'
6
-
7
- Gem::Specification.new do |spec|
8
- spec.name = 'ecoportal-api-v2'
9
- spec.version = Ecoportal::API::GEM2_VERSION
10
- spec.authors = ['Oscar Segura']
11
- spec.email = ['oscar@ecoportal.co.nz']
12
-
13
- spec.summary = "A collection of helpers for interacting with the ecoPortal MS's V2 API"
14
- spec.homepage = "https://www.ecoportal.com"
15
- spec.licenses = %w[MIT]
16
-
17
- spec.metadata['rubygems_mfa_required'] = 'true'
18
-
19
- spec.required_ruby_version = '>= 3.2.2'
20
-
21
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
22
- f.match(%r{^(test|spec|features)/})
23
- end
24
- spec.bindir = 'exe'
25
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
- spec.require_paths = ['lib']
27
-
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'
35
-
36
- spec.add_dependency 'ecoportal-api', '~> 0.10', '>= 0.10.12'
37
- spec.add_dependency 'mime-types', '~> 3.5', '>= 3.5.2'
38
- end
39
-
40
- # rubocop:enable Gemspec/DevelopmentDependencies