Sha256: 2bc62502f70dde8dd811454020902cb1f8b8837b1dd051544bbdb74585210f02

Contents?: true

Size: 617 Bytes

Versions: 11

Compression:

Stored size: 617 Bytes

Contents

module ShopifyCLI
  module Utilities
    def self.version_dropping_pre_and_build(version)
      Semantic::Version.new("#{version.major}.#{version.minor}.#{version.patch}")
    end

    def self.directory(pattern, curr)
      loop do
        return nil if curr == "/" || /^[A-Z]:\/$/.match?(curr)
        file = File.join(curr, pattern)
        return curr if File.exist?(file)
        curr = File.dirname(curr)
      end
    end

    def self.deep_merge(first, second)
      merger = proc { |_key, v1, v2| Hash === v1 && Hash === v2 ? v1.merge(v2, &merger) : v2 }
      first.merge(second, &merger)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
shopify-cli-2.36.0 lib/shopify_cli/utilities.rb
shopify-cli-2.35.0 lib/shopify_cli/utilities.rb
shopify-cli-2.34.0 lib/shopify_cli/utilities.rb
shopify-cli-2.33.1 lib/shopify_cli/utilities.rb
shopify-cli-2.33.0 lib/shopify_cli/utilities.rb
shopify-cli-2.32.1 lib/shopify_cli/utilities.rb
shopify-cli-2.32.0 lib/shopify_cli/utilities.rb
shopify-cli-2.31.0 lib/shopify_cli/utilities.rb
shopify-cli-2.30.0 lib/shopify_cli/utilities.rb
shopify-cli-2.29.0 lib/shopify_cli/utilities.rb
shopify-cli-2.28.0 lib/shopify_cli/utilities.rb