html5up 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: dcd1bb18765852f7fa4d9e2e4db871b9a9f1b774
4
+ data.tar.gz: e21a2952808694575f98a8f65fe3eb9f65a3d74c
5
+ SHA512:
6
+ metadata.gz: 9dfaa7cb0918dc1c8a2f2d68af687ad82e62789bf7c19cb76111774459ba3e50dca7773d91ac932cc6acf29df3959af28c57ff9413e9bf5b302724e3694110bb
7
+ data.tar.gz: 5eeda5104ee15b6aec568171302970c3baf34df496d35b98ffc2add1c1c57868161dfad1b65b006d727d3211d191658335f487b804274a0ffeef8d66b21e06ea
data/LICENSE ADDED
@@ -0,0 +1,11 @@
1
+ Licensed under the Apache License, Version 2.0 (the "License");
2
+ you may not use this file except in compliance with the License.
3
+ You may obtain a copy of the License at
4
+
5
+ http://www.apache.org/licenses/LICENSE-2.0
6
+
7
+ Unless required by applicable law or agreed to in writing, software
8
+ distributed under the License is distributed on an "AS IS" BASIS,
9
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ See the License for the specific language governing permissions and
11
+ limitations under the License.
data/README.md ADDED
@@ -0,0 +1,39 @@
1
+ [![Gem Version](https://badge.fury.io/rb/html5up-ruby.png)](http://badge.fury.io/rb/html5up-ruby)
2
+ [![Build Status](https://travis-ci.org/rlqualls/html5up-ruby.png?branch=master)](https://travis-ci.org/rlqualls/html5up-ruby)
3
+
4
+ # HTML5UP
5
+
6
+ **HTML5UP** is a command-line downloader for [html5-up.net](https://html5up.net) templates.
7
+
8
+ ## Dependencies
9
+
10
+ 1. libcurl (the one that ships with OSX should work)
11
+
12
+ ## Installation
13
+
14
+ $ gem install html5up
15
+
16
+ ## Installation (development)
17
+
18
+ $ git clone https://github.com/rlqualls/html5up-ruby
19
+ $ cd html5up-ruby
20
+ $ bundle
21
+ $ rake install
22
+
23
+ ## Usage Examples
24
+
25
+ Create a folder out of a template:
26
+
27
+ $ html5up new my_project --template hyperspace
28
+
29
+ Save the original zip file:
30
+
31
+ $ html5up new my_project --template hyperspace --save
32
+
33
+ See what templates are available (not hardcoded, see the latest on the site):
34
+
35
+ $ html5up templates
36
+
37
+ ## Support
38
+
39
+ Make a [new github issue](https://github.com/rlqualls/html5up/issues/new).
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
data/bin/html5up ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ require 'html5up/cli'
3
+
4
+ result = HTML5UP::CLI.start(ARGV)
5
+ exit(1) unless result
data/html5up.gemspec ADDED
@@ -0,0 +1,16 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'html5up'
3
+ s.version = '0.0.1'
4
+ s.summary = "HTML5UP download tool"
5
+ s.description = "Create and manage HTML5UP projects"
6
+ s.authors = ["Robert Qualls"]
7
+ s.email = 'robert@robertqualls.com'
8
+ s.homepage = 'https://github.com/rlqualls/html5up-ruby'
9
+ s.files = Dir.glob("{lib}/**/*.rb") + ["README.md", "LICENSE", "Rakefile", "html5up.gemspec"]
10
+ s.require_paths = ["lib"]
11
+ s.bindir = "bin"
12
+ s.executables << "html5up"
13
+ s.license = "Apache 2.0"
14
+ s.has_rdoc = false
15
+ s.required_ruby_version = '>= 1.9.0'
16
+ end
data/lib/html5up.rb ADDED
@@ -0,0 +1 @@
1
+ require "html5up/cli"
@@ -0,0 +1,26 @@
1
+ require "thor"
2
+ require "html5up/helpers"
3
+
4
+ module HTML5UP
5
+ class CLI < Thor
6
+ desc "new <name>", "create project out of template"
7
+ option :template, required: true
8
+ option :save
9
+ def new(project_name)
10
+ template = options[:template]
11
+ puts "Downloading #{template}..."
12
+ filename = "html5up-#{template}.zip"
13
+ url = "html5up.net/#{template}/download"
14
+
15
+ Helpers::download(url, filename)
16
+ Helpers::extract(filename, project_name, options)
17
+ end
18
+
19
+ desc "templates", "list available templates"
20
+ def templates
21
+ Helpers::templates.each do |template|
22
+ puts template
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,46 @@
1
+ require "fileutils"
2
+ require "curb"
3
+ require "archive/zip"
4
+
5
+ module HTML5UP
6
+ class Helpers
7
+ def self.extract(src, dest, options = {})
8
+ Archive::Zip.extract(src, dest)
9
+ if options[:save]
10
+ FileUtils.mv(src, dest + "/" + src)
11
+ else
12
+ FileUtils.rm(src)
13
+ end
14
+ end
15
+
16
+ def self.download(url, filename)
17
+ easy = Curl::Easy.new
18
+ easy.follow_location = true
19
+ easy.url = url
20
+ print "'#{url}' :"
21
+
22
+ File.open(filename, 'wb') do |f|
23
+ easy.on_progress do |dl_total, dl_now, ul_total, ul_now|
24
+ print "="
25
+ true
26
+ end
27
+ easy.on_body { |data| f << data; data.size }
28
+ easy.perform
29
+ puts "=> '#{filename}'"
30
+ end
31
+ end
32
+
33
+ def self.templates
34
+ %w(
35
+ hyperspace future-imperfect solid-state identity
36
+ lens fractal eventually spectral photon
37
+ highlights landed strata read-only alpha
38
+ directive aeriel twenty big-picture tessellate
39
+ overflow prologue helios telephasic strongly-typed
40
+ parallelism escape-velocity astral striped
41
+ dopetrope miniport txt verti zerofour arcana
42
+ halcyonic minimaxing
43
+ )
44
+ end
45
+ end
46
+ end
metadata ADDED
@@ -0,0 +1,52 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: html5up
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Robert Qualls
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-12-21 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Create and manage HTML5UP projects
14
+ email: robert@robertqualls.com
15
+ executables:
16
+ - html5up
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - LICENSE
21
+ - README.md
22
+ - Rakefile
23
+ - bin/html5up
24
+ - html5up.gemspec
25
+ - lib/html5up.rb
26
+ - lib/html5up/cli.rb
27
+ - lib/html5up/helpers.rb
28
+ homepage: https://github.com/rlqualls/html5up-ruby
29
+ licenses:
30
+ - Apache 2.0
31
+ metadata: {}
32
+ post_install_message:
33
+ rdoc_options: []
34
+ require_paths:
35
+ - lib
36
+ required_ruby_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 1.9.0
41
+ required_rubygems_version: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ requirements: []
47
+ rubyforge_project:
48
+ rubygems_version: 2.5.0
49
+ signing_key:
50
+ specification_version: 4
51
+ summary: HTML5UP download tool
52
+ test_files: []