This repository was archived by the owner on Apr 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrakefile
More file actions
64 lines (51 loc) · 1.56 KB
/
rakefile
File metadata and controls
64 lines (51 loc) · 1.56 KB
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
#
# build script for $project
#
require 'rake/clean'
RECOMMENDED_RUBY_VERSION = "1.9.2"
TASKS_DIR = "tasks"
class RubyVersion < Array
def initialize s
super(s.split('.').map { |e| e.to_i })
end
def < x
(self <=> x) < 0
end
def > x
(self <=> x) > 0
end
def == x
(self <=> x) == 0
end
end
def check_version
this_version = RubyVersion.new(RUBY_VERSION)
recommended_version = RubyVersion.new(RECOMMENDED_RUBY_VERSION)
if this_version == recommended_version
notice("Ruby looks good, using version #{RUBY_VERSION}")
elsif this_version < recommended_version
warn(["Ruby is below the recommended version",
"At least Ruby #{RECOMMENDED_RUBY_VERSION} is recommended, but this is #{RUBY_VERSION}.",
"Significant problems may arise!"])
else
notice(["Ruby is newer than the recommended version. That should be okay.",
"Ruby #{RECOMMENDED_RUBY_VERSION} is recommended, and you have #{RUBY_VERSION}. You cool kid you."])
end
end
def load_tasks
# Load the project-templated constants
load("#{TASKS_DIR}/project.rb")
# And the logic for looking up constants
load("#{TASKS_DIR}/projectvar.rake")
# And then the template-dependent path constants
load("#{TASKS_DIR}/paths.rb")
#Load tasks defined in TASK_DIR
Dir.glob("#{TASKS_DIR}/*.rake").reject {
|t| ["helper.rake", "projectvar.rake"].include?(File.basename(t))
}.each {|t| load(t)}
end
# Load the helper methods first
load("#{TASKS_DIR}/helper.rake")
check_version
load_tasks
CLEAN.include(FileList['*.pyc'], ProjectPaths::EGG_BUILD_FILES)