Sha256: 4193710045c5f31a61208f48cddc9b0fd46aa2676fbe03392d6f5e157c671dfe

Contents?: true

Size: 261 Bytes

Versions: 6

Compression:

Stored size: 261 Bytes

Contents

# frozen_string_literal: true

require 'json'

module Helpers
  # From https://gist.github.com/ascendbruce/7070951
  def valid_json?(json)
    JSON.parse(json)
    true
  rescue Exception => e
    false
  end

  def trim(text)
    /\A\s+#{text}\s+\Z/
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
geo_combine-0.9.2 spec/helpers.rb
geo_combine-0.9.1 spec/helpers.rb
geo_combine-0.9.0 spec/helpers.rb
geo_combine-0.8.0 spec/helpers.rb
geo_combine-0.7.0 spec/helpers.rb
geo_combine-0.6.0 spec/helpers.rb