html5up 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/html5up.gemspec +1 -1
- data/lib/html5up/cli.rb +1 -3
- data/lib/html5up/helpers.rb +19 -8
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6748d7b0b1c8f513482ac69f79110f67f836e2c6
|
|
4
|
+
data.tar.gz: b53f80dccdf42bc067e8dbe63a17ebaa92335f77
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 69b35ede60ff03e021446679d35355d85f898ea04642216f97e46d35ea2100f9dd993e06e052601c0dd693d8bd862ceca5c13e005f235a29f8a180b82821bc8c
|
|
7
|
+
data.tar.gz: af0eae206405473b01b50def6fcc0714d7325de8dadd194b2c3b103e2b47bc2230fba623962eba6a1066919f9657846bbf13bd46debba187c452e2f1edaf226d
|
data/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
[](https://badge.fury.io/rb/html5up)
|
|
2
2
|
[](https://travis-ci.org/rlqualls/html5up-ruby)
|
|
3
3
|
|
|
4
4
|
# HTML5UP
|
|
5
5
|
|
|
6
|
-
**HTML5UP** is a command-line downloader for [
|
|
6
|
+
**HTML5UP** is a command-line downloader for [html5up.net](http://html5up.net) templates.
|
|
7
7
|
|
|
8
8
|
## Dependencies
|
|
9
9
|
|
data/html5up.gemspec
CHANGED
data/lib/html5up/cli.rb
CHANGED
|
@@ -8,11 +8,9 @@ module HTML5UP
|
|
|
8
8
|
option :save
|
|
9
9
|
def new(project_name)
|
|
10
10
|
template = options[:template]
|
|
11
|
-
puts "Downloading #{template}..."
|
|
12
11
|
filename = "html5up-#{template}.zip"
|
|
13
|
-
url = "html5up.net/#{template}/download"
|
|
14
12
|
|
|
15
|
-
Helpers::download(
|
|
13
|
+
Helpers::download(template, filename)
|
|
16
14
|
Helpers::extract(filename, project_name, options)
|
|
17
15
|
end
|
|
18
16
|
|
data/lib/html5up/helpers.rb
CHANGED
|
@@ -1,39 +1,50 @@
|
|
|
1
1
|
require "fileutils"
|
|
2
2
|
require "curb"
|
|
3
3
|
require "archive/zip"
|
|
4
|
+
require "tty-spinner"
|
|
4
5
|
|
|
5
6
|
module HTML5UP
|
|
6
7
|
class Helpers
|
|
7
8
|
def self.extract(src, dest, options = {})
|
|
8
|
-
|
|
9
|
+
begin
|
|
10
|
+
Archive::Zip.extract(src, dest)
|
|
11
|
+
rescue Archive::Zip::UnzipError
|
|
12
|
+
puts "Error: Website down or invalid template name."
|
|
13
|
+
puts "Removing #{src}"
|
|
14
|
+
FileUtils.rm(src)
|
|
15
|
+
exit(false)
|
|
16
|
+
end
|
|
17
|
+
|
|
9
18
|
if options[:save]
|
|
10
19
|
FileUtils.mv(src, dest + "/" + src)
|
|
11
20
|
else
|
|
12
21
|
FileUtils.rm(src)
|
|
13
22
|
end
|
|
23
|
+
|
|
24
|
+
puts "Extracted to #{dest}"
|
|
14
25
|
end
|
|
15
26
|
|
|
16
|
-
def self.download(
|
|
27
|
+
def self.download(template, filename)
|
|
17
28
|
easy = Curl::Easy.new
|
|
18
29
|
easy.follow_location = true
|
|
19
|
-
easy.url =
|
|
20
|
-
print "'#{url}' :"
|
|
30
|
+
easy.url = "html5up.net/#{template}/download"
|
|
21
31
|
|
|
22
32
|
File.open(filename, 'wb') do |f|
|
|
33
|
+
spinner = TTY::Spinner.new("Downloading #{template}... ")
|
|
23
34
|
easy.on_progress do |dl_total, dl_now, ul_total, ul_now|
|
|
24
|
-
|
|
35
|
+
spinner.spin
|
|
25
36
|
true
|
|
26
37
|
end
|
|
27
38
|
easy.on_body { |data| f << data; data.size }
|
|
28
39
|
easy.perform
|
|
29
|
-
puts "=> '#{filename}'"
|
|
40
|
+
puts " => '#{filename}'"
|
|
30
41
|
end
|
|
31
42
|
end
|
|
32
43
|
|
|
33
44
|
def self.templates
|
|
34
45
|
%w(
|
|
35
|
-
hyperspace future-imperfect solid-state
|
|
36
|
-
lens fractal eventually spectral photon
|
|
46
|
+
multiverse hyperspace future-imperfect solid-state
|
|
47
|
+
identity lens fractal eventually spectral photon
|
|
37
48
|
highlights landed strata read-only alpha
|
|
38
49
|
directive aeriel twenty big-picture tessellate
|
|
39
50
|
overflow prologue helios telephasic strongly-typed
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: html5up
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Robert Qualls
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2016-02-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Create and manage HTML5UP projects
|
|
14
14
|
email: robert@robertqualls.com
|