Rakefile in twitter-bootstrap-ruby-2.1.1.0 vs Rakefile in twitter-bootstrap-ruby-2.3.1.0
- old
+ new
@@ -1,40 +1,45 @@
#!/usr/bin/env rake
-require 'bundler'
-require 'less'
+
+begin
+ require "bundler/gem_tasks"
+rescue Exception
+ sh 'gem install bundler --version "~> 1.3.1" --no-rdoc --no-ri'
+end
+
Bundler::GemHelper.install_tasks
-desc "Prepare bundle environment"
-task :pre do
- sh 'bundle install'
+desc 'Update dependencies'
+task :up do
+ sh 'bundle update'
end
desc 'Make css'
task :css do
- parser = Less::Parser.new :paths => ['less']
- tree = parser.parse(IO.read('less/bootstrap.less'))
- ::File.open("css/bootstrap.css",'w') do |f|
+ require 'less'
+ parser = Less::Parser.new :paths => ['less']
+ tree = parser.parse(IO.read('less/bootstrap.less'))
+ ::File.open("css/bootstrap.css",'w') do |f|
f.puts tree.to_css
- end
- ::File.open("css/bootstrap.min.css",'w') do |f|
+ end
+ ::File.open("css/bootstrap.min.css",'w') do |f|
f.puts tree.to_css(:compress => true)
- end
+ end
end
desc "Build the gem"
task :build do
- sh 'gem build *.gemspec'
+ sh 'gem build twitter-bootstrap-ruby.gemspec'
end
desc "Bundle the gem"
task :bundle do
- sh 'gem install *.gem'
- sh 'rm *.gem'
+ require File.expand_path( '../lib/twitter/bootstrap/version', __FILE__ )
+ sh "gem install twitter-bootstrap-ruby-#{Twitter::Bootstrap::VERSION}.gem"
end
task(:default).clear
-task :css => :pre
-task :build => [:pre, :css]
+task :build => :css
task :bundle => :build
task :release => :build
task :default => :bundle