public
Description: A simple and easy to use generator system for Ruby
Homepage: http://www.mackframework.com
Clone URL: git://github.com/markbates/genosaurus.git
Click here to lend your support to: genosaurus and make a donation at www.pledgie.com !
markbates (author)
Wed May 14 20:58:36 -0700 2008
commit  75fa6bd1f3e4fbae3973864c7b613bc05c2bd774
tree    3e7ce71aa57bbe7f56a850de12540703c96fb094
parent  0f9a54ed2df1cd55885435feaec83cc5827a3b9b
genosaurus / Rakefile
100644 89 lines (77 sloc) 2.322 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
require 'rake'
require 'rake/gempackagetask'
require 'rake/clean'
require 'rake/testtask'
require 'rake/rdoctask'
require 'find'
require 'rubyforge'
require 'rubygems'
require 'rubygems/gem_runner'
 
GEM_VERSION = "1.1.6"
GEM_NAME = "genosaurus"
GEM_RUBYFORGE_PROJECT = "magrathea"
 
gem_spec = Gem::Specification.new do |s|
  s.name = GEM_NAME
  s.version = GEM_VERSION
  s.summary = "#{GEM_NAME}"
  s.description = "Genosaurus is meant to be a very, very easy to use generation system for Ruby."
  s.author = "markbates"
  s.email = "mark@markbates.com"
  s.homepage = "http://www.mackframework.com"
 
  s.test_files = FileList['test/**/*']
 
  s.files = FileList['lib/**/*.rb', 'README', 'doc/**/*.*', 'bin/**/*.*']
  s.require_paths << 'lib'
 
  s.add_dependency("mack_ruby_core_extensions")
  s.add_dependency("erubis")
  s.extra_rdoc_files = ["README"]
  s.has_rdoc = true
  s.rubyforge_project = GEM_RUBYFORGE_PROJECT
end
 
# rake package
Rake::GemPackageTask.new(gem_spec) do |pkg|
  pkg.need_zip = false
  pkg.need_tar = false
  rm_f FileList['pkg/**/*.*']
end
 
# rake
desc "Run test code"
Rake::TestTask.new(:default) do |t|
  t.libs << "test"
  t.pattern = '**/*_test.rb'
  t.verbose = true
end
 
desc "Install the gem"
task :install => :package do |t|
  puts `sudo gem install pkg/#{GEM_NAME}-#{GEM_VERSION}.gem`
end
 
desc "Release the gem"
task :release => :install do |t|
  begin
    rf = RubyForge.new
    rf.login
    begin
      rf.add_release(GEM_RUBYFORGE_PROJECT, GEM_NAME, GEM_VERSION, File.join("pkg", "#{GEM_NAME}-#{GEM_VERSION}.gem"))
    rescue Exception => e
      if e.message.match("Invalid package_id") || e.message.match("no <package_id> configured for")
        puts "You need to create the package!"
        rf.create_package(GEM_RUBYFORGE_PROJECT, GEM_NAME)
        rf.add_release(GEM_RUBYFORGE_PROJECT, GEM_NAME, GEM_VERSION, File.join("pkg", "#{GEM_NAME}-#{GEM_VERSION}.gem"))
      else
        raise e
      end
    end
  rescue Exception => e
    puts e
  end
end
 
 
Rake::RDocTask.new do |rd|
  rd.main = "README"
  files = Dir.glob("**/*.rb")
  files = files.collect {|f| f unless f.match("test/") || f.match("doc/") }.compact
  files << "README"
  rd.rdoc_files = files
  rd.rdoc_dir = "doc"
  rd.options << "--line-numbers"
  rd.options << "--inline-source"
  rd.title = "genosaurus"
end