ruby 制作自己的gem包


  • 在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/

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM