ruby打包成gem

gem 打包:
gem build xxx.rb
gem 安裝:
gem install xxx.rb
例如:

運行->CMD->轉到需要打包的文件夾下->gem build install.rb
instal.rb代碼
require 'rubygems'
spec = Gem::Specification.new do |spec|
spec.name='ganjiang' //gem名稱
spec.summary = "Hello! Ruby!" //gem概述
spec.description = %{This is my first gem!} //gem用途
spec.author = "ganjiang" //作者
spec.email = "[email protected]"
spec.homepage = "www.183ww.com"
spec.files = Dir['lib/*.rb'] //位於lib子文件夾下的所有.rb文件
spec.version = "1.0.0" //版本號
end
安裝 gem install install.rb
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章