Class: Synvert::Snippet
- Inherits:
-
Object
- Object
- Synvert::Snippet
- Defined in:
- lib/synvert/snippet.rb
Overview
Manage synvert snippets.
Class Method Summary collapse
- .fetch_core_version ⇒ Object
-
.sync ⇒ Object
synchronize snippets from github.
Class Method Details
.fetch_core_version ⇒ Object
19 20 21 22 |
# File 'lib/synvert/snippet.rb', line 19 def self.fetch_core_version content = open("https://rubygems.org/api/v1/versions/synvert-core.json").read JSON.parse(content).first["number"] end |
.sync ⇒ Object
synchronize snippets from github.
9 10 11 12 13 14 15 16 17 |
# File 'lib/synvert/snippet.rb', line 9 def self.sync snippets_path = Core::Configuration.instance.get :default_snippets_path if File.exist?(snippets_path) FileUtils.cd snippets_path system("git pull --rebase") else system("git clone https://github.com/xinminlabs/synvert-snippets.git #{snippets_path}") end end |