compass_extension 0.2.0 → 0.2.1.rc.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/compass_extension.rb +0 -2
- data/lib/downloader.rb +58 -0
- data/lib/susy/bootstrap.rb +3 -0
- data/templates/project/manifest.rb +1 -1
- metadata +6 -6
- data/lib/compass_extension/base.rb +0 -0
- data/lib/compass_extension/version.rb +0 -3
data/lib/compass_extension.rb
CHANGED
data/lib/downloader.rb
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
require 'fileutils'
|
3
|
+
require 'rubygems'
|
4
|
+
require 'zip/zip'
|
5
|
+
|
6
|
+
|
7
|
+
def fetch(uri_str, limit = 10)
|
8
|
+
raise ArgumentError, 'HTTP redirect too deep' if limit == 0
|
9
|
+
|
10
|
+
url = URI.parse(uri_str)
|
11
|
+
http = Net::HTTP.new(url.host, url.port)
|
12
|
+
http.open_timeout = 10
|
13
|
+
http.read_timeout = 30
|
14
|
+
http.use_ssl = true
|
15
|
+
response = http.start do |http|
|
16
|
+
puts "getting #{url.path}"
|
17
|
+
http.request_get(url.path)
|
18
|
+
end
|
19
|
+
|
20
|
+
case response
|
21
|
+
when Net::HTTPSuccess then response
|
22
|
+
when Net::HTTPRedirection then fetch(response['location'], limit - 1)
|
23
|
+
else
|
24
|
+
response.error!
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def install_from_github(user, project, ext_name, branch = "master", working_directory = Dir.pwd)
|
29
|
+
download_link = "https://github.com/#{user}/#{project}/zipball/#{branch}"
|
30
|
+
extdir = File.join(working_directory,'extensions')
|
31
|
+
|
32
|
+
if !File.exists?("#{extdir}/#{ext_name}")
|
33
|
+
begin
|
34
|
+
puts "Downloading the #{ext_name} plugin into #{extdir}."
|
35
|
+
FileUtils.mkdir_p("#{extdir}")
|
36
|
+
zipfile = File.join(extdir, "#{ext_name}.zip")
|
37
|
+
open(zipfile, "wb") do |tgz|
|
38
|
+
tgz << fetch(download_link).body
|
39
|
+
end
|
40
|
+
puts "Unzipping the #{ext_name} plugin."
|
41
|
+
Zip::ZipFile::open(zipfile) { |zf|
|
42
|
+
zf.each { |e|
|
43
|
+
fpath = File.join(extdir, e.name)
|
44
|
+
FileUtils.mkdir_p(File.dirname(fpath))
|
45
|
+
zf.extract(e, fpath)
|
46
|
+
}
|
47
|
+
}
|
48
|
+
File.unlink(zipfile)
|
49
|
+
funky_directory = Dir.glob(File.join(extdir,"#{user}-#{project}-*"))[0]
|
50
|
+
FileUtils.mv(funky_directory, File.join(extdir, ext_name))
|
51
|
+
puts "#{ext_name} installed."
|
52
|
+
rescue Exception => e
|
53
|
+
FileUtils.rm_rf(extdir)
|
54
|
+
raise
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
@@ -65,7 +65,7 @@ html 'files/apple-touch-icon-72x72-precomposed.png', :to => 'apple-touch-icon-72
|
|
65
65
|
html 'files/apple-touch-icon-114x114-precomposed.png', :to => 'apple-touch-icon-114x114-precomposed.png'
|
66
66
|
html 'files/apple-touch-icon-precomposed.png', :to => 'apple-touch-icon-precomposed.png'
|
67
67
|
html 'files/favicon.png', :to => 'favicon.png'
|
68
|
-
|
68
|
+
html 'files/config.rb', :to => 'config.rb'
|
69
69
|
|
70
70
|
help %Q{
|
71
71
|
This is a Compass extension for Skyron using html5-boilerplate templates
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: compass_extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.0
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.1.rc.0
|
5
|
+
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Skyron ltd, Yann Le Corre, Dil Ahdan, Aung Win
|
@@ -66,9 +66,9 @@ executables: []
|
|
66
66
|
extensions: []
|
67
67
|
extra_rdoc_files: []
|
68
68
|
files:
|
69
|
-
- lib/compass_extension/base.rb
|
70
|
-
- lib/compass_extension/version.rb
|
71
69
|
- lib/compass_extension.rb
|
70
|
+
- lib/downloader.rb
|
71
|
+
- lib/susy/bootstrap.rb
|
72
72
|
- templates/project/files/404.html
|
73
73
|
- templates/project/files/about.html
|
74
74
|
- templates/project/files/apple-touch-icon-114x114-precomposed.png
|
@@ -147,9 +147,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
147
147
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
148
148
|
none: false
|
149
149
|
requirements:
|
150
|
-
- - ! '
|
150
|
+
- - ! '>'
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version:
|
152
|
+
version: 1.3.1
|
153
153
|
requirements: []
|
154
154
|
rubyforge_project:
|
155
155
|
rubygems_version: 1.8.24
|
File without changes
|