soupcms-cli 0.5.2 → 0.5.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0cf73d4b0e7003bb578bab9390ff350541c762a9
4
- data.tar.gz: c12497c81b08dbc06eeba6dcdd188dc38ae2dbdc
3
+ metadata.gz: 96ab0c89df4305acdefb49bc2016f9341f593d84
4
+ data.tar.gz: aae155db0adbefd86c38d8e17ab2c051b95add7e
5
5
  SHA512:
6
- metadata.gz: e15ec4f245720679d476086dffdab22528c5daa5e0fedc1622952d96c3fc1b5536fe4fc8fd735d33f570f5f77a87b8850caf2e330f35e15f7d36972d5d6103dd
7
- data.tar.gz: 9430aca448909585c5aa97d3e719dd6ae46e7c59b390223e1ae5d2ae8f9e9dc1dedb4d55f6cc7f99d6b39d0f5358a2852d865d698479becf0291e7c824596e34
6
+ metadata.gz: b5a032a84906fab09ef3334916ac914fc3178defd6621f5c2b3007c9ea95913f1078e26b9d52afe24c110bb12567557c7906855cb4e26946db12f3b3e708cd86
7
+ data.tar.gz: d45210a25e4088abe438ab14e1b1e736178120198204edc4390a7b400539693d13f2b3958f0b89368cb9deb591fee35c12bce73c92ee08340a07e55b34c74480
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- soupcms-cli (0.5.2)
4
+ soupcms-cli (0.5.3)
5
5
  bson_ext (~> 1.10)
6
6
  mongo (~> 1.10)
7
7
  thor (~> 0.19)
@@ -1,5 +1,5 @@
1
1
  module Soupcms
2
2
  module Cli
3
- VERSION = '0.5.2'
3
+ VERSION = '0.5.3'
4
4
  end
5
5
  end
@@ -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
- configs[:blog] = yes?('Blog support? (y/n):', :blue)
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',"data/#{name}/pages/blog-post.yml"
35
- template 'lib/templates/pages/posts.yml',"data/#{name}/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', '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',"data/#{name}/schemaless/footer.yml"
40
- template 'lib/templates/schemaless/navigation.yml',"data/#{name}/schemaless/navigation.yml"
41
- template 'lib/templates/schemaless/social-toolbar.yml',"data/#{name}/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',"data/#{name}/pages/default.yml"
44
- template 'lib/templates/pages/home.yml',"data/#{name}/pages/home.yml"
45
- template 'lib/templates/pages/about.md',"data/#{name}/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', 'Gemfile'
48
- template 'lib/templates/Procfile', '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
- if yes?('Would you like to host your website public on platform like Heroku? (y/n):', :blue)
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):', :blue)
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'
@@ -0,0 +1,20 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ InstalledFiles
7
+ _yardoc
8
+ coverage
9
+ doc/
10
+ lib/bundler/man
11
+ pkg
12
+ rdoc
13
+ spec/reports
14
+ test/tmp
15
+ test/version_tmp
16
+ tmp
17
+ .idea
18
+ prod-admin.env
19
+ log
20
+ prod.env
@@ -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
@@ -0,0 +1,4 @@
1
+ // define you theme
2
+
3
+ //$font-family-sans-serif: 'Open Sans', Helvetica, Arial, sans-serif !default;
4
+ //$brand-primary: #563d7c;
@@ -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.2
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 00:00:00.000000000 Z
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