pave 0.4.0 → 0.5.0

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: 51010f11d688daf56a02e4d565813dcec29436dc
4
- data.tar.gz: a2e67566e859660b1f2ad07c0748ed6075b200ce
3
+ metadata.gz: 73f1328426b5077aeaa1d8f9a7056cb0d23f4966
4
+ data.tar.gz: 6d44d7901e194239707394d3c46739a71c358869
5
5
  SHA512:
6
- metadata.gz: a0dee91466eb5f6092fcf3c7be14e66791ad505628a364ebabbeb214b8333e6d484d9f8db107c135a7de6e0ff16fa2a24bf7659b84209ebf7c07053c389b441b
7
- data.tar.gz: 0d3cc447999ccb062a9b87d237c58e060f896d53e0c215d641ff43bf9dd997bba83d297e5f7739f4ba088d683327f4146f05e8b14b190c7539c54f508efcd8b3
6
+ metadata.gz: a4cd5bb23917e1b6d991a298409cefbb36e0c649ddb8e9d3bbd50e384e7d0df7e5d7f043b2be73f58d412a213076eb90fef38c8afee1369efe9dff248074272a
7
+ data.tar.gz: dce87fdfcb7ef23f116001cde04e2fcb1b134856432dec4462555e7367bfb1120de4a5bb1f270d4dfa2c69c93391dd8060e332ad6b258e4c3ef0ac04fed69406
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pave (0.2.3)
4
+ pave (0.4.3999)
5
5
  commander (~> 4.1.5)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,52 +1,89 @@
1
1
  # pave - Command line tools for Concrete5 websites
2
2
 
3
- Author: Jamon Holmgren (@jamonholmgren)
3
+ Authors: Jamon Holmgren (@jamonholmgren), Ryan Linton (@ryanlntn)
4
4
 
