`
myrev
  • 浏览: 163216 次
  • 性别: Icon_minigender_1
  • 来自: 福建
社区版块
存档分类
最新评论

Make Ruby Gem

    博客分类:
  • Ruby
阅读更多

How to make gem

 

1. Install echoe gem

$ gem install echoe

2. make gem


$ mkdir hello_world
$ vi hello_world/Rakefile

require 'rubygems'
require 'rake'
require 'echoe'

Echoe.new('wkhtmltopdf_32_amd64', '0.0.1') do |p|
  p.description    = "wkhtmltopdf support linux 32,64 and OSX 32"
  p.url            = "http://github.com/sloanwu/wkhtmltopdf_32_amd64.git"
  p.author         = "Sloan Wu"
  p.email          = "sloanwu@gmail.com"
  p.ignore_pattern = ["tmp/*", "script/*"]
  p.development_dependencies = []
end

Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }

  save file




:~/hello_world$ rake manifest

:~/hello_world$ rake -T

get a bunch of tasks to help you manage your gem.


:~/hello_world$ rake gemspec

You can modify the project.gemspec

eg:

Gem::Specification.new do |s|
  s.name = %q{wkhtmltopdf_32_amd64}
  s.version = "0.0.1"

  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
  s.authors = ["Sloan Wu"]
  s.date = %q{2010-09-09}
  s.description = %q{wkhtmltopdf support linux 32,64 and OSX 32}
  s.email = %q{sloanwu@gmail.com}
  s.executables = ["wkhtmltopdf"]
  s.extra_rdoc_files = ["bin/test.rb", "bin/wkhtmltopdf", "bin/wkhtmltopdf_darwin_386", "bin/wkhtmltopdf_linux_386", "bin/wkhtmltopdf_linux_amd64"]
  s.files = ["Rakefile", "bin/test.rb", "bin/wkhtmltopdf", "bin/wkhtmltopdf_darwin_386", "bin/wkhtmltopdf_linux_386", "bin/wkhtmltopdf_linux_amd64", "Manifest", "wkhtmltopdf_32_amd64.gemspec"]
  s.homepage = %q{http://github.com/sloanwu/wkhtmltopdf_32_amd64.git}
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Wkhtmltopdf_32_amd64"]
  s.require_paths = ["lib"]
  s.rubyforge_project = %q{wkhtmltopdf_32_amd64}
  s.rubygems_version = %q{1.3.7}
  s.summary = %q{wkhtmltopdf support linux 32,64 and OSX 32}

  if s.respond_to? :specification_version then
    current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
    s.specification_version = 3

    if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
    else
    end
  else
  end
end

 


package to a gem

:~/hello_world$ gem build wkhtmltopdf_32_amd64.gemspec

 

 

3. pushlish on github


1) you need sign up a github user.

2) you need set the github user with a ssh key.

you can get help from http://help.github.com/linux-key-setup/


Global setup:

Download and install Git

$ git config --global user.name "sloanwu"

$ git config --global user.email sloanwu@gmail.com

 


Next steps:

  $ mkdir wkhtmltopdf_32_amd64
  $ cd wkhtmltopdf_32_amd64
  $ git init
  $ touch README
  $ git add README
  $ git commit -m 'first commit'
  $ git remote add origin git@github.com:sloanwu/wkhtmltopdf_32_amd64.git
  $ git push origin master
     

Existing Git Repo?


  $ cd existing_git_repo
  $ git remote add origin git@github.com:sloanwu/wkhtmltopdf_32_amd64.git
  $ git push origin master

4. publish on Rubygems.org


$ gem update --system

    Update to the latest RubyGems version

$ gem build foo.gemspec

    Build your gem

$ gem push foo-1.0.0.gem

 

0
1
分享到:
评论
1 楼 qichunren 2010-09-17  
我推荐你使用jeweler

相关推荐

    ruby selenium-client-1.2.18.gem

    9. Go to Cmd Prompt –> c:\Ruby192\bin>gem install selenium-client-1.2.18.gem Once you install selenium-client you should get the following conformation message: ' 1 gem installed ' Installing ri ...

    pages-gem:一个简单的Ruby Gem,用于引导依赖项,以与GitHub Pages同步设置和维护本地Jekyll环境

    GitHub页面Ruby Gem 一个简单的Ruby Gem,用于引导依赖项,以与GitHub Pages同步设置和维护本地Jekyll环境。 用法 可以选择使用pages-gem的... 从pages-gem目录的根目录运行make image以构建将被标记为gh-pages 或者

    Ruby1.91_Stable和Gem1.3.5

    ruby-1.9.1-p376.tar.gz ./configure make make install 注意RHEL5 时间设置 rubygems-1.3.5.tar ruby setup.rb

    openbabel-gem:用于 openbabel 的 Ruby GEM

    openbabel gem 已经用 ruby​​ 1.9 测试过。 它只能在 POSIX 系统上编译,并且需要已经安装以下内容: 制作 卷曲 tar、sed、make(无论如何都应该存在) 安装 gem 安装 openbabel 它下载 OpenBabel 源代码。 ...

    make-ruby-gem:想要制作Ruby宝石的人的教程

    制作Ruby宝石 想要制作Ruby宝石的人的教程。 为什么是宝石? 在开发Ruby或Rails应用程序时,您希望将代码公开给具有相同功能的开发人员。 因此,您使代码像libarary。 是的,这是一颗宝石。 环境 Ruby2.2.3 栏杆...

    ruby and watir 安装指南

    EXECUTABLE DIRECTORY: c:/ruby/bin - RUBYGEMS PLATFORMS: - ruby - x86-mswin32-60 - GEM PATHS: - c:/ruby/lib/ruby/gems/1.8 - C:/Documents and Settings/Administrator/.gem/ruby/1.8 - GEM CONFIGURATION: -...

    iruby:官方gem仓库:JupyterIPython Notebook的Ruby内核

    17.04至19.04 sudo apt install libtool libffi-dev ruby ruby-dev makesudo apt install libzmq3-dev libczmq-devgem install ffi-rzmqgem install iruby --preiruby register --force16.04 CZTop要求CZMQ> = 4.0.0...

    table_differ:Ruby gem 快照数据库表并计算快照之间的差异

    # Make some changes. Run Attachment.delete_all, pretty much anything. Attachment . first . update_attributes! ( name : 'newname' ) # compute the changes added , removed , changed = Attachment . diff_...

    使用Ruby脚本部署Redis Cluster集群步骤讲解

    安装Ruby和Gem 下载ruby wget https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.8.tar.gz 解压 tar xvf ruby-2.3.8.tar.gz 生成Makefile并且后面会被安装到/usr/local/ruby目录下 ./configure -prefix /usr/...

    esx:用于管理 VMWare ESX 主机的简单 ruby​​ RbVmomi 包装器

    apt-get install libxml2-dev libxslt-dev gcc make ruby​​gems gem install esx RHEL/Fedora yum install libxml2-devel libxslt-devel make gcc ruby​​gems gem install esx MacOSX 宝石安装esx 用法 用法...

    tock-www:Tock OS网站

    # sudo may make this work for now, but it will make your life miserable in the long run. brew install ruby gem install jekyll bundler 然后使用捆绑器安装所需的宝石 bundle install 建立网站: bundle ...

    ruby-gnome:从 Ruby 使用的一组 GNOME 库的绑定

    Ruby-GNOME 项目的 gems 可以使用gem命令轻松安装。 例如为了安装 gtk3 gem 及其依赖项: gem install gtk3 从 GitHub 主分支安装 您还可以从 GitHub 主分支安装这些 gem。 像下面这样创建Gemfile : source ...

    Rails bundle命令安装mysql gem包出错的解决方法

    解决 Rails bundle 安装不上 mysql gem包的问题 环境 ubuntu 12.04 ruby-2.1.1 首先 新建一个的一个项目,在该项目上执行.../home/wh/.rvm/gems/ruby-2.1.1@xxx/extensions/x86_64-linux/2.1.0/mysql2-0.3.16/gem_make.

    api_key_maker:帮助您生成随机 api 密钥字符串的 ruby​​ gem

    需要 Ruby 1.9.2 或更高版本。 用法 每当您需要生成密钥时,只需调用以下方法: ApiKeyMaker . make_api_key ( 10 ) 第一个参数告诉您希望密钥的长度。 默认为 10 个字符,但最长可达 39 个字符。 如果您希望...

    centOS Rails3环境搭建

    # ./configure && make && make install # ruby -v ruby 1.9.2 3 rails # gem install rails -v=2.3.11 4 passenger # gem install passenger passenger-install-apache2-module 安装完成后按照提示将...

    curb:libcurl的Ruby绑定

    Curb-Ruby的Libcurl绑定 Curb(可能是CUrl-RuBy之类)为libcurl(3)提供了Ruby语言绑定,libcurl(3)是...与该gem兼容的libcurl库的一组非详尽的兼容版本如下。 (请注意,这些只是经过测试并报告可在各种平台/Ruby

    ruby-unf_ext:CRuby的Unicode规范化表单支持库

    { |string| normalizer.normalize(string, :nfc) #=> string in NFC }符合Unicode 9.0要求Ruby 1.8.7 +,1.9.2 + C ++编译器和libstdc ++安装 gem install unf_ext或者: ruby extconf.rb && make && make install...

    RubyWnck3:适用于ruby的libwnck-3.0 utils,适用于ruby-gnome的rgtk3

    适用于gtk3(ruby gem)的Window Navigator Construction Kit库的Ruby绑定 如何使用 克隆源 ruby extconf.rb make 复制Wnck3.so或sudo make install 在您的ruby文件require 'Wnck3'或require 'Wnck3' , require...

    sonos, 使用 ruby 控制Sonos扬声器.zip

    sonos, 使用 ruby 控制Sonos扬声器 Sonos使用 ruby 控制 Sonos 扬声器。极大感谢 Rahim Sonawalla make SoCo 。 没有他的工作,这个 gem 是不可能的。 注意:目前发现在 2.1 中被破坏安装将此行添加到你的应用程序的

    Ruby中访问SQL Server数据库的配置实例

    因为工作需要,要分析存放在SQL Server上的数据,所以不得不研究一下如何使用Ruby访问SQL Server,发现其实还是很简单的: 安装FreeTDS 下载FreeTDS源代码 解压编译安装: 代码如下: ./configure –prefix=/usr/...

Global site tag (gtag.js) - Google Analytics