-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRakefile
53 lines (39 loc) · 907 Bytes
/
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
require 'yaml'
class String
def / other
File.join self, other.to_s
end
def extname
File.extname self
end
def dirname
File.dirname self
end
def basename *args
File.basename self, *args
end
end
def pathmapper spec, options = {}
if options[:any_extension]
proc { |filename| Dir["#{filename.pathmap(spec)}{,.*}"].first }
else
proc { |filename| filename.pathmap spec }
end
end
PACKAGE_INFO = YAML.load_file 'package.yaml'
ENV.each do |var, value|
case var
when /^(\w+)_key$/i
service = $1.downcase
puts "adding #{var} as an API key"
PACKAGE_INFO['api-keys'][service] = value
end
end
task :default => :package
desc 'compile scripts and stylesheets'
task :compile
desc 'remove all build products'
task :clean
# semi-automagically create directories
rule('/') { |t| mkdir_p t.name }
Dir['lib/tasks/*.rake'].each { |f| load f }