Skip to content

Instantly share code, notes, and snippets.

@fukajun
Created November 1, 2012 01:19
Show Gist options
  • Select an option

  • Save fukajun/3991008 to your computer and use it in GitHub Desktop.

Select an option

Save fukajun/3991008 to your computer and use it in GitHub Desktop.
GemSpec

Gem Spec その1

http://docs.rubygems.org/read/chapter/20

spec = Gem::Specification.new do |s| 
  s.name = %q{zbxapi}
  s.rubyforge_project = "zbxapi"        # gem名
  s.version = "0.1.#{revision}"         # バージョン->依存関係に利用
  s.authors = ["A. Nelson"]             # 作者名
  s.email = %q{}    # メールアドレス
  s.summary = %q{Ruby wrapper to the Zabbix API} # 簡単な説明
  s.homepage = %q{http://trac.red-tux.net/} # ホームページ
  s.description = %q{Provides a straight forward interface to manipulate Zabbix servers using the Zabbix API.}
  s.licenses = "LGPL 2.1"               # ライセンス情報
  s.requirements = "Requires json"      # gemに必要な条件, gem以外のライブラリなど
  s.add_dependency('json')              # 必要なgem *
  s.require_paths =["lib"]              # 読み込むファイルのルートパスを指定する deault: lib *
  s.files +=Dir[File.dirname(__FILE__)+"/lib/api_classes/" + 'dsl_*.rb'] *
end

Gem Spec その2

gem.executables   = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } # ファイルのなかで実行形式のものbin以下に置いてあるもの ex)rakeコマンド
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment