- 在ruby工程目錄下新建一個文件:crowdSystem.gemspec。需要在lib目錄下存在同一名稱的ruby庫文件:crowdSystem.rb
- crowdSystem.gemspec文件。寫入以下內容
Gem::Specification.new do |s| s.name = 'crowdSystem' s.version = '1.0.0' s.date = '2016-09-18' s.summary = "crowdSystem!" s.description = "crowdSys automated test application" s.authors = ["shench"] s.email = 'xxxxxxx@xxxnets.com' s.files = ["lib/crowdSystem.rb", "lib/crowdSysAction.rb","lib/crowdSysENV.rb","rake/Rakefile","rake/startTest.ini","rake/startTest.rb","testcase/testCase_checkList.txt"] s.homepage = 'http://172.17.2.44:9527/welcome/index' s.license = 'MIT' end
其中name+version為安裝gem包后的主目錄名:crowdSystem-1.0.0
- 構建gem包。在工程目錄下執行gem build crowdSystem.gemspec,將會在當前目錄下生成gem包:crowdSystem-1.0.0.gem
- 安裝gem包。在gem包所在目錄執行gem installcrowdSystem-1.0.0.gem
檢查gem列表
參考文檔:http://guides.rubygems.org/make-your-own-gem/