要約
Gem パッケージのメタデータを扱うためのクラスです。
目次
- 特異メソッド
- インスタンスメソッド
- 
- _dump
- add_bindir
- add_dependency
- add_development_dependency
- add_runtime_dependency
- assign_defaults
- author
- author=
- authors
- authors=
- autorequire
- autorequire=
- bindir
- bindir=
- cert_chain
- cert_chain=
- date
- date=
- default_executable
- default_executable=
- dependencies
- dependent_gems
- description
- description=
- development_dependencies
- email=
- executable
- executable=
- executables
- executables=
- extensions
- extensions=
- extra_rdoc_files
- extra_rdoc_files=
- file_name
- files
- files=
- full_gem_path
- full_name
- has_rdoc
- has_rdoc=
- has_rdoc?
- has_test_suite?
- has_unit_tests?
- homepage
- homepage=
- installation_path
- lib_files
- loaded=
- loaded?
- loaded_from
- loaded_from=
- mark_version
- name
- name=
- normalize
- original_name
- original_platform
- original_platform=
- platform
- platform=
- post_install_message
- post_install_message=
- rdoc_options
- rdoc_options=
- require_path
- require_path=
- require_paths
- require_paths=
- required_ruby_version
- required_ruby_version=
- required_rubygems_version
- required_rubygems_version=
- requirements
- requirements=
- rubygems_version
- rubygems_version=
- runtime_dependencies
- satisfies_requirement?
- signing_key
- signing_key=
- specification_version
- specification_version=
- summary
- summary=
- test_file
- test_file=
- test_files
- test_files=
- test_suite_file
- test_suite_file=
- to_ruby
- validate
- version
- version=
- yaml_initialize
 
- 定数
特異メソッド
- _load(str) -> Gem::Specification[permalink][rdoc][edit]
- 
マーシャルされたデータをロードするためのメソッドです。 - [PARAM] str:
- マーシャルされたデータを指定します。
 
- array_attribute(name) -> ()[permalink][rdoc][edit]
- 
Gem::Specification.attribute と同じですが、値を配列に格納するアクセサを作ります。 - [PARAM] name:
- 属性の名前を指定します。
 [SEE_ALSO] Gem::Specification.attribute 
- array_attributes -> Array[permalink][rdoc][edit]
- 
@@array_attributes の複製を返します。 [SEE_ALSO] Object#dup 
- attribute(name) -> ()[permalink][rdoc][edit]
- 
デフォルト値を指定したアクセサを定義するために使用します。 以下の副作用があります。 - クラス変数 @@attributes, @@default_value を変更します。
- 通常の属性書き込みメソッドを定義します。
- デフォルト値を持つ属性読み取りメソッドのように振る舞うメソッドを定義します。
 
- attribute_alias_singular(singular, plural) -> ()[permalink][rdoc][edit]
- 
既に存在する複数形の属性の単数形バージョンを定義します。 これは単に一つの引数を受け取りそれを配列に追加するようなヘルパーメソッドを定義するということです。 例: # このように定義すると attribute_alias_singular :require_path, :require_paths # こう書くかわりに s.require_paths = ['mylib'] # こう書くことができます。 s.require_path = 'mylib' - [PARAM] singular:
- 属性名の単数形を指定します。
- [PARAM] plural:
- 属性名の複数形を指定します。
 
- attribute_defaults -> Array[permalink][rdoc][edit]
- 
[TODO] @@attributes の複製を返します。 
- attribute_names -> Array[permalink][rdoc][edit]
- 
属性名の配列を返します。 
- attributes(*args) -> ()[permalink][rdoc][edit]
- 
複数の属性を一度に作成するために使用します。 各属性のデフォルト値は nil になります。 - [PARAM] args:
- 属性名を一つ以上指定します。
 
- default_value(name) -> object[permalink][rdoc][edit]
- 
与えられた名前の属性のデフォルト値を返します。 - [PARAM] name:
- 属性名を指定します。
 
