8000 Updated rake tasks to automatically compile CoffeeScript · rmm5t/jquery-timeago@4678278 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4678278

Browse files
committed
Updated rake tasks to automatically compile CoffeeScript
* Introduced bundler (for fssm)
1 parent f6e5693 commit 4678278

File tree

5 files changed

+48
-4
lines changed

5 files changed

+48
-4
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.bundle
2+
vendor/ruby

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source "http://rubygems.org"
2+
3+
gem "fssm", "0.2.0"

Gemfile.lock

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
GEM
2+
remote: http://rubygems.org/
3+
specs:
4+
fssm (0.2.0)
5+
6+
PLATFORMS
7+
ruby
8+
9+
DEPENDENCIES
10+
fssm (= 0.2.0)

Rakefile

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
verbose(true)
1+
require "bundler/setup"
22

3-
task :default => :test
3+
task :default => :watch
44

5-
desc 'Publish "marketing" docs'
5+
desc "Publish "marketing" docs"
66
task :publish do
77
sh("git rebase master gh-pages")
88
sh("git checkout master")
@@ -11,7 +11,36 @@ task :publish do
1111
sh("git push --tags")
1212
end
1313

14-
desc 'Open your default browser with the test page'
14+
desc "Build everything"
15+
task :build do
16+
rebuild_coffee
17+
end
18+
19+
desc "Watch for changes and test the site"
20+
task :watch => :build do
21+
sh("open test/index.html")
22+
monitor
23+
end
24+
25+
desc "Open your default browser with the test page"
1526
task :test do
1627
sh("open test/index.html")
1728
end
29+
30+
def rebuild_coffee(base = nil, relative = "**/*.coffee")
31+
sh("coffee -c #{relative}")
32+
end
33+
34+
def monitor
35+
require "fssm"
36+
puts ">>> Monitoring for changes. Press Ctrl-C to Stop."
37+
FSSM.monitor do
38+
path "." do
39+
glob "**/*.coffee"
40+
update &method(:rebuild_coffee)
41+
delete &method(:rebuild_coffee)
42+
create &method(:rebuild_coffee)
43+
end
44+
end
45+
end
46+

vendor/cache/fssm-0.2.0.gem

24 KB
Binary file not shown.

0 commit comments

Comments
 (0)
0