-
Notifications
You must be signed in to change notification settings - Fork 3
/
rakefile.rb
51 lines (37 loc) · 1.1 KB
/
rakefile.rb
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
$: << 'lib'
autoload :Bundler, 'bundler'
task :default => :test
desc 'Create bundled and minified source files.'
task :bundle do
Bundler.bundle!
end
task :test do
exec 'nodemon run-tests.js'
end
task :run do
sh "nodemon example/server.js"
end
desc 'Generate the documentation'
task :docs do
exec "dox --title 'Davis' src/davis.*.js > docs/index.html"
end
task :major do
version = File.read('VERSION').strip.split('.')
major = Integer(version[1]) + 1
File.open('VERSION', 'w') {|f| f.write("#{major}.0.0") }
end
task :minor do
version = File.read('VERSION').strip.split('.')
minor = Integer(version[1]) + 1
File.open('VERSION', 'w') {|f| f.write("#{version[0]}.#{minor}.0") }
end
task :patch do
version = File.read('VERSION').strip.split('.')
patch = Integer(version[2]) + 1
File.open('VERSION', 'w') {|f| f.write("#{version[0]}.#{version[1]}.#{patch}") }
end
task :publish do
version = File.read('VERSION').strip
file = File.read('package.json')
File.open('package.json', "w"){|f| f.write(file.gsub(/\"version\": \"\d+?\.\d+?\.\d+?\"/, "\"version\": \"#{version}\"")) }
end