yob / roxml forked from Empact/roxml

ROXML is a module for binding Ruby classes to XML. It supports custom mapping and bidirectional marshalling between Ruby and XML using annotation-style class methods. ROXML supports the LibXML and REXML XML processors.

This URL has Read+Write access

roxml / Rakefile
100644 105 lines (87 sloc) 2.739 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Rake libraries used
require "rubygems"
require "rails_plugin_package_task"
require "rake/rdoctask"
require "rake/contrib/rubyforgepublisher"
require "rake/contrib/publisher"
require 'rake/gempackagetask'
require 'rake/testtask'
 
# load settings
spec = eval(IO.read("roxml.gemspec"))
 
# Provide the username used to upload website etc.
RubyForgeConfig = {
  :unix_name=>"roxml",
  :user_name=>"zakmandhro"
}
 
task :default => :test
 
Rake::RDocTask.new do |rd|
  rd.rdoc_dir = "doc"
  rd.rdoc_files.include('MIT-LICENSE', 'README.rdoc', "lib/**/*.rb")
  rd.options << '--main' << 'README.rdoc' << '--title' << 'ROXML Documentation'
end
 
Rake::RailsPluginPackageTask.new(spec.name, spec.version) do |p|
  p.package_files = FileList[
    "lib/**/*.rb", "*.txt", "README.rdoc", "Rakefile",
    "rake/**/*", "test/**/*.rb", "test/**/*.xml"]
  p.plugin_files = FileList["rails_plugin/**/*"]
  p.extra_links = {"Project page" => spec.homepage,
                   "Author: Zak Mandhro" => 'http://rubyforge.org/users/zakmandhro/'}
  p.verbose = true
end
task :rails_plugin=>:clobber
 
desc "Publish Ruby on Rails plug-in on RubyForge"
task :release_plugin=>:rails_plugin do |task|
  pub = Rake::SshDirPublisher.new("#{RubyForgeConfig[:user_name]}@rubyforge.org",
"/var/www/gforge-projects/#{RubyForgeConfig[:unix_name]}",
"pkg/rails_plugin")
  pub.upload()
end
 
desc "Publish and plugin site on RubyForge"
task :publish do |task|
  pub = Rake::RubyForgePublisher.new(RubyForgeConfig[:unix_name], RubyForgeConfig[:user_name])
  pub.upload()
end
 
desc "Install the gem"
task :install => [:package] do
  sh %{sudo gem install pkg/#{spec.name}-#{spec.version}}
end
 
Rake::TestTask.new(:bugs) do |t|
  t.libs << 'test'
  t.test_files = FileList['test/bugs/*_bugs.rb']
  t.verbose = true
end
 
task :test => :'test:rexml'
 
namespace :test do
  desc "Test ROXML under the LibXML parser"
  task :libxml do
    module ROXML
      XML_PARSER = 'libxml'
    end
    require 'lib/roxml'
    require 'rake/runtest'
    Rake.run_tests 'test/unit/*_test.rb'
  end
 
  desc "Test ROXML under the REXML parser"
  task :rexml do
    module ROXML
      XML_PARSER = 'rexml'
    end
    require 'lib/roxml'
    require 'rake/runtest'
    Rake.run_tests 'test/unit/*_test.rb'
  end
end
 
desc "Create the ZIP package"
Rake::PackageTask.new(spec.name, spec.version) do |p|
  p.need_zip = true
  p.package_files = FileList[
    "lib/**/*.rb", "*.txt", "README.rdoc", "Rakefile",
    "rake/**/*","test/**/*.rb", "test/**/*.xml", "html/**/*"]
end
 
desc "Create the plugin package"
 
task :package=>:rdoc
task :rdoc=>:test
 
desc "Create a RubyGem project"
Rake::GemPackageTask.new(spec).define
 
desc "Clobber generated files"
task :clobber=>[:clobber_package, :clobber_rdoc]