Class: Toys::SourceSpec::Gem

Inherits:
Base
  • Object
show all
Defined in:
core-docs/toys/source_spec.rb

Overview

A spec for a source located in a gem.

Beware that within the Toys::SourceSpec namespace, the name Gem resolves to this class rather than to Ruby's ::Gem. Prefix references to the latter with ::, as the project's style rules already require.

Defined in the toys-core gem

Instance Attribute Summary collapse

Attributes inherited from Base

#context_directory, #source_name

Method Summary

Methods inherited from Base

#==, #hash

Instance Attribute Details

#default_confirm ⇒ nil, boolean (readonly)

The default response for a confirmation prompt

Returns:

  • (nil) —

    to use the default behavior for the Gems util

  • (boolean) —

    to provide an override



318
319
320
# File 'core-docs/toys/source_spec.rb', line 318

def default_confirm
  @default_confirm
end

#name ⇒ String (readonly)

The gem name.

Returns:

  • (String)


277
278
279
# File 'core-docs/toys/source_spec.rb', line 277

def name
  @name
end

#on_missing ⇒ nil, ... (readonly)

What to do if the gem is not installed.

Returns:

  • (nil) —

    to use the default behavior for the Gems util

  • (:error) —

    if an error should be raised

  • (:confirm) —

    if a confirmation prompt should be presented

  • (:install) —

    if the gem should be installed without confirmation



310
311
312
# File 'core-docs/toys/source_spec.rb', line 310

def on_missing
  @on_missing
end

#path ⇒ String? (readonly)

The path from the gem's toys directory, or nil for the entire toys directory.

Returns:

  • (String, nil)


293
294
295
# File 'core-docs/toys/source_spec.rb', line 293

def path
  @path
end

#toys_dir ⇒ String? (readonly)

The name of the gem's toys directory, or nil to use the default.

Returns:

  • (String, nil)


300
301
302
# File 'core-docs/toys/source_spec.rb', line 300

def toys_dir
  @toys_dir
end

#version ⇒ Array<String> (readonly)

The version requirements. Always an array, which is empty if any version is allowed.

Returns:

  • (Array<String>)


285
286
287
# File 'core-docs/toys/source_spec.rb', line 285

def version
  @version
end