-
Notifications
You must be signed in to change notification settings - Fork 2
/
Rakefile
106 lines (87 loc) · 2.42 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
require "rubygems"
require "bundler/setup"
# Master class
module Rosy
PROJECT_ROOT = File.expand_path(File.dirname(__FILE__))
STATIC_DIR = File.join(PROJECT_ROOT, "project", "static")
RESOURCE_DIR = File.join("resources")
TASKS_DIR = File.join(PROJECT_ROOT, "resources", "tasks")
CONFIG_DIR = File.join(TASKS_DIR, "config")
# Module namespaces
module Watch; end
module Development; end
module Create; end
module Platform; end
end
# Require tasks
Dir.glob(File.join(Rosy::TASKS_DIR, "*.rb"), &method(:require))
namespace :watch do
desc "All-in-one Uglify/Closure/JSHint/Compass watcher"
task :all do
Rosy::Watch::All.new.run ENV["nohint"]
end
desc "Watch for CSS changes to generate SASS"
task :compass do
Rosy::Watch::Compass.new.run
end
desc "Watch for JavaScript changes to compress output"
task :uglify do
Rosy::Watch::Uglify.new.run
end
desc "Watch for JavaScript changes to compress output"
task :closure do
Rosy::Watch::Closure.new.run
end
desc "Watch for JavaScript changes to JSHint your files"
task :jshint do
Rosy::Watch::JSHint.new.run
end
desc "Watch for application changes to update the application cache"
task :appcache do
Rosy::Watch::AppCache.new.run
end
end
namespace :dev do
desc "Update the Red Boilerplate"
task :update do
Rosy::Development::Update.new.run
end
desc "Optimize Images"
task :smush do
Rosy::Development::Smush.new.run
end
desc "Build CSS w/ Compass"
task :compass do
Rosy::Development::Compass.new.run
end
desc "JSHint your JavaScript"
task :jshint do
Rosy::Development::JSHint.new.lint
end
desc "Closure Compile your JavaScript"
task :closure do
Rosy::Development::Closure.new.run
end
desc "Uglify your JavaScript"
task :uglify do
Rosy::Development::Uglify.new.run
end
desc "Final check to see if you've forgotten anything?"
task :sanity do
Rosy::Development::Sanity.new.run
end
desc "Build CSS w/ Compass, Run JSHint, Closure Compile your JavaScript"
task :build => [:compass, :jshint, :sanity, :closure] do
puts "All done building static files!"
end
desc "Build CSS w/ Compass, Run JSHint, Uglify your JavaScript"
task :buildugly => [:compass, :jshint, :sanity, :uglify] do
puts "All done building static files!"
end
end
namespace :create do
desc "Create a new Rosy page"
task :page do
Rosy::Create::Page.new.create
end
end