Permalink
Browse files

Initial commit

  • Loading branch information...
0 parents commit ea351fbc60cc8c357dc58134bd7d4d1bab279311 Adam Stacoviak committed Nov 30, 2009
Showing with 58 additions and 0 deletions.
  1. +31 −0 theme.thor
  2. +27 −0 wordpress.thor
@@ -0,0 +1,31 @@
+class Theme < Thor
+
+ # SSH user information
+ SSH_USER = "user@domain.com"
+
+ # Remote file location that rsync will deploy to
+ REMOTE_ROOT = "~/path/to/remote/root/"
+
+ desc "deploy", "Deploys the theme"
+ def deploy
+ puts "*** Deploying the site ***"
+ system "rsync -avz --delete . #{SSH_USER}:#{REMOTE_ROOT}"
+ end
+
+ desc "styles_clear", "Clears the themes styles"
+ def styles_clear
+ puts "*** Clearing styles ***"
+ system "rm -Rfv css/*"
+ end
+
+ desc "styles_generate --clear", "Generates the themes styles."
+ method_options :clear => :bolean
+ def styles_generate
+ if options.clear?
+ invoke :clear_styles
+ end
+ puts "*** Generating styles ***"
+ system "compass"
+ end
+
+end
@@ -0,0 +1,27 @@
+class Wordpress < Thor
+
+ desc "install", "Download and unpack WordPress from the interwebs"
+ method_options :directory => :string, :version => :string
+ def install
+ opts = {'directory' => '.', 'version' => 'latest'}
+ opts = opts.merge(options)
+
+ if yes?("Download and install WordPress version '#{opts['version']}' to #{opts['directory'] == '.' ? 'current folder' : opts['directory']}?")
+ opts['version'] = "wordpress-#{opts['version']}" unless opts['version'] == 'latest'
+ system "mkdir -p #{opts['directory']}" unless opts['directory'] == '.'
+ cmd = "curl http://wordpress.org/#{opts['version']}.tar.gz"
+ cmd += " | tar -zxv "
+ cmd += " -C #{opts['directory']} " unless opts['directory'] == '.'
+ cmd += " --strip 1"
+ system cmd
+
+ if yes?("Download and install thematic?")
+ cmd = "curl -O http://wordpress.org/extend/themes/download/thematic.0.9.5.1.zip && unzip thematic.0.9.5.1.zip -d #{opts['directory']}/wp-content/themes && rm thematic.0.9.5.1.zip"
+ system cmd
+ end
+ else
+ puts 'Installation aborted'
+ end
+
+ end
+end

0 comments on commit ea351fb

Please sign in to comment.