module Versions
  class << self
    def registered(app)
      app.helpers Helpers
    end
    alias :included :registered
  end

  module Helpers

    def current_version
      @current_version = JSON.parse(open('https://raw.githubusercontent.com/emberjs/guides.emberjs.com/master/snapshots/versions.json').read).last
    end
  end
end

::Middleman::Extensions.register(:versions, Versions)

module Versions
  class << self
    def registered(app)
      app.helpers Helpers
    end
    alias :included :registered
  end

  module Helpers

    def current_version
      versions = JSON.parse(open('https://raw.githubusercontent.com/emberjs/guides.emberjs.com/master/snapshots/versions.json').read)
      versions.sort_by! { |version| Gem::Version.new(version[1..-1]) }
      @current_version = versions.last
    end
  end
end

::Middleman::Extensions.register(:versions, Versions)

Fix linking to incorrect version of quick start guide
Fix linking to incorrect version of quick start guide
