gentheme 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/gentheme/gem.rb +25 -4
- data/lib/gentheme/version.rb +1 -1
- data/templates/gitignore.erb +30 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1123f5b4c56088d3e819a85bf2a0384a91f1c17
|
4
|
+
data.tar.gz: 1c8e01c5d85b2e91cd7465bd1a182a8800420ad5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f99adc8d7510790ef8bb81fee5ccd26f960ad359b57f698f653522f3cda9017d6ad140678884646c34e6ba85242dc0a1c08197325d720677fb6cc5702a6d09a0
|
7
|
+
data.tar.gz: 2e5a2f20d2e06d4d7fd3a4602c5994ee14148b4e593de1a08780928429bdffd5570feb7d3cad3f9bab110394eb43b9ad2eef705ba02c1624d7400b91c7f560f3
|
data/README.md
CHANGED
@@ -39,6 +39,8 @@ to create a folder ```themename``` inside which will be all the resources. The i
|
|
39
39
|
|
40
40
|
Once finished, open your broser at ```http://themename``` and you'll see your starter theme.
|
41
41
|
|
42
|
+
Use the option ```--path=./``` to install the app without creating a folder named as theme name.
|
43
|
+
|
42
44
|
## Structure
|
43
45
|
|
44
46
|
The theme is created in the ```themename/app``` folder.
|
data/lib/gentheme/gem.rb
CHANGED
@@ -97,6 +97,13 @@ module Gentheme
|
|
97
97
|
puts 'Virtualhost already created'
|
98
98
|
end
|
99
99
|
|
100
|
+
# generate structure
|
101
|
+
if !get_status(:structure, :packages)
|
102
|
+
generate_structure
|
103
|
+
else
|
104
|
+
puts 'Structure already created'
|
105
|
+
end
|
106
|
+
|
100
107
|
# create a starter theme
|
101
108
|
if !get_status(:starter_theme, :packages)
|
102
109
|
create_starter_theme
|
@@ -269,21 +276,35 @@ module Gentheme
|
|
269
276
|
system("virtualhost.sh #{name} #{base_path}/wordpress")
|
270
277
|
set_status(:virtualhost, true, :packages)
|
271
278
|
end
|
279
|
+
end
|
280
|
+
|
281
|
+
def generate_structure
|
282
|
+
puts 'generating structure...'
|
283
|
+
if !get_status(:structure, :packages)
|
284
|
+
generate_subdirectories
|
285
|
+
generate_file('gitignore.erb', '.gitignore')
|
286
|
+
set_status(:structure, true, :packages)
|
287
|
+
end
|
272
288
|
|
273
289
|
end
|
274
290
|
|
291
|
+
|
292
|
+
|
275
293
|
def create_starter_theme
|
276
294
|
puts 'Creating starter theme...'
|
277
295
|
if !get_status(:starter_theme, :packages)
|
278
296
|
system("#{enter_base_path} && cd wordpress && wp core config --dbname=#{name} --dbuser=root --dbhost=127.0.0.1 --skip-check")
|
279
297
|
system("#{enter_base_path} && cd wordpress && wp core install --title=#{name} --admin_user=admin --admin_password=#{name} --admin_email=youremail@#{name}.example.com --url=http://#{name} ")
|
280
298
|
system("#{enter_base_path} && rm wordpress/wp-content/themes/#{name}")
|
281
|
-
system("#{enter_base_path} && mv app app_#{rand(10000)}")
|
282
|
-
system("#{enter_base_path} && mkdir app")
|
299
|
+
#system("#{enter_base_path} && mv app app_#{rand(10000)}")
|
300
|
+
#system("#{enter_base_path} && mkdir app")
|
283
301
|
system("#{enter_base_path} && cd wordpress && wp scaffold _s #{name} --activate")
|
284
302
|
system("#{enter_base_path} && mv wordpress/wp-content/themes/#{name}/* app/")
|
285
303
|
system("#{enter_base_path} && rmdir wordpress/wp-content/themes/#{name}")
|
286
|
-
system("#{enter_base_path} && ln -s #{base_path}/
|
304
|
+
system("#{enter_base_path} && ln -s #{base_path}/build wordpress/wp-content/themes/#{name}")
|
305
|
+
system("#{enter_base_path} && rm app/index.html")
|
306
|
+
system("#{enter_base_path} && mv app/js/* app/scripts")
|
307
|
+
system("#{enter_base_path} && rmdir app/js")
|
287
308
|
set_status(:starter_theme, true, :packages)
|
288
309
|
end
|
289
310
|
|
@@ -321,7 +342,7 @@ module Gentheme
|
|
321
342
|
|
322
343
|
def generate_subdirectories
|
323
344
|
['build'].each do |dir|
|
324
|
-
FileUtils.mkdir(path_to(dir))
|
345
|
+
FileUtils.mkdir(path_to(dir)) rescue "Folder #{dir} already exists"
|
325
346
|
end
|
326
347
|
end
|
327
348
|
|
data/lib/gentheme/version.rb
CHANGED
@@ -0,0 +1,30 @@
|
|
1
|
+
## General
|
2
|
+
.cvs
|
3
|
+
.htaccess
|
4
|
+
.svn
|
5
|
+
*.bak
|
6
|
+
*.log
|
7
|
+
*.swp
|
8
|
+
logs
|
9
|
+
|
10
|
+
## Windows
|
11
|
+
Desktop.ini
|
12
|
+
Thumbs.db
|
13
|
+
|
14
|
+
## Mac
|
15
|
+
.DS_Store
|
16
|
+
|
17
|
+
## WordPress
|
18
|
+
wordpress
|
19
|
+
|
20
|
+
## Development
|
21
|
+
.sass-cache
|
22
|
+
bower_components
|
23
|
+
node_modules
|
24
|
+
build
|
25
|
+
dist
|
26
|
+
image_demo
|
27
|
+
docs/site
|
28
|
+
themeforest
|
29
|
+
PSD
|
30
|
+
materiale
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gentheme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michele Gobbi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -134,6 +134,7 @@ files:
|
|
134
134
|
- lib/gentheme.rb
|
135
135
|
- lib/gentheme/gem.rb
|
136
136
|
- lib/gentheme/version.rb
|
137
|
+
- templates/gitignore.erb
|
137
138
|
homepage: https://github.com/dynamick/gentheme
|
138
139
|
licenses:
|
139
140
|
- MIT
|