- from_yaml(input) -> Gem::Specification[permalink][rdoc][edit]
- 
YAML ファイルから gemspec をロードします。 YAML ファイルから Gem::Specification をロードすると、通常の Ruby オブジェクトの初期化ルーチン (#initialize) を通りません。このメソッドは初期化ルーチンの一部を実行し、 gemspec のバージョンチェックも行います。 - [PARAM] input:
- 文字列か IO オブジェクトを指定します。
 
- list -> Array[permalink][rdoc][edit]
- 
実行中の Ruby のインスタンスで作成された Gem::Specification のインスタンスを返します。 
- load(filename) -> Gem::Specification[permalink][rdoc][edit]
- 
gemspec ファイルをロードします。 - [PARAM] filename:
- gemspec のファイル名を指定します。
- [EXCEPTION] StandardError:
- gemspec ファイル内でこのメソッドを呼んでいる場合に発生します。
 
- normalize_yaml_input(input) -> String[permalink][rdoc][edit]
- 
YAML 形式の gemspec を正しくフォーマットします。 - [PARAM] input:
- 文字列か IO オブジェクトを指定します。
 
- overwrite_accessor(name) { ... } -> ()[permalink][rdoc][edit]
- 
呼び出し時に特別な動作をする必要のある属性があります。このメソッドはそういうことを可能にします。 ブロックパラメータは任意のものを使用することができます。 - [PARAM] name:
- 属性名を指定します。
 
- read_only(*names) -> ()[permalink][rdoc][edit]
- 
与えられた属性名を読み取り専用にします。 - [PARAM] names:
- 属性名を一つ以上指定します。
 
- required_attribute(name, default = nil) -> ()[permalink][rdoc][edit]
- 
必須の属性を作成します。 - [PARAM] name:
- 属性名を指定します。
- [PARAM] default:
- デフォルト値を指定します。
 [SEE_ALSO] Gem::Specification.attribute 
- required_attribute?(name) -> bool[permalink][rdoc][edit]
- 
必須属性であれば真を返します。 - [PARAM] name:
- 属性名を指定します。
 
- required_attributes -> Array[permalink][rdoc][edit]
- 
必須属性のリストを返します。 
インスタンスメソッド
- _dump -> String[permalink][rdoc][edit]
- 
重要なインスタンス変数のみを Marshal.#dump します。 [SEE_ALSO] Marshal.#dump 
- add_bindir(executables) -> Array | nil[permalink][rdoc][edit]
- 
実行コマンドの格納場所を返します。 - [PARAM] executables:
- 実行コマンド名を格納した配列を指定します。
 
- add_dependency(gem, *requirements) -> [Gem::Dependency][permalink][rdoc][edit]
- add_runtime_dependency(gem, *requirements) -> [Gem::Dependency]
- 
この gem の RUNTIME 依存性を追加します。実行時に必要となる gem を指定します。 # https://github.com/rurema/bitclust/blob/v1.2.3/bitclust-core.gemspec#L25 s.add_runtime_dependency "progressbar", ">= 1.9.0", "< 2.0"- [PARAM] gem:
- 依存する gem の名前か Gem::Dependency のインスタンスを指定します。
- [PARAM] requirements:
- バージョンの必要条件を 0 個以上指定します。デフォルトは ">= 0" です。
 [SEE_ALSO] Gem::Specification#add_development_dependency, Gem::Dependency 
- add_development_dependency(gem, *requirements) -> [Gem::Dependency][permalink][rdoc][edit]
- 
この gem の DEVELOPMENT 依存性を追加します。この gem の開発時に必要となる gem を指定します。 gem "rack", "~> 1.6", ">= 1.6.12"- [PARAM] gem:
- 依存する gem の名前か Gem::Dependency のインスタンスを指定します。
- [PARAM] requirements:
- バージョンの必要条件を 0 個以上指定します。デフォルトは ">= 0" です。
 [SEE_ALSO] Gem::Specification#add_runtime_dependency, Gem::Dependency 
- assign_defaults -> ()[permalink][rdoc][edit]
- 
全ての属性にデフォルト値をセットします。 これはアクセサメソッドを使用して行われるので、ブロックを用いた特別な初期化もきちんと実行されます。セットされる値はデフォルト値のコピーです。 
- author -> String[permalink][rdoc][edit]
- 
作成者の名前を返します。 
- author=(name)[permalink][rdoc][edit]
- 
作成者の名前をセットします。 
- authors -> Array[permalink][rdoc][edit]
- 
作成者の名前の配列を返します。 
- authors=(names)[permalink][rdoc][edit]
- 
作成者の名前の配列をセットします。 
- autorequire -> String[permalink][rdoc][edit]
- 
非推奨の属性です。 
- autorequire=(lib)[permalink][rdoc][edit]
- 
非推奨の属性です。 
- bindir -> String[permalink][rdoc][edit]
- 
実行ファイルを格納するディレクトリを返します。 
- bindir=(dir)[permalink][rdoc][edit]
- 
実行ファイルを格納するディレクトリをセットします。 - [PARAM] dir:
- 実行ファイルを格納するディレクトリを指定します。デフォルトは "bin" です。
 
- cert_chain -> Array[permalink][rdoc][edit]
- 
[TODO] 
- cert_chain=(arr)[permalink][rdoc][edit]
- 
[TODO] - [PARAM] arr:
- デフォルトは空の配列です。
 
- date -> Time[permalink][rdoc][edit]
- 
日付を返します。 
- date=(date)[permalink][rdoc][edit]
- 
- [PARAM] date:
- 日付をセットします。デフォルトは今日です。
 
- default_executable -> String | nil[permalink][rdoc][edit]
- 
Gem パッケージ内で gem コマンド経由で実行するファイルを返します。 
- default_executable=(executable)[permalink][rdoc][edit]
- 
Gem パッケージ内で gem コマンド経由で実行するファイルをセットします。 - [PARAM] executable:
- 実行ファイルを指定します。
 
- dependencies -> Array[permalink][rdoc][edit]
- 
依存している Gem のリストを返します。 [SEE_ALSO] Gem::Dependency 
- dependent_gems -> Array[permalink][rdoc][edit]
- 
この Gem に依存している全ての Gem の情報のリストを返します。 それぞれのエントリは配列になっており、各要素は以下のようになっています。 
- description -> String[permalink][rdoc][edit]
- 
Gem パッケージの説明を返します。 
- description=(desc)[permalink][rdoc][edit]
- 
Gem パッケージの説明をセットします。 - [PARAM] desc:
- パッケージの詳細を説明する文章を指定します。
 
- development_dependencies -> Array[permalink][rdoc][edit]
- 
この Gem が依存している Gem のリストを返します。 
- email -> String[permalink][rdoc][edit]
- 
メールアドレスを返します。 
- email=(email)[permalink][rdoc][edit]
- 
メールアドレスをセットします。 - [PARAM] email:
- メールアドレスを指定します。
 
- executable -> String[permalink][rdoc][edit]
- 
実行可能ファイル名を返します。 
- executable=(executable)[permalink][rdoc][edit]
- 
実行可能ファイル名をセットします。 - [PARAM] executable:
- 実行可能ファイル名を指定します。
 
- executables -> [String][permalink][rdoc][edit]
- 
実行可能ファイル名のリストを返します。 
- executables=(executables)[permalink][rdoc][edit]
- 
実行可能ファイル名のリストをセットします。 - [PARAM] executables:
- 実行可能ファイル名のリストを指定します。
 
- extensions -> [String][permalink][rdoc][edit]
- 
拡張ライブラリをコンパイルするために必要な extconf.rb 形式のファイルのリストを返します。 
- extensions=(paths)[permalink][rdoc][edit]
- 
拡張ライブラリをコンパイルするために必要な extconf.rb 形式のファイルのリストをセットします。 - [PARAM] paths:
- 拡張ライブラリをコンパイルするために必要な extconf.rb 形式のファイルのリストを指定します。
 
- extra_rdoc_files -> [String][permalink][rdoc][edit]
- 
RDoc でドキュメントを作成する際に使用する特別なファイルのリストを返します。 
- extra_rdoc_files=(paths)[permalink][rdoc][edit]
- 
RDoc でドキュメントを作成する際に使用する特別なファイルのリストをセットします。 - [PARAM] paths:
- RDoc でドキュメントを作成する際に使用する特別なファイルのリストを指定します。
 
- file_name -> String[permalink][rdoc][edit]
- 
生成される Gem パッケージの名前を返します。 
- files -> [String][permalink][rdoc][edit]
- 
この Gem パッケージに含まれるファイル名の配列を返します。 
- files=(files)[permalink][rdoc][edit]
- 
この Gem パッケージに含まれるファイル名の配列をセットします。 - [PARAM] files:
- この Gem パッケージに含まれるファイル名の配列を指定します。
 
- full_gem_path -> String[permalink][rdoc][edit]
- 
この Gem パッケージへのフルパスを返します。 
- full_name -> String[permalink][rdoc][edit]
- 
この Gem パッケージのバージョンを含む完全な名前 (name-version) を返します。 プラットフォームの情報が指定されている場合は、それも含みます (name-version-platform)。 
- has_rdoc -> bool[permalink][rdoc][edit]
- 
真の場合は RDoc を生成しません。偽の場合は RDoc を生成します。 
- has_rdoc=(flag)[permalink][rdoc][edit]
- 
RDoc を生成するかどうかをセットします。デフォルトは偽です。 
- has_rdoc? -> bool[permalink][rdoc][edit]
- 
真の場合は RDoc を生成しません。偽の場合は RDoc を生成します。 [SEE_ALSO] Gem::Specification#has_rdoc 
- has_test_suite? -> bool[permalink][rdoc][edit]
- 
このメソッドは非推奨です。 Gem::Specification#has_unit_tests? を使用してください。 
- has_unit_tests? -> bool[permalink][rdoc][edit]
- 
この Gem パッケージがユニットテストを含むかどうか返します。 真の場合はユニットテストを含みます。そうでない場合は偽を返します。 
- homepage -> String[permalink][rdoc][edit]
- 
この Gem パッケージを作成しているプロジェクトか作成者のウェブサイトの URI を返します。 
- homepage=(uri)[permalink][rdoc][edit]
- 
この Gem パッケージを作成しているプロジェクトか作成者のウェブサイトの URI をセットします。 - [PARAM] uri:
- この Gem パッケージを作成しているプロジェクトか作成者のウェブサイトの URI を指定します。
 
- installation_path -> String[permalink][rdoc][edit]
- 
この Gem パッケージのインストール先のパスを返します。 
- lib_files -> [String][permalink][rdoc][edit]
- 
この Gem パッケージに含まれているファイルのうち Gem::Specification#require_paths 以下にあるファイルのリストを返します。 
- loaded=(flag)[permalink][rdoc][edit]
- 
この Gem パッケージの gemspec が既にロードされているかどうかをセットします。 この属性は永続化しません。 - [PARAM] flag:
- 既にロードされている場合は真を指定します。
 
- loaded? -> bool[permalink][rdoc][edit]
- 
この Gem パッケージの gemspec が既にロードされているかどうかを返します。 既にロードされている場合は真を返します。そうでない場合は偽を返します。 
- loaded_from -> String[permalink][rdoc][edit]
- 
この Gem パッケージの gemspec がある場所を返します。 この属性は永続化されません。 
- loaded_from=(path)[permalink][rdoc][edit]
- 
この Gem パッケージの gemspec がある場所をセットします。 - [PARAM] path:
- この Gem パッケージの gemspec がある場所を指定します。
 
- mark_version -> String[permalink][rdoc][edit]
- 
RubyGems のバージョンを内部にセットします。 
- name -> String[permalink][rdoc][edit]
- 
この Gem パッケージの名前を返します。 
- name=(name)[permalink][rdoc][edit]
- 
この Gem パッケージの名前をセットします。 - [PARAM] name:
- この Gem パッケージの名前を指定します。
 
- normalize -> [String][permalink][rdoc][edit]
- 
この Gem パッケージの含まれるファイルリストから重複を取り除きます。 
- original_name -> String[permalink][rdoc][edit]
- 
このメソッドは後方互換性のために残されています。 [SEE_ALSO] Gem::Specification#full_name 
- original_platform -> String[permalink][rdoc][edit]
- 
この属性は古いバージョンの Gem パッケージをアンインストールするために残されています。 
- original_platform=(platform)[permalink][rdoc][edit]
- 
この属性は古いバージョンの Gem パッケージをアンインストールするために残されています。 - [PARAM] platform:
- プラットフォームを指定します。
 
- platform -> String[permalink][rdoc][edit]
- 
この Gem パッケージを使用できるプラットフォームを返します。 
- platform=(platform)[permalink][rdoc][edit]
- 
この Gem パッケージを使用できるプラットフォームをセットします。 - [PARAM] platform:
- この Gem パッケージを使用できるプラットフォームを指定します。デフォルトは Gem::Platform::RUBY です。
 [SEE_ALSO] Gem::Platform::RUBY 
- post_install_message -> String[permalink][rdoc][edit]
- 
インストール完了後に表示するメッセージを返します。 
- post_install_message=(message)[permalink][rdoc][edit]
- 
インストール完了後に表示するメッセージをセットします。 - [PARAM] message:
- メッセージを指定します。
 
- rdoc_options -> [String][permalink][rdoc][edit]
- 
API ドキュメントを生成するときに rdoc コマンドに与えるオプションを返します。 
- rdoc_options=(options)[permalink][rdoc][edit]
- 
API ドキュメントを生成するときに rdoc コマンドに与えるオプションをセットします。 - [PARAM] options:
- API ドキュメントを生成するときに rdoc コマンドに与えるオプションを指定します。
 
- require_path -> String[permalink][rdoc][edit]
- 
Gem::Specification#require_paths の単数バージョンです。 [SEE_ALSO] Gem::Specification#require_paths 
- require_path=(path)[permalink][rdoc][edit]
- 
Gem::Specification#require_paths= の単数バージョンです。 - [PARAM] path:
- この Gem パッケージを使用した際に require するファイルが置かれているディレクトリを指定します。
 [SEE_ALSO] Gem::Specification#require_paths= 
- require_paths -> [String][permalink][rdoc][edit]
- 
この Gem パッケージを使用した際に require するファイルが置かれているディレクトリのリストを返します。 
- require_paths=(paths)[permalink][rdoc][edit]
- 
この Gem パッケージを使用した際に require するファイルが置かれているディレクトリのリストをセットします。 - [PARAM] paths:
- この Gem パッケージを使用した際に require するファイルが置かれているディレクトリのリストを指定します。
 
- required_ruby_version -> Gem::Requirement[permalink][rdoc][edit]
- 
この Gem パッケージを動作させるのに必要な Ruby のバージョンを返します。 
- required_ruby_version=(requirement)[permalink][rdoc][edit]
- 
この Gem パッケージを動作させるのに必要な Ruby のバージョンをセットします。 - [PARAM] requirement:
- Gem::Requirement.create が受け付ける形式のオブジェクトを指定します。
 [SEE_ALSO] Gem::Requirement 
- required_rubygems_version -> Gem::Requirement[permalink][rdoc][edit]
- 
この Gem パッケージを動作させるのに必要な RubyGems のバージョンを返します。 
- required_rubygems_version=(requirement)[permalink][rdoc][edit]
- 
この Gem パッケージを動作させるのに必要な RubyGems のバージョンをセットします。 - [PARAM] requirement:
- Gem::Requirement.create が受け付ける形式のオブジェクトを指定します。
 [SEE_ALSO] Gem::Requirement 
- requirements -> Array[permalink][rdoc][edit]
- 
この Gem パッケージを動作させるのに必要な条件を返します。これはユーザのためのシンプルな情報です。 
- requirements=(informations)[permalink][rdoc][edit]
- 
この Gem パッケージを動作させるのに必要な条件をセットします。これはユーザのためのシンプルな情報をセットします。 - [PARAM] informations:
- 情報を文字列の配列で指定します。
 
- rubygems_version -> String[permalink][rdoc][edit]
- 
この Gem パッケージを作成した RubyGems のバージョンを返します。 
- rubygems_version=(version)[permalink][rdoc][edit]
- 
この Gem パッケージを作成した RubyGems のバージョンをセットします。この属性は Gem パッケージが作成された時に自動的にセットされます。 - [PARAM] version:
- RubyGems のバージョンを指定します。
 
- runtime_dependencies -> Array[permalink][rdoc][edit]
- 
この Gem パッケージが依存している Gem パッケージのリストを返します。 
- satisfies_requirement?(dependency) -> bool[permalink][rdoc][edit]
- 
この Gem パッケージが与えられた依存関係を満たすかどうかを返します。 依存関係を満たす場合は真を返します。そうでない場合は偽を返します。 - [PARAM] dependency:
- チェックしたい依存関係を指定します。
 [SEE_ALSO] Gem::Dependency 
- signing_key -> String[permalink][rdoc][edit]
- 
この Gem パッケージの署名に使用するキーを返します。 
- signing_key=(key)[permalink][rdoc][edit]
- 
この Gem パッケージの署名に使用するキーをセットします。 - [PARAM] key:
- 署名に使用するキーを指定します。
 
- specification_version -> Integer[permalink][rdoc][edit]
- 
この Gem パッケージに用いられている gemspec のバージョンを返します。 
- specification_version=(version)[permalink][rdoc][edit]
- 
この Gem パッケージに用いられている gemspec のバージョンをセットします。 - [PARAM] version:
- gemspec のバージョンを指定します。
 [SEE_ALSO] Gem::Specification::SPECIFICATION_VERSION_HISTORY 
- summary -> String[permalink][rdoc][edit]
- 
この Gem パッケージの短い説明を返します。 
- summary=(summary)[permalink][rdoc][edit]
- 
この Gem パッケージの短い説明をセットします。 - [PARAM] summary:
- 短い説明を指定します。
 
- test_file -> String[permalink][rdoc][edit]
- 
Gem::Specification#test_files の単数バージョンです。 
- test_file=(file)[permalink][rdoc][edit]
- 
Gem::Specification#test_files= の単数バージョンです。 
- test_files -> [String][permalink][rdoc][edit]
- 
ユニットテストのファイルのリストを返します。 
- test_files=(files)[permalink][rdoc][edit]
- 
ユニットテストのファイルのリストをセットします。 - [PARAM] files:
- ユニットテストのファイルのリストを指定します。
 
- test_suite_file -> String[permalink][rdoc][edit]
- 
この属性は非推奨です。 Gem::Specification#test_files を使用してください。 
- test_suite_file=(file)[permalink][rdoc][edit]
- 
この属性は非推奨です。 Gem::Specification#test_files= を使用してください。 - [PARAM] file:
- テストスイートのファイルを指定します。
 
- to_ruby -> String[permalink][rdoc][edit]
- 
自身を再現するための Ruby スクリプトを文字列で返します。 省略されている値はデフォルト値が使用されます。 
- validate -> bool[permalink][rdoc][edit]
- 
必須属性のチェックと自身の基本的な正当性チェックを行います。 チェックにパスした場合は常に true を返します。そうでない場合は例外が発生します。 - [EXCEPTION] Gem::InvalidSpecificationException:
- チェックにパスしなかった場合に発生します。
 
- version -> Gem::Version[permalink][rdoc][edit]
- 
この Gem パッケージのバージョンを返します。 
- version=(version)[permalink][rdoc][edit]
- 
この Gem パッケージのバージョンをセットします。 - [PARAM] version:
- バージョンを文字列か Gem::Version のインスタンスで指定します。
 
- yaml_initialize[permalink][rdoc][edit]
- 
[TODO] 
定数
- CURRENT_SPECIFICATION_VERSION -> 2[permalink][rdoc][edit]
- 
現在の gemspec のバージョンを表す定数です。 
- MARSHAL_FIELDS -> Hash[permalink][rdoc][edit]
- 
[TODO] 
- NONEXISTENT_SPECIFICATION_VERSION -> -1[permalink][rdoc][edit]
- 
明確に指定されていない時の gemspec のバージョンを表します。 
- SPECIFICATION_VERSION_HISTORY -> Hash[permalink][rdoc][edit]
- 
gemspec ファイルのバージョンの歴史を表す定数です。 
- TODAY -> Time[permalink][rdoc][edit]
- 
本日の日付を返します。