build a gem and push it

http://gembundler.com/rubygems.html

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匹配
http://rspec.rubyforge.org/rspec/1.3.0/classes/Spec/Matchers.html


你可能感兴趣的:(Build)