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/

 

posted @ 2017-02-09 12:06  Fithon  阅读(1981)  评论(0编辑  收藏  举报