Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 46 lines (39 sloc) 1.082 kb
4b1e593 @mojombo Bring build process up to date using RakeGem.
authored
1 require 'date'
2
3 def version
3596973 simplify gemspec and rake tasks
Lee Jarvis authored
4 contents = File.read File.expand_path('../lib/chronic.rb', __FILE__)
5 contents[/VERSION = "([^"]+)"/, 1]
4b1e593 @mojombo Bring build process up to date using RakeGem.
authored
6 end
7
2e229ed avoid rake/testtask -- fixes testing on 1.9.3
Lee Jarvis authored
8 task :test do
9 $:.unshift './test'
10 Dir.glob('test/test_*.rb').each { |t| require File.basename(t) }
4b1e593 @mojombo Bring build process up to date using RakeGem.
authored
11 end
12
13 desc "Generate RCov test coverage and open in your browser"
14 task :coverage do
15 require 'rcov'
16 sh "rm -fr coverage"
17 sh "rcov test/test_*.rb"
18 sh "open coverage/index.html"
19 end
20
21 desc "Open an irb session preloaded with this library"
22 task :console do
eaaf6f1 no need to load rubygems for rake console task
Lee Jarvis authored
23 sh "irb -Ilib -rchronic"
4b1e593 @mojombo Bring build process up to date using RakeGem.
authored
24 end
25
3596973 simplify gemspec and rake tasks
Lee Jarvis authored
26 desc "Release Chronic version #{version}"
4b1e593 @mojombo Bring build process up to date using RakeGem.
authored
27 task :release => :build do
28 unless `git branch` =~ /^\* master$/
29 puts "You must be on the master branch to release!"
30 exit!
31 end
32 sh "git commit --allow-empty -a -m 'Release #{version}'"
33 sh "git tag v#{version}"
34 sh "git push origin master"
35 sh "git push origin v#{version}"
3596973 simplify gemspec and rake tasks
Lee Jarvis authored
36 sh "gem push pkg/chronic-#{version}.gem"
4b1e593 @mojombo Bring build process up to date using RakeGem.
authored
37 end
38
3596973 simplify gemspec and rake tasks
Lee Jarvis authored
39 desc "Build a gem from the gemspec"
54e8609 remove dep on gemspec task
Lee Jarvis authored
40 task :build do
4b1e593 @mojombo Bring build process up to date using RakeGem.
authored
41 sh "mkdir -p pkg"
c5fc530 fix build task variables
Lee Jarvis authored
42 sh "gem build chronic.gemspec"
43 sh "mv chronic-#{version}.gem pkg"
4b1e593 @mojombo Bring build process up to date using RakeGem.
authored
44 end
45
3596973 simplify gemspec and rake tasks
Lee Jarvis authored
46 task :default => :test
Something went wrong with that request. Please try again.