lib/synvert/snippet.rb in synvert-0.4.0 vs lib/synvert/snippet.rb in synvert-0.4.2

- old
+ new

@@ -1,6 +1,8 @@ # coding: utf-8 +require 'open-uri' +require 'json' module Synvert # Manage synvert snippets. class Snippet # synchronize snippets from github. @@ -10,8 +12,13 @@ FileUtils.cd snippets_path `git pull --rebase --quiet` else `git clone https://github.com/xinminlabs/synvert-snippets.git #{snippets_path} --quiet` end + end + + def self.fetch_core_version + content = open("https://rubygems.org/api/v1/versions/synvert-core.json").read + JSON.parse(content).first["number"] end end end