eco-helpers 2.4.5 → 2.4.6

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: 333d58d63c6ffad6b06865c89dce3e48a50347ba998361f34eb9a2e230ea83f2
4
- data.tar.gz: 7be152e20c00765217b6650790dfd4aeba729bb614e6d0928a7e7ea82d94de33
3
+ metadata.gz: 4c4f7620deee8791ef8b6bfa5552e6040657575fa2ee071efdf7ed76e588a998
4
+ data.tar.gz: a870243619d2b8842ef97525676097330b76a0686f4793f7c6720e4c658173aa
5
5
  SHA512:
6
- metadata.gz: 3cb79f7d5429bf4c3cd8b8b37cbbdb2b8208da2161559fb6a09b08a67cea1ded2d08355928af4ee136b39bc10fda3f82ece275f5991c65bfcf41c4290d7d7269
7
- data.tar.gz: 78723001238f02cac999e2af5200e1e13f444572366291357a70ec951732ded65bd708be9b6c0259a9e6bf797fc5c803df17a28167d01b1bf1223900f8226cc7
6
+ metadata.gz: 5eef75b2a425b14b6bd17db7d58c153752ad121a708665f27736f9e4457c2eca5f06ec5af1344fe941478419c3271d0debdb3b09fda826eecd06414bf9a06405
7
+ data.tar.gz: 50c9b2e722457a10eae9da4723816f906efb816b82a485562779251ad80dea4c737cc0bd572c5e80eff3b9e2f6b3b909245bf65b766781f7cbdb63a8d5d68daf
data/CHANGELOG.md CHANGED
@@ -1,16 +1,28 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
- ## [2.4.6] - 2023-03-xx
4
+ ## [2.4.7] - 2023-04-xx
5
5
 
6
6
  ### Added
7
7
  ### Changed
8
8
  ### Fixed
9
9
 
10
+ ## [2.4.6] - 2023-04-02
11
+
12
+ ### Added
13
+ - `Eco::API::Organization::TagTree` added support for `archived_token`
14
+ - Added support for `block` in
15
+ - `Eco::API::Session#live_tree`
16
+ - `Eco::API::Session::Config::Tagtree` in `#live_trees` and `live_tree`
17
+
18
+ ### Changed
19
+ - Upgraded `ecoportal-api-graphql` **gem**
20
+
21
+
10
22
  ## [2.4.5] - 2023-03-31
11
23
 
12
24
  ### Added
13
- - `Eco::API:Organization::TagTree` support for `archived` and `weight` properties
25
+ - `Eco::API::Organization::TagTree` support for `archived` and `weight` properties
14
26
  - `Eco::Data::Hashes::ArrayDiff` and `Eco::Data::Hashes::DiffResult`
15
27
  - Enable easy comparison of array of hashes
16
28
  - Input data can be diverse
data/eco-helpers.gemspec CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
32
32
 
33
33
  spec.add_dependency 'ecoportal-api', '>= 0.9.3', '< 0.10'
34
34
  spec.add_dependency 'ecoportal-api-v2', '>= 1.1.1', '< 1.2'
35
- spec.add_dependency 'ecoportal-api-graphql', '>= 0.3.1', '< 0.4'
35
+ spec.add_dependency 'ecoportal-api-graphql', '>= 0.3.3', '< 0.4'
36
36
  spec.add_dependency 'aws-sdk-s3', '>= 1.83.0', '< 2'
37
37
  spec.add_dependency 'aws-sdk-ses', '>= 1.36.0', '< 2'
38
38
  spec.add_dependency 'dotenv', '>= 2.7.6', '< 2.8'
@@ -5,7 +5,8 @@ module Eco
5
5
  class TagTree
6
6
  attr_accessor :id
7
7
  alias_method :tag, :id
8
- attr_accessor :name, :archived, :weight
8
+ attr_accessor :name, :weight
9
+ attr_accessor :archived, :archived_token
9
10
 
10
11
  attr_reader :parent
11
12
  attr_reader :nodes, :children_count
@@ -46,6 +47,7 @@ module Eco
46
47
  @id = @source.values_at('tag', 'id').compact.first&.upcase
47
48
  @name = @source['name']
48
49
  @archived = @source.fetch('archived', false)
50
+ @archived_token = @source['archived_token']
49
51
  @weight = @source.fetch('weight', _weight)
50
52
  @row_nodes = @source['nodes'] || []
51
53
  end
@@ -20,9 +20,9 @@ module Eco
20
20
  end
21
21
 
22
22
  # Among all the locations structures it selects the one with more location nodes
23
- def live_tree(enviro: nil, include_archived: false)
23
+ def live_tree(enviro: nil, include_archived: false, &block)
24
24
  return @live_tree if instance_variable_defined?(:@live_tree) && @live_tree.enviro == enviro
25
- trees = live_trees(enviro: enviro, include_archived: include_archived)
25
+ trees = live_trees(enviro: enviro, include_archived: include_archived, &block)
26
26
  @live_tree = trees.reject do |tree|
27
27
  tree.empty?
28
28
  end.max do |a,b|
@@ -36,7 +36,7 @@ module Eco
36
36
  end
37
37
 
38
38
  # Retrieves all the location structures of the organisation
39
- def live_trees(enviro: nil, include_archived: false)
39
+ def live_trees(enviro: nil, include_archived: false, &block)
40
40
  [].tap do |eco_trees|
41
41
  next unless apis.active_api.version_available?(:graphql)
42
42
  next unless graphql = apis.api(version: :graphql)
@@ -44,7 +44,7 @@ module Eco
44
44
  includeArchived: include_archived,
45
45
  includeUnpublished: false
46
46
  }
47
- next unless trees = graphql.currentOrganization.locationStructures(**kargs)
47
+ next unless trees = graphql.currentOrganization.locationStructures(**kargs, &block)
48
48
  trees.each do |tree|
49
49
  args = { enviro: enviro, id: tree.id, name: tree.name}
50
50
  eco_tree = Eco::API::Organization::TagTree.new(tree.treeify, **args)
@@ -45,8 +45,8 @@ module Eco
45
45
  end
46
46
 
47
47
  # @see Eco::API::Session::Config#live_tree
48
- def live_tree(include_archived: false)
49
- config.live_tree(enviro: enviro)
48
+ def live_tree(include_archived: false, &block)
49
+ config.live_tree(enviro: enviro, &block)
50
50
  end
51
51
 
52
52
  # @see Eco::API::Session::Config#schemas
data/lib/eco/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Eco
2
- VERSION = "2.4.5"
2
+ VERSION = "2.4.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eco-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.5
4
+ version: 2.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura
@@ -156,7 +156,7 @@ dependencies:
156
156
  requirements:
157
157
  - - ">="
158
158
  - !ruby/object:Gem::Version
159
- version: 0.3.1
159
+ version: 0.3.3
160
160
  - - "<"
161
161
  - !ruby/object:Gem::Version
162
162
  version: '0.4'
@@ -166,7 +166,7 @@ dependencies:
166
166
  requirements:
167
167
  - - ">="
168
168
  - !ruby/object:Gem::Version
169
- version: 0.3.1
169
+ version: 0.3.3
170
170
  - - "<"
171
171
  - !ruby/object:Gem::Version
172
172
  version: '0.4'