Sha256: e1f147bcaeef8e6d4497fe20a427ed57367e68fa1af5b5574e64dff29dd992ee

Contents?: true

Size: 298 Bytes

Versions: 16

Compression:

Stored size: 298 Bytes

Contents

require 'net/http'
require 'open-uri'
require 'json'

module Dashing
  module Downloader
    extend self

    def get_gist(gist_id)
      get_json("https://api.github.com/gists/#{gist_id}")
    end

    def get_json(url)
      response = open(url).read
      JSON.parse(response)
    end
  end
end

Version data entries

16 entries across 16 versions & 4 rubygems

Version Path
smashing-1.3.5 lib/dashing/downloader.rb
smashing-1.3.4 lib/dashing/downloader.rb
smashing-1.3.3 lib/dashing/downloader.rb
smashing-1.3.2 lib/dashing/downloader.rb
smashing-1.3.1 lib/dashing/downloader.rb
smashing-1.3.0 lib/dashing/downloader.rb
smashing-1.2.0 lib/dashing/downloader.rb
smashing-1.1.0 lib/dashing/downloader.rb
smashing-1.0.0 lib/dashing/downloader.rb
dashing-1.3.7 lib/dashing/downloader.rb
dashing-1.3.6 lib/dashing/downloader.rb
rtdi-1.0 lib/dashing/downloader.rb
dashing-jruby-1.3.4.1 lib/dashing/downloader.rb
dashing-jruby-1.3.4 lib/dashing/downloader.rb
dashing-1.3.4 lib/dashing/downloader.rb
dashing-1.3.3 lib/dashing/downloader.rb