Sha256: b173f71109352734156d987b4445c52bdd593e9afae0f08b8eb2c4b8096417d1

Contents?: true

Size: 419 Bytes

Versions: 12

Compression:

Stored size: 419 Bytes

Contents

# file encoded in YAML
# readed as dumped JSON
# to hack `open('...json').read`
class Lurker::JamlDescriptor
  module Rescue
    def open(uri)
      Kernel.open(uri)
    rescue Errno::ENOENT
      Lurker::JamlDescriptor.new(uri)
    end
  end

  def initialize(uri)
    @uri = uri.gsub(/\#$/, '').gsub(/\.json/, '.json.yml')
    @fd = open(@uri)
  end

  def read
    @read ||= JSON.dump(YAML.load(@fd.read))
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
lurker-1.0.0 lib/lurker/jaml_descriptor.rb
lurker-0.6.12 lib/lurker/jaml_descriptor.rb
lurker-0.6.11 lib/lurker/jaml_descriptor.rb
lurker-0.6.10 lib/lurker/jaml_descriptor.rb
lurker-0.6.9 lib/lurker/jaml_descriptor.rb
lurker-0.6.8 lib/lurker/jaml_descriptor.rb
lurker-0.6.7 lib/lurker/jaml_descriptor.rb
lurker-0.6.6 lib/lurker/jaml_descriptor.rb
lurker-0.6.5 lib/lurker/jaml_descriptor.rb
lurker-0.6.4 lib/lurker/jaml_descriptor.rb
lurker-0.6.3 lib/lurker/jaml_descriptor.rb
lurker-0.6.2 lib/lurker/jaml_descriptor.rb