Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 90 lines (76 sloc) 2.438 kb
daeb0e3 setting up for gem release
slagyr authored
1 $:.unshift('lib')
2 require 'rubygems'
3 require 'rake/gempackagetask'
4 require 'rake/clean'
5 require 'rake/rdoctask'
6 require 'spec/rake/spectask'
72a1291 ready for new release
slagyr authored
7 require 'statemachine'
7eff07a @ericmeyer pulled gemspec into it's own file. added rvmrc file.
ericmeyer authored
8 require "bundler/gem_tasks"
daeb0e3 setting up for gem release
slagyr authored
9
10 PKG_NAME = "statemachine"
991ea14 start state can be set early. renamed *state* to be one word
slagyr authored
11 PKG_VERSION = Statemachine::VERSION::STRING
12 PKG_TAG = Statemachine::VERSION::TAG
daeb0e3 setting up for gem release
slagyr authored
13 PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
14 PKG_FILES = FileList[
15 '[A-Z]*',
16 'lib/**/*.rb',
17 'spec/**/*.rb'
18 ]
19
20 task :default => :spec
21
22 desc "Run all specs"
23 Spec::Rake::SpecTask.new do |t|
24 t.spec_files = FileList['spec/**/*_spec.rb']
25 end
26
20f6858 @slagyr moved web pages to git
authored
27 WEB_ROOT = File.expand_path('~/Projects/slagyr.github.com/statemachine/')
28
4a211dd adding documentation
slagyr authored
29 desc 'Generate RDoc'
30 rd = Rake::RDocTask.new do |rdoc|
20f6858 @slagyr moved web pages to git
authored
31 rdoc.rdoc_dir = "#{WEB_ROOT}/rdoc"
32 rdoc.options << '--title' << 'Statemachine' << '--line-numbers' << '--inline-source' << '--main' << 'README.rdoc'
33 rdoc.rdoc_files.include('README.rdoc', 'CHANGES', 'lib/**/*.rb')
4a211dd adding documentation
slagyr authored
34 end
35 task :rdoc
daeb0e3 setting up for gem release
slagyr authored
36
37 def egrep(pattern)
38 Dir['**/*.rb'].each do |fn|
39 count = 0
40 open(fn) do |f|
41 while line = f.gets
42 count += 1
43 if line =~ pattern
44 puts "#{fn}:#{count}:#{line}"
45 end
46 end
47 end
48 end
49 end
50
51 desc "Look for TODO and FIXME tags in the code"
52 task :todo do
53 egrep /(FIXME|TODO|TBD)/
54 end
55
56 task :release => [:clobber, :verify_committed, :verify_user, :verify_password, :spec, :publish_packages, :tag, :publish_website, :publish_news]
57
58 desc "Verifies that there is no uncommitted code"
59 task :verify_committed do
60 IO.popen('svn stat') do |io|
61 io.each_line do |line|
62 raise "\n!!! Do a svn commit first !!!\n\n" if line =~ /^\s*M\s*/
63 end
64 end
65 end
66
67 desc "Creates a tag in svn"
68 task :tag do
69 puts "Creating tag in SVN"
70 `svn cp svn+ssh://#{ENV['RUBYFORGE_USER']}@rubyforge.org/var/svn/statemachine/trunk svn+ssh://#{ENV['RUBYFORGE_USER']}@rubyforge.org/var/svn/statemachine/tags/#{PKG_VERSION} -m "Tag release #{PKG_TAG}"`
71 puts "Done!"
72 end
73
0ba2853 Updated the Rakefile and website
ericmeyer authored
74 desc 'Generate HTML documentation for website'
75 task :webgen do
20f6858 @slagyr moved web pages to git
authored
76 system "rm -rf doc/website/out"
77 system "rm -rf doc/website/webgen.cache"
78 system "cd doc/website; webgen -v render; cp -rf out/* #{WEB_ROOT}"
0ba2853 Updated the Rakefile and website
ericmeyer authored
79 end
daeb0e3 setting up for gem release
slagyr authored
80
0ba2853 Updated the Rakefile and website
ericmeyer authored
81 desc "Build the website, but do not publish it"
20f6858 @slagyr moved web pages to git
authored
82 task :website => [:webgen, :rdoc]
daeb0e3 setting up for gem release
slagyr authored
83
d0ec831 added CHANGES
slagyr authored
84 task :verify_user do
85 raise "RUBYFORGE_USER environment variable not set!" unless ENV['RUBYFORGE_USER']
86 end
87
88 task :verify_password do
89 raise "RUBYFORGE_PASSWORD environment variable not set!" unless ENV['RUBYFORGE_PASSWORD']
daeb0e3 setting up for gem release
slagyr authored
90 end
Something went wrong with that request. Please try again.