2

私は自分のリポジトリruby gemに宝石を公開するためのレーキ タスクを作成したいと思います: .GemInABoxhttp://my-gem-repo.com

この目標を達成する最も簡単な方法は何ですか?

また、デフォルトで への公開を防止したいと考えていますRubygems.org

4

1 に答える 1

5

Information on hosting your own gem can be found at http://guides.rubygems.org/run-your-own-gem-server/

Setup the server according to that site and the README on https://github.com/cwninja/geminabox

To release your gem:

gem build my_ruby_gem.gemspec
#push all versions to the gem server
gem inabox 

The first time you run gem inabox, you will configure the destination.

For rake tasks, you could put this Rakefile in your gem source:

#!/usr/bin/env rake
desc "build the gem"
task :build do
  system("gem build *.gemspec")
end

desc "push the gem to the gem inabox server"
task :release do
  system("gem inabox")
end

desc "build and release the gem"
task :build_and_release => [:build,:release]

The system calls are definitely hacks, but they are a simple way to make it work. Better rake tasks are requested in: https://github.com/cwninja/geminabox/issues/59

于 2013-04-15T03:46:46.763 に答える