Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: d34b5ca5f3
Fetching contributors…

Cannot retrieve contributors at this time

45 lines (39 sloc) 1.16 kb
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require "bundler/gem_tasks"
desc 'Default: run unit tests.'
task :default => :test
desc 'Test the ubiquo_i18n plugin.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.libs << 'test'
t.pattern = 'test/**/*_test.rb'
t.verbose = true
end
desc 'Generate documentation for the ubiquo_i18n plugin.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'UbiquoI18n'
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.rdoc_files.include('README')
rdoc.rdoc_files.include('lib/**/*.rb')
end
def update_version(function, name)
major, minor, tiny = File.read("VERSION").strip.split(".").map { |i| i.to_i }
eval "#{name} #{function}= 1"
File.open("VERSION", "w") { |f| f.puts [major, minor, tiny].join(".") }
puts `cat VERSION`
end
{ :bump => "+", :debump => "-"}.each do |key, value|
namespace key do
[ :major, :minor, :tiny].each do |position|
eval <<-CODE
desc "#{key.to_s.capitalize} #{position} number by 1"
task :#{position} do
update_version("#{value}", "#{position}")
end
CODE
end
end
end
Jump to Line
Something went wrong with that request. Please try again.