5
- Provides a set of command line tools for Concrete5.
5
+ Provides a set of command line tools for setting up and developing [Concrete5](http://www.concrete5.org/) websites.
6
6
 
7
- ## Installation
7
+ *Requirements:* Designed for Ruby 2.0+ running on OS X Mavericks.
8
+
9
+ # Installation
8
10
 
9
11
  $ gem install pave
10
12
 
11
- ## Usage
13
+ # Usage
12
14
 
13
- #### Create a new Concrete5 website:
15
+ ## Create a new Concrete5 website
14
16
 
15
17
  $ pave new mywebsite
16
18
 
17
19
  This:
18
20
 
19
- 1. Downloads Concrete 5.6.2.1
21
+ 1. Downloads Concrete 5.6.2.1 (once) into `~/.pave`
20
22
  2. Unzips it into `mywebsite`
21
- 3. Removes extra folders
22
- 4. Builds an app folder of commonly used folders (symlinked into the root folder so Concrete5 can find them)
23
- 5. Initializes a Git repo and adds the first ("Initial") commit.
23
+ 3. Removes extra folders and sets up folder permissions
24
+ 4. Adds a `.gitignore` and `.keep`s
25
+ 5. Attempts to create a virtual host `mywebsite.site`
24
26
 
25
- #### Deployments
27
+ ## Deployments
26
28
 
27
29
  $ pave deploy:setup
28
30
 
29
- This sets up a deployment script to the remote server and deploys an initial version.
31
+ This sets up a Git-based deployment script to the remote server and deploys an initial version. SSH access is required.
30
32
 
31
33
  $ pave deploy
32
34
 
33
35
  Deploys the site using git.
34
36
 
35
- #### Database
37
+ ## Database
38
+
39
+ $ pave db:create mydatabase
36
40
 
37
- TODO:
41
+ Creates a local MySQL database called `mydatabase`
38
42
 
39
- $ pave db:create
40
43
  $ pave db:push
44
+
45
+ *TODO:* Copies the local Concrete5 database to the remote database. Useful for deploying to staging sites.
46
+
41
47
  $ pave db:pull
42
- $ pave db:backup
43
48
 
44
- #### Help
49
+ *TODO:* Copies the remote Concrete5 database into the local database. Useful for obtaining production data for testing.
50
+
51
+ $ pave db:dump
52
+
53
+ Creates a database dump file and places it in `.db/YYYY-MM-DD-database.sql.gz`.
54
+
55
+ ## Virtual host setup
56
+
57
+ $ pave vh:create myhost.site
58
+
59
+ Sets up an Apache virtual host in the current directory on `myhost.site`.
60
+
61
+ $ pave vh:remove myhost.site
62
+
63
+ Removes myhost.site virtual host.
64
+
65
+ $ pave vh:backup
66
+
67
+ Backs up your hosts file and vhost file.
68
+
69
+ $ pave vh:restore
70
+
71
+ Restores your previously backed up virtual host file.
72
+
73
+ $ pave vh:restart
74
+
75
+ Restarts Apache.
76
+
77
+ ## Help
78
+
79
+ $ pave help
45
80
 
46
- $ pave --help
47
-
48
81
  Outputs common tasks that pave can do.
49
82
 
83
+ ## Updating
84
+
85
+ $ pave update
86
+
50
87
  ## Contributing
51
88
 
52
89
  0. Create an issue explaining what you'd like to do and get feedback
data/bin/pave CHANGED
@@ -130,20 +130,39 @@ command :"db:dump" do |c|
130
130
  Pave::Database.new(name).dump
131
131
  end
132
132
  end
133
+ alias_command :"db:backup", :"db:dump"
133
134
 
134
- command :"db:download" do |c|
135
- c.syntax = "pave db:download"
135
+ command :"db:pull" do |c|
136
+ c.syntax = "pave db:pull"
136
137
  c.description = "Download the project's live database and replace local database."
137
138
  c.action do |args|
138
- say "`db:download` command not implemented yet."
139
+ say "`db:pull` command not implemented yet."
139
140
  end
140
141
  end
141
142
 
142
- command :"db:upload" do |c|
143
- c.syntax = "pave db:upload"
143
+ command :"db:push" do |c|
144
+ c.syntax = "pave db:push"
144
145
  c.description = "Upload the project's local database and replace the live database."
145
146
  c.action do |args|
146
- say "`db:upload` command not implemented yet."
147
+ say "`db:push` command not implemented yet."
148
+ end
149
+ end
150
+
151
+ command :"generate:theme" do |c|
152
+ c.syntax = "pave generate:theme THEME_NAME"
153
+ c.description = "Set up a blank theme with sass."
154
+ c.action do |args|
155
+ name = args.first || "#{File.basename(Dir.pwd)}"
156
+ Pave::Theme.create(name)
157
+ end
158
+ end
159
+ alias_command :"g:theme", :"generate:theme"
160
+
161
+ command :watch do |c|
162
+ c.syntax = "pave watch"
163
+ c.description = "Watch for sass changes."
164
+ c.action do |args|
165
+ Pave::Theme.watch
147
166
  end
148
167
  end
149
168
 
@@ -151,7 +170,7 @@ command :"deploy" do |c|
151
170
  c.syntax = "pave deploy"
152
171
  c.description = "Deploy project to web server."
153
172
  c.action do |args|
154
- remote = args[0] || "production"
173
+ remote = args[0] || "live"
155
174
  branch = args[1] || "master"
156
175
  Pave::Deploy.new.deploy(remote, branch)
157
176
  end
data/lib/pave/concrete.rb CHANGED
@@ -16,6 +16,7 @@ module Pave
16
16
  end
17
17
 
18
18
  def setup
19
+ set_up_pave
19
20
  clone_concrete5
20
21
  set_up_folders
21
22
  set_up_git
@@ -23,15 +24,19 @@ module Pave
23
24
  self
24
25
  end
25
26
 
27
+ def set_up_pave
28
+ sh "mkdir ~/.pave" unless File.exists?(File.join(Dir.home, ".pave/"))
29
+ end
30
+
26
31
  def clone_concrete5
27
- say "* Downloading Concrete5 version 5.6.2.1..."
28
- sh "curl http://www.concrete5.org/download_file/-/view/58379/8497 -o c5.zip > /dev/null"
29
- say ""
30
- say "* Unzipping..."
31
- sh "unzip c5.zip"
32
- sh "rm c5.zip"
33
- sh "mv concrete5.6.2.1 #{name}"
34
- say "* Concrete5 downloaded and unzipped into ./#{name}."
32
+ c5 = "concrete5.6.2.1"
33
+ c5_link = "http://www.concrete5.org/download_file/-/view/58379/8497"
34
+ unless File.exists?(File.join(Dir.home, ".pave/#{c5}.zip"))
35
+ say "* Downloading #{c5}..."
36
+ sh "curl #{c5_link} > ~/.pave/#{c5}.zip"
37
+ end
38
+ say "* Copying Concrete5 into #{name}..."
39
+ sh "unzip -qq ~/.pave/#{c5}.zip && mv #{c5} #{name}"
35
40
  end
36
41
 
37
42
  def set_up_folders
@@ -56,7 +61,9 @@ module Pave
56
61
  "files/incoming/*",
57
62
  "files/thumbnails/*",
58
63
  "files/tmp/*",
59
- "files/trash/*"
64
+ "files/trash/*",
65
+ ".sass-cache",
66
+ "stylesheets"
60
67
  ]
61
68
  end
62
69
 
@@ -88,7 +95,7 @@ module Pave
88
95
  end
89
96
 
90
97
  def world_writable_folders
91
- %w{ config packages files }
98
+ %w{ blocks config packages files }
92
99
  end
93
100
 
