lib/synvert/snippet.rb in synvert-0.10.1 vs lib/synvert/snippet.rb in synvert-0.11.0

- old
+ new

@@ -4,10 +4,15 @@ require 'json' module Synvert # Manage synvert snippets. class Snippet + def self.fetch_core_version + content = URI.open('https://rubygems.org/api/v1/versions/synvert-core.json').read + JSON.parse(content).first['number'] + end + def initialize(snippets_path) @snippets_path = snippets_path end # synchronize snippets from github. @@ -16,13 +21,8 @@ FileUtils.cd @snippets_path Kernel.system('git pull --rebase') else Kernel.system("git clone https://github.com/xinminlabs/synvert-snippets.git #{@snippets_path}") end - end - - def fetch_core_version - content = URI.open('https://rubygems.org/api/v1/versions/synvert-core.json').read - JSON.parse(content).first['number'] end end end