soupcms-cli 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/soupcms/cli/version.rb +1 -1
- data/lib/soupcms/soupcms_cli.rb +29 -23
- data/lib/templates/.gitignore +20 -0
- data/lib/templates/pages/default.yml +0 -4
- data/lib/templates/public/common/stylesheets/_custom-variables.scss +4 -0
- data/lib/templates/single-app-config.ru +3 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96ab0c89df4305acdefb49bc2016f9341f593d84
|
4
|
+
data.tar.gz: aae155db0adbefd86c38d8e17ab2c051b95add7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5a032a84906fab09ef3334916ac914fc3178defd6621f5c2b3007c9ea95913f1078e26b9d52afe24c110bb12567557c7906855cb4e26946db12f3b3e708cd86
|
7
|
+
data.tar.gz: d45210a25e4088abe438ab14e1b1e736178120198204edc4390a7b400539693d13f2b3958f0b89368cb9deb591fee35c12bce73c92ee08340a07e55b34c74480
|
data/Gemfile.lock
CHANGED
data/lib/soupcms/cli/version.rb
CHANGED
data/lib/soupcms/soupcms_cli.rb
CHANGED
@@ -15,13 +15,18 @@ class SoupCMSCLI < Thor
|
|
15
15
|
attr_reader :configs
|
16
16
|
|
17
17
|
desc 'new <name>', 'create new application'
|
18
|
+
method_option :skip_dir, type: :boolean, aliases: '-t', default: false, desc: 'Skip top level directory for application.'
|
18
19
|
method_option :generate, type: :boolean, aliases: '-g', default: false, desc: 'Generate NEW soupcms application. Default is false.'
|
19
20
|
def new(name)
|
20
21
|
configs[:name] = name
|
21
22
|
configs[:display_name] = ask('Short display application name? (10 to 15 char) :', :green)
|
22
23
|
configs[:description] = ask('Long application description? (30 to 40 char) :', :green)
|
23
24
|
|
24
|
-
|
25
|
+
if yes?('Would you like to host your website public on platform like Heroku? (y/n):', :cyan)
|
26
|
+
configs[:site_name] = ask('Provide the hostname for your website (e.g. http://myblog.herokuapp.com OR http://www.myblog.com) :', :green)
|
27
|
+
end
|
28
|
+
|
29
|
+
configs[:blog] = yes?('Blog support? (y/n):', :cyan)
|
25
30
|
if configs[:blog]
|
26
31
|
say('Choose blog layout? (y/n):',:green)
|
27
32
|
blog_layouts = [[1, 'full-width'], [2, 'right-sidebar'], [3, 'left-sidebar']]
|
@@ -30,40 +35,41 @@ class SoupCMSCLI < Thor
|
|
30
35
|
configs[:blog_layout] = blog_layouts[layout.to_i - 1][1]
|
31
36
|
end
|
32
37
|
|
38
|
+
top_dir = options.skip_dir? ? '.' : name
|
39
|
+
data_folder = "#{top_dir}/data/#{name}"
|
33
40
|
if configs[:blog]
|
34
|
-
template 'lib/templates/pages/blog-post.yml',"
|
35
|
-
template 'lib/templates/pages/posts.yml',"
|
41
|
+
template 'lib/templates/pages/blog-post.yml',"#{data_folder}/pages/blog-post.yml"
|
42
|
+
template 'lib/templates/pages/posts.yml',"#{data_folder}/pages/posts.yml"
|
36
43
|
end
|
37
|
-
copy_file 'lib/templates/public/favicon.png',
|
44
|
+
copy_file 'lib/templates/public/favicon.png', "#{top_dir}/public/favicon.png"
|
45
|
+
copy_file 'lib/templates/public/common/stylesheets/_custom-variables.scss', "#{top_dir}/public/common/stylesheets/_custom-variables.scss"
|
38
46
|
|
39
|
-
template 'lib/templates/schemaless/footer.yml',"
|
40
|
-
template 'lib/templates/schemaless/navigation.yml',"
|
41
|
-
template 'lib/templates/schemaless/social-toolbar.yml',"
|
47
|
+
template 'lib/templates/schemaless/footer.yml',"#{data_folder}/schemaless/footer.yml"
|
48
|
+
template 'lib/templates/schemaless/navigation.yml',"#{data_folder}/schemaless/navigation.yml"
|
49
|
+
template 'lib/templates/schemaless/social-toolbar.yml',"#{data_folder}/schemaless/social-toolbar.yml"
|
42
50
|
|
43
|
-
template 'lib/templates/pages/default.yml',"
|
44
|
-
template 'lib/templates/pages/home.yml',"
|
45
|
-
template 'lib/templates/pages/about.md',"
|
51
|
+
template 'lib/templates/pages/default.yml',"#{data_folder}/pages/default.yml"
|
52
|
+
template 'lib/templates/pages/home.yml',"#{data_folder}/pages/home.yml"
|
53
|
+
template 'lib/templates/pages/about.md',"#{data_folder}/pages/about.md"
|
46
54
|
|
47
|
-
template 'lib/templates/Gemfile',
|
48
|
-
template 'lib/templates/Procfile',
|
55
|
+
template 'lib/templates/Gemfile', "#{top_dir}/Gemfile"
|
56
|
+
template 'lib/templates/Procfile', "#{top_dir}/Procfile"
|
57
|
+
template 'lib/templates/.gitignore', "#{top_dir}/.gitignore"
|
49
58
|
|
50
|
-
|
51
|
-
configs[:site_name] = ask('Provide the hostname for your website (e.g. http://myblog.herokuapp.com OR http://www.myblog.com) :', :green)
|
52
|
-
end
|
53
|
-
template 'lib/templates/single-app-config.ru', 'config.ru'
|
59
|
+
template 'lib/templates/single-app-config.ru', "#{top_dir}/config.ru"
|
54
60
|
|
55
61
|
if configs[:blog]
|
56
|
-
while yes?('Would you like to add blog post? (y/n):', :
|
57
|
-
post(configs[:name])
|
62
|
+
while yes?('Would you like to add blog post? (y/n):', :cyan)
|
63
|
+
post(configs[:name], top_dir)
|
58
64
|
end
|
59
65
|
end
|
60
66
|
|
61
67
|
|
62
|
-
create_file "data/#{name}/_config.yml", YAML.dump(JSON.parse(configs.to_json))
|
68
|
+
create_file "#{top_dir}/data/#{name}/_config.yml", YAML.dump(JSON.parse(configs.to_json))
|
63
69
|
end
|
64
70
|
|
65
71
|
desc 'post <name>', 'create new post for given application name'
|
66
|
-
def post(name)
|
72
|
+
def post(name, top_dir = '.')
|
67
73
|
configs[:name] = name
|
68
74
|
configs[:title] = ask('Title for the new post? (20 to 30 char) :', :green)
|
69
75
|
sanitize_title = configs[:title].gsub(' ','-').gsub('\'','').gsub(',','').downcase #TODO: proper sanitization
|
@@ -71,9 +77,9 @@ class SoupCMSCLI < Thor
|
|
71
77
|
tags = ask('Tags as comma separated list:', :green)
|
72
78
|
configs[:tags] = tags.split(',')
|
73
79
|
|
74
|
-
template 'lib/templates/blog/my-first-post.md',"data/#{name}/posts/#{sanitize_title}.md"
|
75
|
-
copy_file 'lib/templates/public/blog/posts/images/my-first-post.png',"public/#{name}/posts/images/#{sanitize_title}.png"
|
76
|
-
copy_file 'lib/templates/public/blog/posts/images/my-first-post/1-post-image.png',"public/#{name}/posts/images/#{sanitize_title}/1-post-image.png"
|
80
|
+
template 'lib/templates/blog/my-first-post.md',"#{top_dir}/data/#{name}/posts/#{sanitize_title}.md"
|
81
|
+
copy_file 'lib/templates/public/blog/posts/images/my-first-post.png',"#{top_dir}/public/#{name}/posts/images/#{sanitize_title}.png"
|
82
|
+
copy_file 'lib/templates/public/blog/posts/images/my-first-post/1-post-image.png',"#{top_dir}/public/#{name}/posts/images/#{sanitize_title}/1-post-image.png"
|
77
83
|
end
|
78
84
|
|
79
85
|
desc 'delete <name>', 'delete application'
|
@@ -33,10 +33,6 @@
|
|
33
33
|
data:
|
34
34
|
title: <%= configs[:display_name] %>
|
35
35
|
sub_headline: <%= configs[:description] %>
|
36
|
-
image:
|
37
|
-
source: cloudinary
|
38
|
-
base_url: http://res.cloudinary.com/sunitparekh/image/upload
|
39
|
-
desktop: purple-textures-low_xiamgc.jpg
|
40
36
|
return: page-header
|
41
37
|
template:
|
42
38
|
type: slim
|
@@ -15,6 +15,9 @@ SoupCMS::Common::Strategy::Application::SingleApp.configure do |app|
|
|
15
15
|
app.soupcms_api_url = 'http://localhost:9292/api'
|
16
16
|
app.app_base_url = 'http://localhost:9292/'
|
17
17
|
end
|
18
|
+
<%- else %>
|
19
|
+
app.soupcms_api_url = 'http://localhost:9292/api'
|
20
|
+
app.app_base_url = 'http://localhost:9292/'
|
18
21
|
<%- end %>
|
19
22
|
end
|
20
23
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soupcms-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sunit Parekh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -84,6 +84,7 @@ files:
|
|
84
84
|
- lib/soupcms/cli/resolve_file_reference.rb
|
85
85
|
- lib/soupcms/cli/version.rb
|
86
86
|
- lib/soupcms/soupcms_cli.rb
|
87
|
+
- lib/templates/.gitignore
|
87
88
|
- lib/templates/Gemfile
|
88
89
|
- lib/templates/Procfile
|
89
90
|
- lib/templates/blog/my-first-post.md
|
@@ -94,6 +95,7 @@ files:
|
|
94
95
|
- lib/templates/pages/posts.yml
|
95
96
|
- lib/templates/public/blog/posts/images/my-first-post.png
|
96
97
|
- lib/templates/public/blog/posts/images/my-first-post/1-post-image.png
|
98
|
+
- lib/templates/public/common/stylesheets/_custom-variables.scss
|
97
99
|
- lib/templates/public/favicon.png
|
98
100
|
- lib/templates/schemaless/footer.yml
|
99
101
|
- lib/templates/schemaless/navigation.yml
|