root/lang/ruby/rdoc/generators/template/html/resh/gem/Rakefile @ 452

Revision 452, 3.9 kB (checked in by cho45, 7 years ago)

lang/ruby/rdoc/generators/template/html/resh/gem/Rakefile:rubyforgeへのhtmlアップロードをrsyncつかうように修正lang/ruby/rdoc/generators/template/html/resh/style.css,lang/ruby/rdoc/generators/template/html/resh/index.rhtml:ささいなデザインとソースの修正

Line 
1require 'rubygems'
2require 'rake'
3require 'rake/clean'
4require 'rake/testtask'
5require 'rake/packagetask'
6require 'rake/gempackagetask'
7require 'rake/rdoctask'
8require 'rake/contrib/sshpublisher'
9require 'rake/contrib/rubyforgepublisher'
10require 'rubyforge'
11require 'fileutils'
12include FileUtils
13
14NAME = "resh"
15AUTHOR = "cho45"
16EMAIL = "cho45@lowreal.net"
17DESCRIPTION = "A RDoc template."
18RUBYFORGE_PROJECT = "lowreal"
19HOMEPATH = "http://coderepos.org/share/wiki/Resh"
20BIN_FILES = %w(  )
21VERS = "0.0.2"
22
23REV = File.read(".svn/entries")[/committed-rev="(d+)"/, 1] rescue nil
24CLEAN.include ['**/.*.sw?', '*.gem', '.config']
25CLOBBER.include ['lib/rdoc/generators/template/html/resh/*']
26RDOC_OPTS = ['--title', "#{NAME} documentation",
27        "--charset", "utf-8",
28        "--opname", "index.html",
29        "--line-numbers",
30        "--main", "README",
31        "--inline-source",
32]
33
34desc "Packages up #{NAME} gem."
35task :default => [:test]
36task :package => [:clean]
37
38Rake::TestTask.new("test") { |t|
39        t.libs << "test"
40        t.pattern = "test/**/*_test.rb"
41        t.verbose = true
42}
43
44spec = Gem::Specification.new do |s|
45        s.name              = NAME
46        s.version           = VERS
47        s.platform          = Gem::Platform::RUBY
48        s.has_rdoc          = true
49        s.extra_rdoc_files  = ["README", "ChangeLog"]
50        s.rdoc_options     += RDOC_OPTS + ['--exclude', '^(examples|extras)/']
51        s.summary           = DESCRIPTION
52        s.description       = DESCRIPTION
53        s.author            = AUTHOR
54        s.email             = EMAIL
55        s.homepage          = HOMEPATH
56        s.executables       = BIN_FILES
57        s.rubyforge_project = RUBYFORGE_PROJECT
58        s.bindir            = "bin"
59        s.require_path      = "lib"
60        s.autorequire       = "rdoc/generators/template/html/resh"
61        s.test_files        = Dir["test/test_*.rb"]
62
63        #s.add_dependency('activesupport', '>=1.3.1')
64        #s.required_ruby_version = '>= 1.8.2'
65
66        files = Dir["../*"]
67        files.delete("../#{File.basename(Dir.pwd)}")
68        FileUtils.cp_r files, "lib/rdoc/generators/template/html/resh/", :verbose => true
69        s.files = %w(README ChangeLog Rakefile) +
70                Dir.glob("{bin,doc,test,lib,templates,generator,extras,website,script}/**/*") +
71                Dir.glob("ext/**/*.{h,c,rb}") +
72                Dir.glob("examples/**/*.rb") +
73                Dir.glob("tools/*.rb")
74
75        s.extensions = FileList["ext/**/extconf.rb"].to_a
76end
77
78Rake::GemPackageTask.new(spec) do |p|
79        p.need_tar = true
80        p.gem_spec = spec
81end
82
83task :install do
84        name = "#{NAME}-#{VERS}.gem"
85        sh %{rake package}
86        sh %{sudo gem install pkg/#{name}}
87end
88
89task :uninstall => [:clean] do
90        sh %{sudo gem uninstall #{NAME}}
91end
92
93
94Rake::RDocTask.new do |rdoc|
95        rdoc.rdoc_dir = 'html'
96        rdoc.options += RDOC_OPTS
97        rdoc.template = "#{ENV["HOME"]}/coderepos/lang/ruby/rdoc/generators/template/html/resh/resh.rb"
98        #rdoc.template = "#{ENV['template']}.rb" if ENV['template']
99        if ENV['DOC_FILES']
100                rdoc.rdoc_files.include(ENV['DOC_FILES'].split(/,\s*/))
101        else
102                rdoc.rdoc_files.include('README', 'ChangeLog')
103                rdoc.rdoc_files.include('lib/**/*.rb')
104                rdoc.rdoc_files.include('ext/**/*.c')
105        end
106end
107
108desc "Publish to RubyForge"
109task :rubyforge => [:rdoc, :package] do
110        @local_dir = "html"
111        @host = "cho45@rubyforge.org"
112        @remote_dir = "/var/www/gforge-projects/#{RUBYFORGE_PROJECT}/#{NAME}"
113        sh %{rsync -r --delete --verbose #{@local_dir}/ #{@host}:#{@remote_dir}}
114end
115
116desc 'Package and upload the release to rubyforge.'
117task :release => [:clean, :package, :release_local] do |t|
118        v = ENV["VERSION"] or abort "Must supply VERSION=x.y.z"
119        abort "Versions don't match #{v} vs #{VERS}" unless v == VERS
120        pkg = "pkg/#{NAME}-#{VERS}"
121
122        rf = RubyForge.new
123        puts "Logging in"
124        rf.login
125
126        c = rf.userconfig
127#       c["release_notes"] = description if description
128#       c["release_changes"] = changes if changes
129        c["preformatted"] = true
130
131        files = [
132                "#{pkg}.tgz",
133                "#{pkg}.gem"
134        ].compact
135
136        puts "Releasing #{NAME} v. #{VERS}"
137        rf.add_release RUBYFORGE_PROJECT, NAME, VERS, *files
138end
139
140desc "Package and upload the release to local gem repos."
141task :release_local => [:clean, :package] do |t|
142        name = "#{NAME}-#{VERS}.gem"
143        sh %{scp pkg/#{name} c:/srv/www/lab.lowreal.net/public/gems/gems}
144end
Note: See TracBrowser for help on using the browser.