Permalink
Browse files

init commit

  • Loading branch information...
siuying committed Mar 23, 2012
0 parents commit 122a9651e0669936a3f8ee80d0b2fe0103eca797
@@ -0,0 +1,3 @@
+.DS_Store
+.sass-cache
+public/assets/application-*.*
13 Gemfile
@@ -0,0 +1,13 @@
+source :rubygems
+
+gem 'therubyracer'
+
+gem 'coffee-script'
+gem 'uglifier'
+gem 'sass'
+gem 'sprockets'
+
+gem 'guard-rake'
+gem 'guard-sprockets2'
+
+gem 'rb-fsevent'
@@ -0,0 +1,51 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ coffee-script (2.2.0)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.2.0)
+ execjs (1.3.0)
+ multi_json (~> 1.0)
+ ffi (1.0.11)
+ guard (1.0.1)
+ ffi (>= 0.5.0)
+ thor (~> 0.14.6)
+ guard-rake (0.0.5)
+ guard
+ rake
+ guard-sprockets2 (0.0.6)
+ guard
+ sprockets (~> 2.0)
+ hike (1.2.1)
+ libv8 (3.3.10.4)
+ multi_json (1.1.0)
+ rack (1.4.1)
+ rake (0.9.2.2)
+ rb-fsevent (0.9.0)
+ sass (3.1.15)
+ sprockets (2.3.1)
+ hike (~> 1.2)
+ multi_json (~> 1.0)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ therubyracer (0.9.10)
+ libv8 (~> 3.3.10)
+ thor (0.14.6)
+ tilt (1.3.3)
+ uglifier (1.2.3)
+ execjs (>= 0.3.0)
+ multi_json (>= 1.0.2)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ coffee-script
+ guard-rake
+ guard-sprockets2
+ rb-fsevent
+ sass
+ sprockets
+ therubyracer
+ uglifier
@@ -0,0 +1,11 @@
+require 'rubygems'
+require 'bundler/setup'
+require './sprockets_helper'
+
+guard 'sprockets2' , :sprockets => SprocketsHelper.environment, :precompile => [/\w+\.(?!js|css|scss|coffee).+/, /application.(css|js)$/ ] do
+ watch(%r{^app/(images|javascripts|stylesheets)/.+$})
+end
+
+guard 'rake', :task => 'copy_assets' do
+ watch(%r{^public/assets/application-.+$})
+end
@@ -0,0 +1,20 @@
+require 'rubygems'
+require 'bundler/setup'
+require 'fileutils'
+
+def assets_files
+ Dir["public/assets/application-*"].select{|f| f =~ /(js|css)$/}
+end
+
+def clean_name(original)
+ matches = original.match(/(.+)-.+\.(css|js)/)
+ "#{matches[1]}.#{matches[2]}"
+end
+
+task :copy_assets do
+ assets_files.each do |filename|
+ clean_filename = clean_name(filename)
+ FileUtils.cp filename, clean_filename
+ end
+end
+
No changes.
No changes.
@@ -0,0 +1,2 @@
+//= require_self
+//= require_tree .
No changes.
@@ -0,0 +1,4 @@
+/*
+ *= require_self
+ *= require_tree .
+*/
@@ -0,0 +1,5 @@
+/*
+
+
+*/
+
@@ -0,0 +1,5 @@
+(function() {
+
+
+
+}).call(this);
@@ -0,0 +1,26 @@
+require 'sprockets'
+require 'coffee_script'
+require 'sass'
+
+module SprocketsHelper
+ def self.environment
+ environment = Sprockets::Environment.new(File.dirname(__FILE__))
+
+ css_dir = ["app/stylesheets"]
+ css_dir.each do |path|
+ environment.append_path path
+ end
+
+ js_dir = ["app/javascripts"]
+ js_dir.each do |path|
+ environment.append_path path
+ end
+
+ images_dir = ["app/images"]
+ images_dir.each do |path|
+ environment.append_path path
+ end
+
+ environment
+ end
+end

0 comments on commit 122a965

Please sign in to comment.