Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Prepare project with bundler

  • Loading branch information...
commit c97e1cad11a0ce11db19f32d784d49477aafe642 1 parent bcad5fc
Fabrice Luraine authored
View
3  .bundle/config
@@ -0,0 +1,3 @@
+---
+BUNDLE_DISABLE_SHARED_GEMS: "1"
+BUNDLE_PATH: vendor
View
2  .gitignore
@@ -1,5 +1,5 @@
.sass-cache/
-vendor/bundle/
+vendor/ruby/
# site/
#
View
3  Gemfile
@@ -0,0 +1,3 @@
+source "http://rubygems.org"
+gem 'staticmatic'
+gem 'compass'
View
27 Gemfile.lock
@@ -0,0 +1,27 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ cgi_multipart_eof_fix (2.5.0)
+ compass (0.10.5)
+ haml (>= 3.0.4)
+ daemons (1.1.0)
+ fastthread (1.0.7)
+ gem_plugin (0.2.3)
+ haml (3.0.18)
+ mongrel (1.1.5)
+ cgi_multipart_eof_fix (>= 2.4)
+ daemons (>= 1.0.3)
+ fastthread (>= 1.0.1)
+ gem_plugin (>= 0.2.3)
+ rack (1.2.1)
+ staticmatic (0.10.8)
+ haml (>= 2.0.0)
+ mongrel (>= 1.1.5)
+ rack (>= 1.0)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ compass
+ staticmatic
View
52 Rakefile
@@ -2,14 +2,14 @@ ssh_user = "user@domain.com" # for rsync deployment
remote_root = "~/path/to/remote/" # for rsync deployment
desc "Runs preview"
-task :preview do
- system "staticmatic preview ."
+task :preview => 'assets:copy' do
+ system "bundle exec staticmatic preview ."
end
desc "Builds the site"
-task :build => 'styles:clear' do
+task :build => 'assets:copy' do
puts "*** Building the site ***"
- system "staticmatic build ."
+ system "bundle exec staticmatic build ."
end
desc "Clears and generates new styles, builds and deploys"
@@ -18,8 +18,31 @@ task :deploy => :build do
system("rsync -avz --delete site/ #{ssh_user}:#{remote_root}")
end
+desc "Clears the site folder"
+task :clear do
+ puts "*** Clearing site folder ***"
+ system "rm -Rf site"
+ mk_build_dir 'site'
+end
+
+
+
+namespace :assets do
+ desc "Copy site assets (images, javascripts…)"
+ task :copy => :clear do
+ puts "*** Copy site assets ***"
+ directory 'site'
+ files = FileList[File.join('src','assets','*')]
+ files.each do |source|
+ target = source.sub('src/assets', 'site')
+ cp_r source, target
+ end
+ end
+end
+
+
+
namespace :styles do
-
desc "Clears the styles"
task :clear do
puts "*** Clearing styles ***"
@@ -29,7 +52,20 @@ namespace :styles do
desc "Generates new styles"
task :generate => :clear do
puts "*** Generating styles ***"
- system "compass"
+ system "bundle exec compass"
end
-
-end
+end
+
+
+
+
+# Utils
+# -----
+
+def mk_build_dir(path)
+ mkdir path
+ gitignore = File.join(path, '.gitignore')
+ File.open(gitignore, 'w') do |f|
+ f.puts "*\n!.gitignore"
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.