forked from delano/sysinfo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
115 lines (88 loc) · 3.03 KB
/
Rakefile
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
106
107
108
109
110
111
112
113
114
115
require 'rubygems'
require 'rake/clean'
require 'rake/gempackagetask'
require 'fileutils'
include FileUtils
begin
require 'hanna/rdoctask'
rescue LoadError
require 'rake/rdoctask'
end
task :default => :package
# CONFIG =============================================================
# Change the following according to your needs
README = "README.rdoc"
CHANGES = "CHANGES.txt"
LICENSE = "LICENSE.txt"
# Files and directories to be deleted when you run "rake clean"
CLEAN.include [ 'pkg', '*.gem', '.config']
# Virginia assumes your project and gemspec have the same name
name = (Dir.glob('*.gemspec') || ['virginia']).first.split('.').first
load "#{name}.gemspec"
version = @spec.version
# That's it! The following defaults should allow you to get started
# on other things.
# TESTS/SPECS =========================================================
# INSTALL =============================================================
Rake::GemPackageTask.new(@spec) do |p|
p.need_tar = true if RUBY_PLATFORM !~ /mswin/
end
task :release => [ :rdoc, :package ]
task :install => [ :rdoc, :package ] do
sh %{sudo gem install pkg/#{name}-#{version}.gem}
end
task :uninstall => [ :clean ] do
sh %{sudo gem uninstall #{name}}
end
# RUBYFORGE RELEASE / PUBLISH TASKS ==================================
if @spec.rubyforge_project
desc 'Publish website to rubyforge'
task 'publish:rdoc' => 'doc/index.html' do
sh "scp -rp doc/* rubyforge.org:/var/www/gforge-projects/#{name}/"
end
desc 'Public release to rubyforge'
task 'publish:gem' => [:package] do |t|
sh <<-end
rubyforge add_release -o Any -a #{CHANGES} -f -n #{README} #{name} #{name} #{@spec.version} pkg/#{name}-#{@spec.version}.gem &&
rubyforge add_file -o Any -a #{CHANGES} -f -n #{README} #{name} #{name} #{@spec.version} pkg/#{name}-#{@spec.version}.tgz
end
end
end
# RUBY DOCS TASK ==================================
begin
require 'hanna/rdoctask'
rescue LoadError
require 'rake/rdoctask'
end
Rake::RDocTask.new do |t|
t.rdoc_dir = 'doc'
t.title = @spec.summary
t.options << '--line-numbers' << '--inline-source' << '-A cattr_accessor=object'
t.options << '--charset' << 'utf-8'
t.rdoc_files.include(LICENSE)
t.rdoc_files.include(README)
t.rdoc_files.include(CHANGES)
t.rdoc_files.include('bin/*')
t.rdoc_files.include('lib/**/*.rb')
end
#Hoe.new('rspec', Spec::VERSION::STRING) do |p|
# p.summary = Spec::VERSION::SUMMARY
# p.description = "Behaviour Driven Development for Ruby."
# p.rubyforge_name = 'rspec'
# p.developer('RSpec Development Team', '[email protected]')
# p.extra_dev_deps = [["cucumber",">= 0.1.13"]]
# p.remote_rdoc_dir = "rspec/#{Spec::VERSION::STRING}"
# p.rspec_options = ['--options', 'spec/spec.opts']
# p.history_file = 'History.rdoc'
# p.readme_file = 'README.rdoc'
# p.post_install_message = <<-POST_INSTALL_MESSAGE
##{'*'*50}
#
# Thank you for installing rspec-#{Spec::VERSION::STRING}
#
# Please be sure to read History.rdoc and Upgrade.rdoc
# for useful information about this release.
#
#{'*'*50}
#POST_INSTALL_MESSAGE
#end