Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 7d3df3c2 authored by Pierre Neyron's avatar Pierre Neyron :bicyclist:
Browse files

Merge branch 'hash-monkey-patch' into 'master'

Fix Ruby Hash monkey patch in hash/hash.rb

See merge request !1356
parents 7612fa45 08a38427
No related branches found
No related tags found
1 merge request!1356Fix Ruby Hash monkey patch in hash/hash.rb
Pipeline #1209204 passed
Pipeline: Resources Explorer

#1209206

    ......@@ -54,6 +54,11 @@ end
    # Extend Hash with helper methods needed to convert input data files to ruby Hash
    class ::Hash
    def slice(*extract)
    h2 = self.select{|key, _value| extract.include?(key) }
    h2
    end
    # Recursively merge this Hash with another (ie. merge nested hash)
    # Returns a new hash containing the contents of other_hash and the contents of hash. The value for entries with duplicate keys will be that of other_hash:
    # a = {"key": "value_a"}
    ......
    ......@@ -45,13 +45,6 @@ module RefRepo::Utils
    end
    end
    # Various monkey patches
    class Hash
    def slice(*extract)
    h2 = self.select{|key, _value| extract.include?(key) }
    h2
    end
    end
    def split_cluster_node(k)
    [k[/([a-z]+)/, 1], k[/[a-z](\d+)/, 1].to_i, k[/-(\d+)/, 1].to_i]
    ......
    ......@@ -34,8 +34,8 @@ def yaml_input_schema_validator(options)
    end
    site.fetch("clusters", {}).each do |cluster_uid, cluster|
    next if clusters and not clusters.empty? and not clusters.include?(cluster_uid)
    next if clusters and not clusters.empty? and not clusters.include?(cluster_uid)
    r &= run_validator(cluster_uid, cluster, schema_cluster) #
    cluster["nodes"].each do |node_uid, node|
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment