1 require 'rake/gempackagetask.rb'
\r
4 Gem::Specification.new do |s|
\r
6 # s.name will be set later
\r
7 s.rubyforge_project = 'coderay'
\r
10 s.platform = Gem::Platform::RUBY
\r
11 s.required_ruby_version = '>= 1.8.2'
\r
13 s.date = Time.now.strftime '%Y-%m-%d'
\r
15 s.rdoc_options = '-SNw2', '-mlib/README', '-t CodeRay Documentation'
\r
16 s.extra_rdoc_files = EXTRA_RDOC_FILES
\r
20 Fast syntax highlighting for selected languages.
\r
22 s.description = <<-EOF
\r
23 Fast and easy syntax highlighting for selected languages, written in Ruby.
\r
24 Comes with RedCloth integration and LOC counter.
\r
28 s.require_path = 'lib'
\r
29 s.executables = [ 'coderay', 'coderay_stylesheet' ]
\r
31 s.files = nil # defined later
\r
35 s.email = 'murphy@rubychan.de'
\r
36 s.homepage = 'http://coderay.rubychan.de'
\r
40 def svn_head_revision
\r
41 sh 'svn up --ignore-externals'
\r
42 `svn info`[/Revision: (\d+)/,1]
\r
47 gemtask = Rake::GemPackageTask.new(gemspec) do |pkg|
\r
52 desc 'Create the Gem again'
\r
53 task :make => [:make_gemspec, :clean, :gem]
\r
55 desc 'Delete previously created Gems'
\r
57 Dir['pkg/*.gem'].each { |g| rm g }
\r
60 desc 'Find out the current CodeRay version'
\r
61 task :get_version do
\r
62 $gem_name = 'coderay'
\r
66 $version = CodeRay::VERSION
\r
68 puts 'Current Version: %s' % $version
\r
70 $version << '.' << svn_head_revision
\r
71 $gem_name << '-beta'
\r
74 # $version << '.' << svn_head_revision
\r
75 $version << ".#{ENV['PRE']}"
\r
79 task :make_gemspec => :get_version do
\r
80 s = gemtask.gem_spec
\r
81 s.files = Dir['./lib/**/*.rb'] +
\r
82 Dir['./demo/*.rb'] +
\r
84 Dir['./test/functional/*'] +
\r
85 %w(./lib/README ./LICENSE)
\r
86 s.test_file = './test/functional/suite.rb'
\r
87 gemtask.version = s.version = $version
\r
88 gemtask.name = s.name = $gem_name
\r
92 ENV['PRE'] ||= 'pre'
\r
95 desc 'Make a prerelease Gem.'
\r
96 task :prerelease => [:set_pre, :make]
\r
100 task :gem => 'gem:make'
\r