Manage example extensions better.
This commit is contained in:
parent
73c355c594
commit
75c62aaf49
3
examples/css3/bootstrap.rb
Normal file
3
examples/css3/bootstrap.rb
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
require File.join(File.dirname(__FILE__), '..', 'downloader')
|
||||||
|
|
||||||
|
install_from_github('chriseppstein', 'compass-colors', 'compass-colors')
|
2
examples/css3/clean.rb
Normal file
2
examples/css3/clean.rb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
require 'fileutils'
|
||||||
|
FileUtils.rm_rf "#{File.dirname(__FILE__)}/extensions/compass-colors"
|
@ -28,10 +28,10 @@ def install_from_github(user, project, ext_name, branch = "master", working_dire
|
|||||||
download_link = "http://github.com/#{user}/#{project}/zipball/#{branch}"
|
download_link = "http://github.com/#{user}/#{project}/zipball/#{branch}"
|
||||||
extdir = File.join(working_directory,'extensions')
|
extdir = File.join(working_directory,'extensions')
|
||||||
|
|
||||||
if !File.exists?(extdir)
|
if !File.exists?("#{extdir}/#{ext_name}")
|
||||||
begin
|
begin
|
||||||
puts "Downloading the #{ext_name} plugin into #{extdir}."
|
puts "Downloading the #{ext_name} plugin into #{extdir}."
|
||||||
FileUtils.mkdir(extdir)
|
FileUtils.mkdir_p("#{extdir}/#{ext_name}")
|
||||||
zipfile = File.join(extdir, "#{ext_name}.zip")
|
zipfile = File.join(extdir, "#{ext_name}.zip")
|
||||||
open(zipfile, "wb") do |tgz|
|
open(zipfile, "wb") do |tgz|
|
||||||
tgz << fetch(download_link).body
|
tgz << fetch(download_link).body
|
||||||
|
Loading…
Reference in New Issue
Block a user