build a gem and push it

[url]http://gembundler.com/rubygems.html[/url]


bundle gem mynice
bundle init
gem build mynice.gemspec
gem push mynice-x.x.x.gem


mynice.gemspec

# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "xxx/version"

Gem::Specification.new do |s|
s.name = "xxx"
s.version = Nim::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["TODO: Write your name"]
s.email = ["TODO: Write your email address"]
s.homepage = ""
s.summary = %q{TODO: Write a gem summary}
s.description = %q{TODO: Write a gem description}

s.rubyforge_project = "xxx"

s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
end




.gitignore

*.gem
.bundle
Gemfile.lock
pkg/*



rspec测试
Rakefile

require 'rake/clean'
require 'rake/testtask'
require 'rspec/core/rake_task'

namespace :spec do
desc "Run all examples"
RSpec::Core::RakeTask.new(:examples) do |task|
task.pattern = 'spec/*_spec.rb'
end
end

task :default => "spec:examples"



Rspec匹配
[url]http://rspec.rubyforge.org/rspec/1.3.0/classes/Spec/Matchers.html[/url]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值