forked from rmm5t/jquery-flexselect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
41 lines (34 loc) · 1.02 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
require "bundler/setup"
require "rake/packagetask"
require "highline/import"
verbose(true)
task :package => :version
package = Rake::PackageTask.new("jquery.flexselect", :noversion) do |p|
p.need_zip = true
p.package_files.include("*.js", "*.css", "*.html", "README.*")
end
task :version do
package.version = ask("What version?")
end
file package.package_dir_path do
input = "jquery.flexselect.js"
output = "#{package.package_dir_path}/#{input}"
rm_f output
sh("sed -e 's/%RELEASE_VERSION%/#{package.version}/g' -e 's/%RELEASE_DATE%/#{Date.today}/g' #{input} > #{output}")
end
desc "Publish a release to the wild"
task :publish do
sh("git checkout gh-pages")
sh("git merge master")
sh("git push")
sh("git checkout master")
sh("git push")
sh("git push --tags")
end
desc "Construct a new release package, and optionally tag the repository"
task :release => :repackage do
if agree("Create a tag?", true)
sh("git tag 'v#{package.version}'")
puts("\n *** Don't forget to `rake publish` ***")
end
end