94
101
  def gitkeep_folders
data/lib/pave/database.rb CHANGED
@@ -20,8 +20,16 @@ module Pave
20
20
  end
21
21
 
22
22
  def dump
23
- say "Creating dump of #{name} at #{Dir.pwd}/#{Time.now.strftime("%Y-%m-%d")}-#{name}.sql.gz"
24
- sh "mysqldump -uroot #{name} | gzip > #{Time.now.strftime("%Y-%m-%d")}-#{name}.sql.gz"
23
+ if !File.directory?('db')
24
+ sh "mkdir ./db"
25
+ sh "echo '<?= die(); ?>' > ./db/index.php"
26
+ sh "echo 'deny from all' > ./db/.htaccess"
27
+ sh "sudo chmod -R 700 ./db/"
28
+ end
29
+ dbname = Time.now.strftime("%Y-%m-%d-%H%M") + "-" + name + ".sql.gz"
30
+ say "Creating dump of #{name} at #{Dir.pwd}/db/#{dbname}"
31
+ sh "mysqldump -uroot #{name} | gzip > ./db/#{dbname}"
32
+ say "Dump complete."
25
33
  end
26
34
 
27
35
  def download(host, user, password)
data/lib/pave/deploy.rb CHANGED
@@ -5,7 +5,7 @@ module Pave
5
5
  def setup
6
6
  server = ask "Username and hostname of the remote server (e.g. user@server.com): "
7
7
  folder = ask "Name of the remote directory (e.g. ~/webapps/appname/): "
8
- remote = ask "Desired git remote name (e.g. production): "
8
+ remote = ask "Desired git remote name (e.g. live): "
9
9
  script = File.join(File.expand_path("../..", File.dirname(__FILE__)), "resources/deploy.sh")
10
10
 
11
11
  puts "Piping shell script to #{server} for setup."
@@ -17,7 +17,7 @@ module Pave
17
17
  puts "Finished! You may now run `pave deploy` to deploy your application."
18
18
  end
19
19
 
20
- def deploy(remote="production", branch="master")
20
+ def deploy(remote="live", branch="master")
21
21
  sh "git push #{remote} #{branch}"
22
22
  end
23
23
  end
data/lib/pave/theme.rb ADDED
@@ -0,0 +1,62 @@
1
+ require "pave/shell"
2
+
3
+ module Pave
4
+ class Theme
5
+ include Pave::Shell
6
+
7
+ attr_reader :name
8
+
9
+ def self.create(name)
10
+ new(name).setup
11
+ end
12
+
13
+ def self.watch
14
+ `sass --watch ./themes/ --style compressed`
15
+ end
16
+
17
+ def initialize(name)
18
+ @name = name
19
+ end
20
+
21
+ def install_sass
22
+ say "Installing SASS..."
23
+ sh "gem install sass"
24
+ end
25
+
26
+ def install_bourbon
27
+ say "Installing Bourbon..."
28
+ sh "gem install bourbon"
29
+ sh "cd themes/#{self.name}/css/ && bourbon install && cd -"
30
+ end
31
+
32
+ def install_neat
33
+ say "Installing Neat..."
34
+ sh "gem install neat"
35
+ sh "cd themes/#{self.name}/css/ && neat install && cd -"
36
+ end
37
+
38
+ def install_bitters
39
+ say "Installing Bitters"
40
+ sh "gem install bitters"
41
+ sh "cd themes/#{self.name}/css/ && bitters install && cd -"
42
+ end
43
+
44
+ def copy_theme
45
+ sh "cp -a #{Pave.template_folder}/themes/blank #{Dir.pwd}/themes/#{self.name}"
46
+ end
47
+
48
+ def setup
49
+ say "Creating theme..."
50
+ copy_theme
51
+ install_sass
52
+ install_bourbon
53
+ install_neat
54
+ install_bitters
55
+ say "Docs for Neat: http://neat.bourbon.io/"
56
+ say "Docs for Bitters: https://github.com/thoughtbot/bitters"
57
+ say ""
58
+ say "Theme installed. Run `pave watch` to generate css from your sass files."
59
+ end
60
+
61
+ end
62
+ end
data/lib/pave/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pave
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
data/lib/pave.rb CHANGED
@@ -4,6 +4,7 @@ require "pave/shell"
4
4
  require "pave/concrete"
5
5
  require "pave/database"
6
6
  require "pave/virtual_host"
7
+ require "pave/theme"
7
8
  require "pave/deploy"
8
9
 
9
10
  module Pave
@@ -13,4 +14,10 @@ module Pave
13
14
  ($? == 0) ? (say "Updated") : (say "Update failed. Run `gem update pave` manually.")
14
15
  end
15
16
  module_function :update
