-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathRakefile
38 lines (30 loc) · 1.21 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
#!/usr/bin/env rake
require 'json'
require File.expand_path('../lib/bootstrap-typeahead-rails/version', __FILE__)
desc "Update assets"
task :update do
if Dir.exist?('bootstrap-typeahead-src')
system("cd bootstrap-typeahead-src && git pull && cd ..")
else
system("git clone [email protected]:twitter/typeahead.js.git bootstrap-typeahead-src")
end
system("cp bootstrap-typeahead-src/dist/typeahead.bundle.js vendor/assets/javascripts/bootstrap-typeahead-rails/bootstrap-typeahead.js")
system("git status")
puts "\n"
puts "bootstrap-typeahead version: #{JSON.parse(File.read('./bootstrap-typeahead-src/bower.json'))['version']}"
puts "bootstrap-typeahead-rails version: #{BootstrapTypeaheadRails::Rails::VERSION}"
end
desc "Build"
task "build" do
system("gem build bootstrap-typeahead-rails.gemspec")
end
desc "Build and publish the gem"
task :publish => :build do
tags = `git tag`.split
current_version = BootstrapTypeaheadRails::Rails::VERSION
system("git tag -a #{current_version} -m 'Release #{current_version}'") unless tags.include?(current_version)
system("gem push bootstrap-typeahead-rails-#{current_version}.gem")
system("git push --follow-tags")
end
task :release => :publish do
end