extend: Gem::UserInteraction
aliases: Gem::Cache
要約
個々のソースから取得した全ての有効な Gem パッケージをインデックス化するためのクラスです。
Gem パッケージのフルネームと それぞれの Gem::Specification オブジェクトを対応付けます。
目次
- 特異メソッド
- インスタンスメソッド
継承しているメソッド
- Enumerableから継承しているメソッド
-
- all?
- any?
- chain
- chunk
- chunk_while
- collect
- collect_concat
- compact
- count
- cycle
- detect
- drop
- drop_while
- each_cons
- each_entry
- each_slice
- each_with_index
- each_with_object
- entries
- filter
- filter_map
- find
- find_all
- find_index
- first
- flat_map
- grep
- grep_v
- group_by
- include?
- inject
- lazy
- map
- max
- max_by
- member?
- min
- min_by
- minmax
- minmax_by
- none?
- one?
- partition
- reduce
- reject
- reverse_each
- select
- slice_after
- slice_before
- slice_when
- sort
- sort_by
- sum
- take
- take_while
- tally
- to_a
- to_h
- uniq
- zip
- Gem::UserInteractionから継承しているメソッド
- Gem::DefaultUserInteractionから継承しているメソッド
特異メソッド
from_gems_in(*spec_dirs) -> Gem::SourceIndexRuby 1.9.3 から[permalink][rdoc][edit]-
引数で与えられたディレクトリに置かれている Ruby スクリプト形式の gemspec ファイルを使用して新しいインスタンスを作成します。
- [PARAM]
spec_dirs: - gemspec ファイルが置かれているディレクトリを一つ以上指定します。
- [PARAM]
from_installed_gems(*deprecated) -> Gem::SourceIndexRuby 1.9.3 から[permalink][rdoc][edit]-
与えられたパスをもとに、インスタンスを作成するファクトリメソッドです。
- [PARAM]
deprecated: - この引数は非推奨です。後方互換性のためにのみ提供されているので使用すべきではありません。
[SEE_ALSO] Gem::SourceIndex.from_gems_in
- [PARAM]
installed_spec_directories -> [String]Ruby 1.9.3 から[permalink][rdoc][edit]-
gemspec ファイルがインストールされているディレクトリのリストを返します。
[SEE_ALSO] Gem.#path
load_specification(file_name) -> Gem::Specification | nilRuby 1.9.3 から[permalink][rdoc][edit]-
与えられたファイル名から Ruby スクリプト形式の gemspec をロードして Gem::Specification のインスタンスを返します。
- [PARAM]
file_name: - ファイル名を指定します。
- [EXCEPTION]
SignalException: - gemspec をロードしているときに発生します。
- [EXCEPTION]
SystemExit: - gemspec をロードしているときに発生します。
- [PARAM]
new(specifications = {}) -> Gem::SourceIndexRuby 1.9.3 から[permalink][rdoc][edit]-
与えられたハッシュを元に自身を初期化します。
- [PARAM]
specifications: - キーを Gem の名前、値を Gem::Specification のインスタンスとするハッシュを指定します。
- [PARAM]
インスタンスメソッド
add_spec(gem_spec) -> Gem::SpecificationRuby 1.9.3 から[permalink][rdoc][edit]-
自身に引数で与えられた Gem::Specification のインスタンスを追加します。
- [PARAM]
gem_spec: - Gem::Specification のインスタンスを指定します。
- [PARAM]
add_specs(*gem_specs) -> HashRuby 1.9.3 から[permalink][rdoc][edit]-
自身に引数で与えられた Gem::Specification のインスタンスを全て追加します。
- [PARAM]
gem_specs: - 複数の Gem::Specification のインスタンスを指定します。
- [PARAM]
dump -> ()Ruby 1.9.3 から[permalink][rdoc][edit]-
自身を Marshal.#dump します。
each {|full_name, gem| ... } -> HashRuby 1.9.3 から[permalink][rdoc][edit]each -> Enumerator-
自身に登録されているそれぞれの Gem についてブロックを評価します。
find_name(gem_name, version_requirement = Gem::Requirement.default) -> Gem::SpecificationRuby 1.9.3 から[permalink][rdoc][edit]-
短い名前で正確にマッチする Gem を返します。
- [PARAM]
gem_name: - Gem の名前を指定します。
- [PARAM]
version_requirement:
[SEE_ALSO] Gem::Requirement
- [PARAM]
gem_signature(gem_full_name) -> StringRuby 1.9.3 から[permalink][rdoc][edit]-
与えられた名前を持つ Gem の SHA256 ダイジェストを返します。
- [PARAM]
gem_full_name: - Gem の名前を指定します。
- [PARAM]
index_signature -> StringRuby 1.9.3 から[permalink][rdoc][edit]-
ソースインデックスの SHA256 ダイジェストを返します。
この値はインデックスが変更されると変化します。
latest_specs -> ArrayRuby 1.9.3 から[permalink][rdoc][edit]-
自身に含まれる最新の Gem::Specification のリストを返します。
size -> IntegerRuby 1.9.3 から[permalink][rdoc][edit]length -> Integer-
自身に含まれる Gem の個数を返します。
load_gems_in(*spec_dirs) -> selfRuby 1.9.3 から[permalink][rdoc][edit]-
引数で与えられたディレクトリに含まれる gemspec から自身を再構築して返します。
- [PARAM]
spec_dirs: - gemspec の含まれているディレクトリを複数指定します。
- [PARAM]
outdated -> ArrayRuby 1.9.3 から[permalink][rdoc][edit]-
更新されていない Gem::Specification のリストを返します。
refresh! -> selfRuby 1.9.3 から[permalink][rdoc][edit]-
自身を再作成します。
- [EXCEPTION]
StandardError: - 自身がディスクから読み込んで作成されていない場合に発生します。
- [EXCEPTION]
remove_spec(full_name) -> Gem::SpecificationRuby 1.9.3 から[permalink][rdoc][edit]-
引数で指定された名前を持つ Gem をインデックスから削除します。
search(gem_pattern, platform_only = false) -> [Gem::Specification]Ruby 1.9.3 から[permalink][rdoc][edit]-
引数で指定された条件を満たす Gem のリストを返します。
- [PARAM]
gem_pattern: - 検索したい Gem を表す Gem::Dependency のインスタンスを指定します。
- [PARAM]
platform_only: - 真を指定するとプラットフォームが一致するもののみを返します。デフォルトは偽です。
- [PARAM]
size -> IntegerRuby 1.9.3 から[permalink][rdoc][edit]-
自身のサイズを返します。
spec_dirs -> [String]Ruby 1.9.3 から[permalink][rdoc][edit]-
Gem::SourceIndex#refresh! で自身を更新する時に使用するディレクトリを取得します。
spec_dirs=(dirs)Ruby 1.9.3 から[permalink][rdoc][edit]-
Gem::SourceIndex#refresh! で自身を更新する時に使用するディレクトリを設定します。
specification(full_name) -> Gem::Specification | nilRuby 1.9.3 から[permalink][rdoc][edit]-
指定された名前の Gem::Specification オブジェクトを返します。
- [PARAM]
full_name: - Gem のフルネームを指定します。
- [PARAM]
update(source_uri, all) -> boolRuby 1.9.3 から[permalink][rdoc][edit]-
第一引数で指定された URI を使用して自身を更新します。
- [PARAM]
source_uri: - 更新に使用する URI を指定します。文字列か URI::Generic のサブクラスを指定します。
- [PARAM]
all: - 偽を指定すると最新バージョンの Gem のみ取得します。真を指定すると全てのバージョンの Gem を取得します。
- [PARAM]