drjekyll 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Manifest.txt +2 -0
- data/README.md +165 -2
- data/Rakefile +5 -1
- data/lib/drjekyll.rb +6 -6
- data/lib/drjekyll/catalog.rb +19 -4
- data/lib/drjekyll/cli/download.rb +9 -8
- data/lib/drjekyll/cli/main.rb +24 -18
- data/lib/drjekyll/cli/new.rb +35 -0
- data/lib/drjekyll/cli/unzip.rb +8 -7
- data/lib/drjekyll/package.rb +87 -0
- data/lib/drjekyll/version.rb +2 -2
- metadata +59 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f8388480e3692910b92dcd78a42097b242f72f9
|
4
|
+
data.tar.gz: 8ac266778b6fcf94ed8e86e6a80454e378fb3d6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1970d2319f64132371a156f9a6b128568401781bd91a59d254b8fde164f7f8b960800e8b7682b14792515eb17ad4c294edd00fbc3284c6ad19da710d41e7195f
|
7
|
+
data.tar.gz: 88523b5e8dce44330ffb9612703b0a345a39b30f927a7a3dbcc91f97a1a4d3334342d684f76700f9f3ef9685efead37bf502338a6f8d7bce0a6438863e5434d5
|
data/Manifest.txt
CHANGED
@@ -9,7 +9,9 @@ lib/drjekyll/catalog.rb
|
|
9
9
|
lib/drjekyll/cli/download.rb
|
10
10
|
lib/drjekyll/cli/list.rb
|
11
11
|
lib/drjekyll/cli/main.rb
|
12
|
+
lib/drjekyll/cli/new.rb
|
12
13
|
lib/drjekyll/cli/opts.rb
|
13
14
|
lib/drjekyll/cli/unzip.rb
|
15
|
+
lib/drjekyll/package.rb
|
14
16
|
lib/drjekyll/version.rb
|
15
17
|
test/data/themes.yml
|
data/README.md
CHANGED
@@ -1,2 +1,165 @@
|
|
1
|
-
# drjekyll
|
2
|
-
|
1
|
+
# drjekyll - the missing theme package manager
|
2
|
+
|
3
|
+
jekyll command line tool
|
4
|
+
|
5
|
+
* home :: [github.com/drjekyllthemes/drjekyll](https://github.com/drjekyllthemes/drjekyll)
|
6
|
+
* bugs :: [github.com/drjekyllthemes/drjekyll/issues](https://github.com/drjekyllthemes/drjekyll/issues)
|
7
|
+
* gem :: [rubygems.org/gems/drjekyll](https://rubygems.org/gems/drjekyll)
|
8
|
+
* rdoc :: [rubydoc.info/gems/drjekyll](http://rubydoc.info/gems/drjekyll)
|
9
|
+
* forum :: [wwwmake](http://groups.google.com/group/wwwmake)
|
10
|
+
|
11
|
+
|
12
|
+
## Usage
|
13
|
+
|
14
|
+
The drjekyll gem includes a command line tool that
|
15
|
+
lets you manage static site theme packages.
|
16
|
+
|
17
|
+
Try:
|
18
|
+
|
19
|
+
```
|
20
|
+
$ drjekyll --help # or
|
21
|
+
$ drj -h
|
22
|
+
```
|
23
|
+
|
24
|
+
Resulting in:
|
25
|
+
|
26
|
+
```
|
27
|
+
NAME
|
28
|
+
drjekyll/drj - jekyll command line tool .:. the missing static site package manager
|
29
|
+
|
30
|
+
SYNOPSIS
|
31
|
+
drjekyll/drj [global options] command [command options] [arguments...]
|
32
|
+
|
33
|
+
VERSION
|
34
|
+
0.1.0
|
35
|
+
|
36
|
+
GLOBAL OPTIONS
|
37
|
+
--help - Show this message
|
38
|
+
--verbose - (Debug) Show debug messages
|
39
|
+
--version - Display the program version
|
40
|
+
|
41
|
+
COMMANDS
|
42
|
+
list, ls, l - List themes
|
43
|
+
new, n - Download 'n' setup (unzip/unpack) theme
|
44
|
+
download, dl, d, get, g - (Debug) Step 1: Download theme; .zip archive saved in working folder (./)
|
45
|
+
unpack, pk, p, setup, s - (Debug) Step 2: Setup (unzip/unpack) theme; uses saved .zip archive in working folder (./)
|
46
|
+
help - Shows a list of commands or help for one command
|
47
|
+
test - (Debug) Test command suite
|
48
|
+
```
|
49
|
+
|
50
|
+
|
51
|
+
### List Themes Command - `list`, `ls`, `l`
|
52
|
+
|
53
|
+
Use:
|
54
|
+
|
55
|
+
```
|
56
|
+
$ drjekyll list # or
|
57
|
+
$ drjekyll ls # or
|
58
|
+
$ drjekyll l # or
|
59
|
+
$ drj l
|
60
|
+
```
|
61
|
+
|
62
|
+
Resulting in:
|
63
|
+
|
64
|
+
```
|
65
|
+
1..Planet Jekyll's Starter (Minimal) (starter | planetjekyllsstarterminimal) by Gerald Bauer - #white
|
66
|
+
2..Dr Jekyll's Minimal (minimial | drjekyllsminimal) by Gerald Bauer - #white
|
67
|
+
3..Dr Jekyll's Bootstrap (bootstrap | drjekyllsbootstrap) by Gerald Bauer - #bootstrap #scss #white
|
68
|
+
4..Dr Jekyll's Classics Book (classics | drjekyllsclassicsbook) by Gerald Bauer - #books #white
|
69
|
+
5..Poole (poole) by Mark Otto - #poole
|
70
|
+
6..Poole's Hyde (pooleshyde) by Mark Otto - #poole
|
71
|
+
7..Poole's Lanyon (pooleslanyon) by Mark Otto - #poole
|
72
|
+
8..Beautiful Jekyll (beautifuljekyll) by Dean Attali
|
73
|
+
...
|
74
|
+
```
|
75
|
+
|
76
|
+
Note: You can filter by name or tags; just add the query e.g.:
|
77
|
+
|
78
|
+
```
|
79
|
+
$ drjekyll list resume # or
|
80
|
+
$ drjkeyll ls resume # or
|
81
|
+
$ drjkeyll l resume # or
|
82
|
+
$ drj l resume
|
83
|
+
```
|
84
|
+
|
85
|
+
Resulting in:
|
86
|
+
|
87
|
+
```
|
88
|
+
68..Resume Cards (resumecards) by Elle Kasai - #resume
|
89
|
+
104..iCard Resume (icardresume) by Dong Liang - #resume
|
90
|
+
109..Resume (resume) by Joel Glovier - #resume
|
91
|
+
```
|
92
|
+
|
93
|
+
|
94
|
+
### New Theme Command - `new`, `n`
|
95
|
+
|
96
|
+
To download and install (unzip/unpack) a theme archive use:
|
97
|
+
|
98
|
+
```
|
99
|
+
$ drjekyll new starter # or
|
100
|
+
$ drjekyll n starter # or
|
101
|
+
$ drj n starter
|
102
|
+
```
|
103
|
+
|
104
|
+
This will download the `starter.zip` to your working folder and
|
105
|
+
unzip the archive into the `./starter` folder.
|
106
|
+
|
107
|
+
|
108
|
+
**More Examples**
|
109
|
+
|
110
|
+
To download and install (unzip/unpack):
|
111
|
+
|
112
|
+
```
|
113
|
+
7..Poole's Lanyon (pooleslanyon) by Mark Otto - #poole
|
114
|
+
```
|
115
|
+
|
116
|
+
Use:
|
117
|
+
|
118
|
+
```
|
119
|
+
$ drjekyll new pooleslanyon # or
|
120
|
+
$ drjekyll n pooleslanyon # or
|
121
|
+
$ drj n pooleslanyon
|
122
|
+
```
|
123
|
+
|
124
|
+
To download and install (unzip/unpack):
|
125
|
+
|
126
|
+
```
|
127
|
+
8..Beautiful Jekyll (beautifuljekyll) by Dean Attali
|
128
|
+
```
|
129
|
+
|
130
|
+
Use:
|
131
|
+
|
132
|
+
```
|
133
|
+
$ drjekyll new beautifuljekyll # or
|
134
|
+
$ drjekyll n beautifuljekyll # or
|
135
|
+
$ drj n beautifuljekyll
|
136
|
+
```
|
137
|
+
|
138
|
+
And so on and so forth.
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
**More Themes**
|
143
|
+
|
144
|
+
See the [Dr. Jekyll's Themes](https://drjekyllthemes.github.io) directory .
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
## Install
|
149
|
+
|
150
|
+
Just install the gem:
|
151
|
+
|
152
|
+
$ gem install drjekyll
|
153
|
+
|
154
|
+
|
155
|
+
## License
|
156
|
+
|
157
|
+
The `drjekyll` scripts are dedicated to the public domain.
|
158
|
+
Use it as you please with no restrictions whatsoever.
|
159
|
+
|
160
|
+
|
161
|
+
## Questions? Comments?
|
162
|
+
|
163
|
+
Send them along to the [wwwmake forum](http://groups.google.com/group/wwwmake).
|
164
|
+
Thanks!
|
165
|
+
|
data/Rakefile
CHANGED
@@ -18,8 +18,12 @@ Hoe.spec 'drjekyll' do
|
|
18
18
|
self.history_file = 'HISTORY.md'
|
19
19
|
|
20
20
|
self.extra_deps = [
|
21
|
-
|
21
|
+
['props', '>=1.1.2'],
|
22
|
+
['logutils', '>=0.6.1'],
|
22
23
|
['fetcher', '>= 0.4.5'],
|
24
|
+
## 3rd party
|
25
|
+
['gli', '>=2.12.2'],
|
26
|
+
['rubyzip', '>=1.1.7'],
|
23
27
|
]
|
24
28
|
|
25
29
|
self.licenses = ['Public Domain']
|
data/lib/drjekyll.rb
CHANGED
@@ -13,26 +13,26 @@ require 'yaml'
|
|
13
13
|
## 3rd party gems
|
14
14
|
require 'props' ## Use Env.home
|
15
15
|
require 'logutils'
|
16
|
+
require 'fetcher'
|
16
17
|
|
17
18
|
|
18
|
-
## require 'fetcher'
|
19
|
-
|
20
19
|
## more 3rd party gems
|
20
|
+
require 'zip' # use $ gem install rubyzip
|
21
21
|
require 'gli'
|
22
22
|
|
23
23
|
|
24
|
-
|
25
24
|
# our own code
|
26
25
|
|
27
26
|
require 'drjekyll/version' # note: version always goes first
|
28
27
|
require 'drjekyll/catalog'
|
28
|
+
require 'drjekyll/package'
|
29
29
|
|
30
30
|
require 'drjekyll/cli/opts'
|
31
31
|
require 'drjekyll/cli/main'
|
32
32
|
require 'drjekyll/cli/list'
|
33
33
|
require 'drjekyll/cli/download'
|
34
34
|
require 'drjekyll/cli/unzip'
|
35
|
-
|
35
|
+
require 'drjekyll/cli/new'
|
36
36
|
|
37
37
|
|
38
38
|
module DrJekyll
|
@@ -47,7 +47,7 @@ end # module DrJekyll
|
|
47
47
|
## DrJekyll.banner ## say hello
|
48
48
|
|
49
49
|
## for debugging
|
50
|
-
pp Env.home
|
51
|
-
pp DrJekyll.root
|
50
|
+
## pp Env.home
|
51
|
+
## pp DrJekyll.root
|
52
52
|
|
53
53
|
DrJekyll.main if __FILE__ == $0
|
data/lib/drjekyll/catalog.rb
CHANGED
@@ -3,10 +3,25 @@
|
|
3
3
|
module DrJekyll
|
4
4
|
|
5
5
|
class Catalog
|
6
|
-
|
7
|
-
def
|
6
|
+
|
7
|
+
def self.from_url( src )
|
8
|
+
worker = Fetcher::Worker.new
|
9
|
+
text = worker.read_utf8!( src )
|
10
|
+
self.from_string( text )
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.from_file( path )
|
8
14
|
## read in themes catalog
|
9
|
-
text
|
15
|
+
text = File.read( path ) ## fix: use File.read_utf8 ??
|
16
|
+
self.from_string( text )
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.from_string( text )
|
20
|
+
self.new( text )
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
def initialize( text )
|
10
25
|
@themes = YAML.load( text )
|
11
26
|
|
12
27
|
## auto-add keys for now (for quick testing)
|
@@ -70,7 +85,7 @@ class Catalog
|
|
70
85
|
end
|
71
86
|
end # method filter
|
72
87
|
|
73
|
-
def
|
88
|
+
def find( key ) ## use fetch/get/? or different name - why? why not??
|
74
89
|
## find theme by key
|
75
90
|
## fix/todo: use linear search for now; use hash lookup later
|
76
91
|
|
@@ -14,20 +14,21 @@ class DownloadCommand ## find a better name - why, why not ??
|
|
14
14
|
## note: required template name (defaults to starter for now)
|
15
15
|
key = args[0] || 'starter'
|
16
16
|
|
17
|
-
theme = @catalog.
|
18
|
-
|
17
|
+
theme = @catalog.find( key )
|
18
|
+
|
19
19
|
if theme
|
20
|
-
download( theme )
|
20
|
+
download( key, theme )
|
21
21
|
else
|
22
22
|
## todo: issue warning - why, why not??
|
23
|
+
puts "*** theme '#{key}' not found; sorry"
|
23
24
|
end
|
24
25
|
end
|
25
|
-
|
26
|
-
def download( theme )
|
27
|
-
|
28
|
-
|
26
|
+
|
27
|
+
def download( key, theme )
|
28
|
+
pak = Package.new( key, theme )
|
29
|
+
pak.download
|
29
30
|
end
|
30
|
-
|
31
|
+
|
31
32
|
end ## class DownloadCommand
|
32
33
|
|
33
34
|
end # module DrJekyll
|
data/lib/drjekyll/cli/main.rb
CHANGED
@@ -33,20 +33,30 @@ logger = LogUtils::Logger.root
|
|
33
33
|
opts = Opts.new
|
34
34
|
|
35
35
|
|
36
|
-
program_desc '
|
36
|
+
program_desc 'jekyll command line tool .:. the missing static site package manager'
|
37
37
|
version VERSION
|
38
38
|
|
39
39
|
|
40
|
-
desc 'Use only local (offline) cached data; no (online) remote network access'
|
41
|
-
switch [:l, :local], negatable: false
|
40
|
+
## desc 'Use only local (offline) cached data; no (online) remote network access'
|
41
|
+
## switch [:l, :local], negatable: false
|
42
42
|
|
43
43
|
desc '(Debug) Show debug messages'
|
44
44
|
switch [:verbose], negatable: false ## todo: use -w for short form? check ruby interpreter if in use too?
|
45
45
|
|
46
|
-
desc 'Only show warnings, errors and fatal messages'
|
47
|
-
switch [:q, :quiet], negatable: false
|
46
|
+
## desc 'Only show warnings, errors and fatal messages'
|
47
|
+
## switch [:q, :quiet], negatable: false
|
48
48
|
|
49
49
|
|
50
|
+
def self.fetch_catalog
|
51
|
+
## themes_dir = "#{DrJekyll.root}/test/data"
|
52
|
+
## catalog = Catalog.new( "#{themes_dir}/themes.yml" )
|
53
|
+
|
54
|
+
url = "https://github.com/drjekyllthemes/themes/raw/master/o/themes.yml"
|
55
|
+
|
56
|
+
catalog = Catalog.from_url( url )
|
57
|
+
catalog
|
58
|
+
end
|
59
|
+
|
50
60
|
|
51
61
|
desc "List themes"
|
52
62
|
arg_name 'QUERY' # optional search query/filter
|
@@ -54,8 +64,7 @@ command [:list,:ls,:l] do |c|
|
|
54
64
|
|
55
65
|
c.action do |g,o,args|
|
56
66
|
## read in themes diretory
|
57
|
-
|
58
|
-
catalog = Catalog.new( "#{themes_dir}/themes.yml" )
|
67
|
+
catalog = fetch_catalog
|
59
68
|
|
60
69
|
cmd = ListCommand.new( catalog, opts )
|
61
70
|
cmd.run( args )
|
@@ -65,14 +74,13 @@ end # command list
|
|
65
74
|
|
66
75
|
|
67
76
|
## use get or fetch - why, why not??
|
68
|
-
desc "Download theme; saved in
|
77
|
+
desc "(Debug) Step 1: Download theme; .zip archive saved in working folder (./)"
|
69
78
|
arg_name 'NAME' # required theme name
|
70
79
|
command [:download,:dl,:d,:get,:g] do |c|
|
71
80
|
|
72
81
|
c.action do |g,o,args|
|
73
82
|
## read in themes diretory
|
74
|
-
|
75
|
-
catalog = Catalog.new( "#{themes_dir}/themes.yml" )
|
83
|
+
catalog = fetch_catalog
|
76
84
|
|
77
85
|
cmd = DownloadCommand.new( catalog, opts )
|
78
86
|
cmd.run( args )
|
@@ -82,14 +90,13 @@ end # command download
|
|
82
90
|
|
83
91
|
|
84
92
|
## use install or unzip/unpack - why, why not??
|
85
|
-
desc "Setup (unzip/unpack) theme;
|
93
|
+
desc "(Debug) Step 2: Setup (unzip/unpack) theme; uses saved .zip archive in working folder (./)"
|
86
94
|
arg_name 'NAME' # required theme name
|
87
95
|
command [:unpack,:pk,:p,:setup,:s] do |c|
|
88
96
|
|
89
97
|
c.action do |g,o,args|
|
90
98
|
## read in themes diretory
|
91
|
-
|
92
|
-
catalog = Catalog.new( "#{themes_dir}/themes.yml" )
|
99
|
+
catalog = fetch_catalog
|
93
100
|
|
94
101
|
cmd = UnzipCommand.new( catalog, opts )
|
95
102
|
cmd.run( args )
|
@@ -103,12 +110,11 @@ arg_name 'NAME' # required theme name
|
|
103
110
|
command [:new,:n] do |c|
|
104
111
|
|
105
112
|
c.action do |g,o,args|
|
113
|
+
## read in themes diretory
|
114
|
+
catalog = fetch_catalog
|
106
115
|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
puts " download theme here"
|
111
|
-
puts " unzip/unpack (setup) here"
|
116
|
+
cmd = NewCommand.new( catalog, opts )
|
117
|
+
cmd.run( args )
|
112
118
|
puts 'Done.'
|
113
119
|
end # action
|
114
120
|
end # command setup
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
|
4
|
+
module DrJekyll
|
5
|
+
|
6
|
+
class NewCommand ## find a better name - why, why not ??
|
7
|
+
|
8
|
+
def initialize( catalog, opts )
|
9
|
+
@catalog = catalog
|
10
|
+
@opts = opts
|
11
|
+
end
|
12
|
+
|
13
|
+
def run( args )
|
14
|
+
## note: required template name (defaults to starter for now)
|
15
|
+
key = args[0] || 'starter'
|
16
|
+
|
17
|
+
theme = @catalog.find( key )
|
18
|
+
|
19
|
+
if theme
|
20
|
+
download_and_unzip( key, theme )
|
21
|
+
else
|
22
|
+
## todo: issue warning - why, why not??
|
23
|
+
puts "*** theme '#{key}' not found; sorry"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def download_and_unzip( key, theme )
|
28
|
+
pak = Package.new( key, theme )
|
29
|
+
pak.download
|
30
|
+
pak.unzip( "./#{key}" )
|
31
|
+
end
|
32
|
+
|
33
|
+
end ## class NewCommand
|
34
|
+
|
35
|
+
end # module DrJekyll
|
data/lib/drjekyll/cli/unzip.rb
CHANGED
@@ -14,20 +14,21 @@ class UnzipCommand ## find a better name - why, why not ??
|
|
14
14
|
## note: required template name (defaults to starter for now)
|
15
15
|
key = args[0] || 'starter'
|
16
16
|
|
17
|
-
theme = @catalog.
|
18
|
-
|
17
|
+
theme = @catalog.find( key )
|
18
|
+
|
19
19
|
if theme
|
20
|
-
unzip( theme )
|
20
|
+
unzip( key, theme )
|
21
21
|
else
|
22
22
|
## todo: issue warning - why, why not??
|
23
|
+
puts "*** theme '#{key}' not found; sorry"
|
23
24
|
end
|
24
25
|
end
|
25
26
|
|
26
|
-
def unzip( theme )
|
27
|
-
|
28
|
-
|
27
|
+
def unzip( key, theme )
|
28
|
+
pak = Package.new( key, theme )
|
29
|
+
pak.unzip( "./#{key}" )
|
29
30
|
end
|
30
|
-
|
31
|
+
|
31
32
|
end ## class UnzipCommand
|
32
33
|
|
33
34
|
end # module DrJekyll
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module DrJekyll
|
4
|
+
|
5
|
+
class Package
|
6
|
+
|
7
|
+
def initialize( key, hash ) ## note: for now pass in key as its own arg (not part/included in hash)
|
8
|
+
@key = key
|
9
|
+
@hash = hash
|
10
|
+
|
11
|
+
@download_url = @hash['download_url'] # as string
|
12
|
+
end
|
13
|
+
|
14
|
+
def remote_zip_url # remote zip url
|
15
|
+
@download_url # as string
|
16
|
+
end
|
17
|
+
|
18
|
+
def local_zip_name
|
19
|
+
@key # note: will NOT include/return .zip extension
|
20
|
+
end
|
21
|
+
|
22
|
+
def local_zip_dir
|
23
|
+
"." ## use ./tmp or ./dl or ~/.drjekyll/cache ??
|
24
|
+
end
|
25
|
+
|
26
|
+
def local_zip_path # local zip path
|
27
|
+
"#{local_zip_dir}/#{local_zip_name}.zip"
|
28
|
+
end
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
def download
|
33
|
+
src = remote_zip_url
|
34
|
+
dest_zip = local_zip_path
|
35
|
+
|
36
|
+
## make sure dest folder exists
|
37
|
+
FileUtils.mkdir_p( local_zip_dir ) unless Dir.exists?( local_zip_dir )
|
38
|
+
fetch_theme( src, dest_zip )
|
39
|
+
end
|
40
|
+
|
41
|
+
def unzip( unzip_dir )
|
42
|
+
src = local_zip_path
|
43
|
+
dest_unzip = unzip_dir ## local_unzip_dir
|
44
|
+
|
45
|
+
## check if folders exists? if not create folder in path
|
46
|
+
FileUtils.mkdir_p( dest_unzip ) unless Dir.exists?( dest_unzip )
|
47
|
+
unzip_theme( src, dest_unzip )
|
48
|
+
end
|
49
|
+
|
50
|
+
private
|
51
|
+
def fetch_theme( src, dest )
|
52
|
+
## step 1 - fetch archive
|
53
|
+
worker = Fetcher::Worker.new
|
54
|
+
worker.copy( src, dest )
|
55
|
+
### fix: add src.sha5
|
56
|
+
### inside folder
|
57
|
+
### lets us check if current HEAD version is in place across datafiles etc.
|
58
|
+
## - try HTTP HEAD ?? to check?
|
59
|
+
end
|
60
|
+
|
61
|
+
def unzip_theme( src, dest, opts={} )
|
62
|
+
### todo/fix: rename or remove root folder -- use opts { root: false or something??}
|
63
|
+
# e.g
|
64
|
+
# !/starter-gh-pages/_layouts/ becomes
|
65
|
+
# !/_layouts/ etc.
|
66
|
+
Zip::File.open( src ) do |zipfile|
|
67
|
+
zipfile.each do |file|
|
68
|
+
if file.directory?
|
69
|
+
puts " skip directory zip entry - #{file.name}"
|
70
|
+
else
|
71
|
+
### fix: only cut-off if master or gh-pages ???
|
72
|
+
## check if others include root folder?
|
73
|
+
name = file.name[ file.name.index('/')+1..-1] ## cut-off root/first path entry
|
74
|
+
path = File.join( dest, name)
|
75
|
+
puts " unzip file zip entry - #{file.name} to #{path}"
|
76
|
+
FileUtils.mkdir_p( File.dirname( path) )
|
77
|
+
zipfile.extract(file, path) unless File.exist?(path)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end # method unzip_theme
|
82
|
+
|
83
|
+
|
84
|
+
end # class Package
|
85
|
+
|
86
|
+
end # module DrJekyll
|
87
|
+
|
data/lib/drjekyll/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: drjekyll
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
@@ -10,6 +10,34 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2015-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: props
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.1.2
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.1.2
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: logutils
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.6.1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.6.1
|
13
41
|
- !ruby/object:Gem::Dependency
|
14
42
|
name: fetcher
|
15
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -24,6 +52,34 @@ dependencies:
|
|
24
52
|
- - ">="
|
25
53
|
- !ruby/object:Gem::Version
|
26
54
|
version: 0.4.5
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: gli
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.12.2
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 2.12.2
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubyzip
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.1.7
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.1.7
|
27
83
|
- !ruby/object:Gem::Dependency
|
28
84
|
name: rdoc
|
29
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -75,8 +131,10 @@ files:
|
|
75
131
|
- lib/drjekyll/cli/download.rb
|
76
132
|
- lib/drjekyll/cli/list.rb
|
77
133
|
- lib/drjekyll/cli/main.rb
|
134
|
+
- lib/drjekyll/cli/new.rb
|
78
135
|
- lib/drjekyll/cli/opts.rb
|
79
136
|
- lib/drjekyll/cli/unzip.rb
|
137
|
+
- lib/drjekyll/package.rb
|
80
138
|
- lib/drjekyll/version.rb
|
81
139
|
- test/data/themes.yml
|
82
140
|
homepage: https://github.com/drjekyllthemes/drjekyll
|