17
+
18
+ def template_folder
19
+ script = File.join(File.expand_path("../", File.dirname(__FILE__)), "templates")
20
+ end
21
+ module_function :template_folder
22
+
16
23
  end
@@ -0,0 +1,2 @@
1
+ @import 'bourbon/_bourbon';
2
+ @import 'neat/_neat';
@@ -0,0 +1,12 @@
1
+ <?php
2
+ defined('C5_EXECUTE') or die("Access Denied.");
3
+ $this->inc('elements/header.php');
4
+ ?>
5
+
6
+ <?php
7
+ $a = new Area('Main');
8
+ $a->display($c);
9
+ ?>
10
+
11
+
12
+ <?php $this->inc('elements/footer.php'); ?>
@@ -0,0 +1,2 @@
1
+ Theme
2
+ If you don't know what you are doing, do NOT change the theme, as it will break the website! | Theme developed by ... | All Rights Reserved
@@ -0,0 +1,13 @@
1
+ <?php defined('C5_EXECUTE') or die("Access Denied."); ?>
2
+
3
+
4
+ <?php
5
+ $a = new GlobalArea('Footer - Meta');
6
+ $a->display($c);
7
+ ?>
8
+
9
+
10
+ <?php Loader::element('footer_required'); ?>
11
+ <script src='<?= $this->getThemePath(); ?>/js/scripts.js'></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1,36 @@
1
+ <?php defined('C5_EXECUTE') or die("Access Denied.");
2
+ $this->inc('includes/view_helpers.php');
3
+ ?>
4
+ <!DOCTYPE html>
5
+ <html lang="<?php echo LANGUAGE?>">
6
+ <head>
7
+ <?php Loader::element('header_required'); ?>
8
+
9
+ <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/normalize/2.1.3/normalize.min.css" />
10
+ <link rel="stylesheet" href="<?= $this->getThemePath(); ?>/css/styles.css" />
11
+
12
+ <!--[if lt IE 9]>
13
+ <script src='//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.2/html5shiv.js'></script>
14
+ <![endif]-->
15
+ </head>
16
+
17
+ <body class="<?= $c->getCollectionTypeHandle(); ?>">
18
+
19
+
20
+ <!-- BLOCK EXAMPLE -->
21
+ <?php
22
+ $a = new Area('Header');
23
+ $a->display($c);
24
+ ?>
25
+
26
+
27
+ <!-- NAV EXAMPLE -->
28
+ <?php
29
+ $nav = BlockType::getByHandle('autonav');
30
+ $nav->controller->orderBy = 'display_asc';
31
+ $nav->controller->displayPages = 'top';
32
+ $nav->controller->displaySubPages = 'all';
33
+ $nav->controller->displaySubPageLevels = 'custom';
34
+ $nav->controller->displaySubPageLevelsNum = 1;
35
+ $nav->render('templates/header_menu');
36
+ ?>
@@ -0,0 +1,14 @@
1
+ <?
2
+ function editmode() {
3
+ global $c;
4
+ if ($c->isEditMode()) {
5
+ echo "editMode";
6
+ }
7
+ }
8
+
9
+ function image_tag($t, $img) {
10
+ $imgPath = ($t->getThemePath()) . "/images/";
11
+ echo "<img src='" . $imgPath . $img . "' />";
12
+ }
13
+
14
+ ?>
@@ -0,0 +1,7 @@
1
+ $(document).ready(function(){
2
+
3
+
4
+
5
+
6
+
7
+ });
@@ -0,0 +1,8 @@
1
+ <?php
2
+ defined('C5_EXECUTE') or die("Access Denied.");
3
+ $this->inc('elements/header.php');
4
+ ?>
5
+
6
+ <?php print $innerContent; ?>
7
+
8
+ <?php $this->inc('elements/footer.php'); ?>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pave
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jamon Holmgren
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-11 00:00:00.000000000 Z
12
+ date: 2013-12-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -103,10 +103,20 @@ files:
103
103
  - lib/pave/database.rb
104
104
  - lib/pave/deploy.rb
105
105
  - lib/pave/shell.rb
106
+ - lib/pave/theme.rb
106
107
  - lib/pave/version.rb
107
108
  - lib/pave/virtual_host.rb
108
109
  - pave.gemspec
109
110
  - resources/deploy.sh
111
+ - templates/themes/blank/css/styles.scss
112
+ - templates/themes/blank/default.php
113
+ - templates/themes/blank/description.txt
114
+ - templates/themes/blank/elements/footer.php
115
+ - templates/themes/blank/elements/header.php
116
+ - templates/themes/blank/includes/view_helpers.php
117
+ - templates/themes/blank/js/scripts.js
118
+ - templates/themes/blank/thumbnail.png
119
+ - templates/themes/blank/view.php
110
120
  - test/pave_test.rb
111
121
  homepage: https://github.com/jamonholmgren/pave
112
122
  licenses: