Tag: Bundler/gemパッケージ作成
bundle gem demo
bundle gem demo -b -t
bundle gem dbtools -b --test=minitest
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'demo/version' Gem::Specification.new do |spec| spec.name = "demo" spec.version = Demo::VERSION spec.authors = ["src"] spec.email = ["tanaka@test.net"] spec.description = %q{TODO: Write a gem description} spec.summary = %q{TODO: Write a gem summary} spec.homepage = "" spec.license = "MIT" spec.files = `git ls-files`.split($/) spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] spec.add_development_dependency "bundler", "~> 1.3" spec.add_development_dependency "rake" end
bundle install --path vendor/bundle
require "demo/version" module Demo def self.hello_world p "hello world!!" end end
bundle exec bin/demo.rb
rake build
gem install pkg/demo-0.0.1.gem
require 'demo' puts Demo.hello_world
bundle exec ruby test/hoge_test.rb
require_relative 'test_helper'
require "bundler/gem_tasks" require "rake/testtask" Rake::TestTask.new(:test) do |t| t.libs << "test" t.test_files = FileList['test/**/*_test.rb'] end task :default => :test
# bundle exec rake test TEST=test/hoge_test.rb bundle exec rake test $*
curl -u <username> https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials; chmod 0600 ~/.gem/credentials
bundle exec rake release
bundle exec rake release
bundle exec rake install