ecoportal-api-oozes 0.5.8 → 0.5.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: 22485d9290fed472c85b2871b538385efa432395714b2fa9f2395d5ca3dfc73e
4
- data.tar.gz: 6d2c0590daac42d7ad69dc117de7fb188e8ed5eff480a38dfc7ec00759c7f639
3
+ metadata.gz: 7ed3bc0b2b7e4fdb51a9ebbf02ca946de0ac8fd7c71359ea8eb1ab545c5f6c9a
4
+ data.tar.gz: 7a0151c663ce59132955e5f91cbaed7ef2ff9c62d152c3f89ca233b4851e1c13
5
5
  SHA512:
6
- metadata.gz: ee03ed1ac3f843fcf4dfdb38fccde9389fa909cb8fd3f9285f1c22c9a308d995f75ba8e329945999e1fcb47c61c72e1d4c199594daa63b00fc5c19e5477e6777
7
- data.tar.gz: d3e35673499d33c8322afd2eda3d1dc43f70dce238650b8acd192830e41f9f8fd65a8f5df89c727b8a933967e13a53c824ac80a40660912ad675405b46f48cad
6
+ metadata.gz: cb2172b251d930c72f618576cfcbd17f58ddb4210e93644b01dd6568e2c44914d40c35d09777b86489e86eab0ed82e9c2de71f8396bbb33c9e16f7614ff9fea4
7
+ data.tar.gz: 1e3ca2bc12e2d3c077160ca25677ef880c32b8ecd1e66a241443df36950eb5f546d7b2bb1e6bf10caffbaa4e0b75a89f38b8607bb70f539796561af8fa1da5d2
@@ -0,0 +1,10 @@
1
+ # Change Log
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ ## [0.5.9] - 2020-06-xx
5
+
6
+ ### Added
7
+ - helper `Ecoportal::API::Common::Content::StringDigest#indexable_label`: to see the part of a label that gets indexed
8
+ - this `CHANGELOG.md` file
9
+ ### Changed
10
+ ### Fixed
@@ -7,12 +7,17 @@ module Ecoportal
7
7
  module StringDigest
8
8
  MAX_HASH_LABEL = 64
9
9
 
10
+ def indexable_label(str)
11
+ return nil unless str
12
+ lbl = str.downcase.gsub(/[^A-Za-z]+/,"-").slice(0, MAX_HASH_LABEL)
13
+ return nil unless lbl.length >= 3
14
+ lbl
15
+ end
16
+
10
17
  # Calculates the Hash of the field based on label
11
18
  def hash_label(str)
12
- return false unless str
13
- label = str.downcase.gsub(/[^A-Za-z]+/,"-").slice(0, MAX_HASH_LABEL)
14
- return false unless label.length >= 3
15
- return "z" + Digest::MD5.hexdigest(label).slice(0, 8);
19
+ return nil unless lbl = indexable_label(str)
20
+ "z" + Digest::MD5.hexdigest(lbl).slice(0, 8);
16
21
  end
17
22
 
18
23
  end
@@ -88,6 +88,10 @@ module Ecoportal
88
88
  root.sections.find {|sec| sec.component?(id)}
89
89
  end
90
90
 
91
+ def indexable_label
92
+ self.class.indexable_label(label)
93
+ end
94
+
91
95
  end
92
96
  end
93
97
  end
@@ -1,7 +1,7 @@
1
1
  module Ecoportal
2
2
  module API
3
3
  class V2
4
- GEM_VERSION = "0.5.8"
4
+ GEM_VERSION = "0.5.9"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecoportal-api-oozes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.8
4
+ version: 0.5.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: 2020-06-23 00:00:00.000000000 Z
11
+ date: 2020-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -140,6 +140,7 @@ files:
140
140
  - ".rubocop.yml"
141
141
  - ".travis.yml"
142
142
  - ".yardopts"
143
+ - CHANGELOG.md
143
144
  - Gemfile
144
145
  - LICENSE
145
146
  - README.md