記事の引越しから漏れていたのでサルベージ。
RubyGems パッケージの作り方 - rubyforge 登録まで
僕はまだRubyForgeにGemを登録した事がないので、secondlife
Hoeは、Seattle.rb
Hoeを使ってGemを作る流れは、
- sowコマンドでGemの雛形を生成
- 雛形を元にGemを作成
という感じで、非常に簡単です。具体的に簡単なGemを作る方法を紹介します。
まずはHoeをインストールしましょう。
# gem install hoe --include- dependenci es
そしてGemの雛形を生成します。
1 $ sow sample 2 creating project sample 3 ... done, now go fix all occurancesof 'FIX' 4 5 sample/Rak efile:9: # p.summary = 'FIX' 6 sample/REA DME.txt:2: by FIX 7 sample/REA DME.txt:3: FIX 8 sample/REA DME.txt:7: FIX 9 sample/REA DME.txt:11 :* FIX 10 sample/REA DME.txt:15 : FIX 11 sample/REA DME.txt:19 :+ FIX 12 sample/REA DME.txt:23 :+ FIX 13 sample/REA DME.txt:29 :Copyright (c) 2006 FIX
とりあえずこのFIXというところをカスタマイズすればOKという親切ぶりです。 そしてさらに、次のようなRakeタスクが生成されます。
1 $ rake -T 2 (in /home/takiuchi/sampl e) 3 rake announce # Generate email announceme nt file and post to rubyforge. 4 rake audit # Run ZenTest against the package 5 rake check_mani fest # Verify the manifest 6 rake clean # Clean up all the extras 7 rake clobber_do cs # Remove rdoc products 8 rake clobber_pa ckage # Remove package products 9 rake debug_gem # Show informatio n about the gem. 10 rake default # Run the default tasks 11 rake docs # Build the docs HTML Files 12 rake email # Generate email announceme nt file. 13 rake install # Install the package. Uses PREFIX and RUBYLIB 14 rake install_ge m # Install the package as a gem 15 rake multi # Run the test suite using multiruby 16 rake package # Build all the packages 17 rake post_news # Post announceme nt to rubyforge. 18 rake publish_do cs # Publish RDoc to RubyForge 19 rake redocs # Force a rebuild of the RDOC files 20 rake release # Package and upload the release to rubyforge. 21 rake repackage # Force a rebuild of the package files 22 rake ridocs # Generate ri locally for testing 23 rake test # Run the test suite. Use FILTER to add to the command line. 24 rake uninstall # Uninstall the package.
なんとも魅力的な名前のタスク達ではないでしょうか。 rakeコマンドを打つだけでRubyForge上でのいろんな作業が出来てしまいそうです。
そのほか細かいところは同じなので、secondlife
posted by
genki
on Wed 21 Nov 2007
at 12:14