More Related Content Similar to 初めての公開Gem作り (20) More from Tomoe Sawai (16) 初めての公開Gem作り4. 自己紹介Ruby とわたし
● Ruby on Rails を触り始めて2年弱くらい
● ここ1年は趣味プロジェクトが中心
● いつも「久しぶりに書くからよくわからない」と言ってる
つまり実質初心者
6. アジェンダ
● Ruby で使うライブラリ
● 他の言語のライブラリに比べると、
便利なものが圧倒的に多い
● Gemfile に書いて `bundle install` で入れてるアレ
● 依存関係の管理もしてくれる
● なんと!Rails も Gem の1つ
Gem ってなに?
17. Gemの設定を書く
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "jptax/version"
Gem::Specification.new do |spec|
spec.name = "jptax"
spec.version = Jptax::VERSION
spec.authors = ["tomoeine"]
spec.email = ["tomoe.teshima@gmail.com"]
spec.summary = %q{Easy calculating Japanese consumption tax.}
spec.description = %q{Easy calculating Japanese consumption tax.}
spec.homepage = "https://github.com/tomoeine/jptax"
spec.license = "MIT"
spec.files = `git ls-files -z`.split("x0").reject do |f|
f.match(%r{^(test|spec|features)/})
end
spec.require_paths = ["lib"]
spec.add_development_dependency "bundler"
spec.add_development_dependency "rake"
spec.add_development_dependency "rspec"
end
jptax.gemspec
リポジトリに関する情報
依存するライブラリ
23. アジェンダGit のリポジトリにプッシュする
$ git init
$ git add -A
$ git commit -m "initial commit"
$ git git remote add origin https://github.com/tomoeine/jptax.git
$ git push -u origin master
shell
あらかじめ GitHub にリポジトリを作っておく
(便宜上 master に直接プッシュしていますが、実際にはブランチを分けましょう)
25. アジェンダRubyGems に登録する
$ gem signin
Enter your RubyGems.org credentials.
Don't have an account yet? Create one at
https://rubygems.org/sign_up
Email: tomoe.teshima@gmail.com
Password:
Signed in.
shell
コンソールでサインイン