Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added a rake tasks

  • Loading branch information...
commit 540cdafb98defefe5b5ccd514badccde1f3c4c92 1 parent 0c0e1a5
@adamstac authored
Showing with 83 additions and 4 deletions.
  1. +2 −2 .bundle/config
  2. +81 −2 Rakefile
View
4 .bundle/config
@@ -1,2 +1,2 @@
----
-BUNDLE_DISABLE_SHARED_GEMS: "1"
+--- {}
+
View
83 Rakefile
@@ -1,9 +1,10 @@
require 'rubygems'
-require 'bundler/setup'
+require 'bundler'
+require 'rake'
+Bundler.setup
Bundler.require(:default, :test)
-
require 'nesta/config'
require 'nesta/models'
@@ -82,3 +83,81 @@ namespace :tumblr do
end
end
+## My Rake tasks
+desc 'Start the application'
+task :start do
+ system "bundle exec shotgun config.ru"
+end
+
+desc 'Generate a new project at dir=foo'
+task :generate do
+ # Generate the new 'dir' if it's not already created
+ system "mkdir #{(ENV['dir'])}" unless File.exists?(ENV['dir'])
+
+ # Archive the current HEAD to 'dir'
+ system "git archive HEAD | (cd #{ENV['dir']} && tar -xvf -)"
+
+ puts "\n *** A new project has been generated at: #{(ENV['dir'])} ***"
+end
+
+namespace :styles do
+
+ desc "Run compass stats"
+ task :stats => ["stats:default"]
+
+ namespace :stats do
+
+ task :default do
+ puts "*** Running compass stats ***"
+ system "compass stats"
+ end
+
+ desc "Create a log of compass stats"
+ task :log do
+ t = DateTime.now
+ filename = "compass-stats-#{t.strftime("%Y%m%d")}-#{t.strftime("%H%M%S")}.log"
+ log_dir = "log"
+ puts "*** Logging stats ***"
+ system "compass stats > #{log_dir}/#{filename}"
+ puts "Created #{log_dir}/#{filename}"
+ end
+
+ end
+
+ desc "Clear the styles"
+ task :clear => ["compile:clear"]
+
+ desc "Watch the styles and compile new changes"
+ task :watch do
+ system "compass watch"
+ end
+
+ desc "List the styles"
+ task :list do
+ system "ls -lh public/stylesheets"
+ end
+
+ desc "Compile new styles"
+ task :compile => ["compile:default"]
+
+ namespace :compile do
+
+ task :clear do
+ puts "*** Clearing styles ***"
+ system "rm -Rfv public/stylesheets/*"
+ end
+
+ task :default => :clear do
+ puts "*** Compiling styles ***"
+ system "compass compile"
+ end
+
+ desc "Compile new styles for production"
+ task :production => :clear do
+ puts "*** Compiling styles ***"
+ system "compass compile --output-style compressed --force"
+ end
+
+ end
+
+end
Please sign in to comment.
Something went wrong with that request. Please try again.