Class: Toys::SourceSpec::Gem

Inherits:
Base
  • Object
show all
Defined in:
lib/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.

Instance Attribute Summary collapse

Attributes inherited from Base

#context_directory, #source_name

Method Summary

Methods inherited from Base

#==, #hash

Instance Attribute Details

#default_confirmnil, 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



468
469
470
# File 'lib/toys/source_spec.rb', line 468

def default_confirm
  @default_confirm
end

#nameString (readonly)

The gem name.

Returns:

  • (String)


427
428
429
# File 'lib/toys/source_spec.rb', line 427

def name
  @name
end

#on_missingnil, ... (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



460
461
462
# File 'lib/toys/source_spec.rb', line 460

def on_missing
  @on_missing
end

#pathString? (readonly)

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

Returns:

  • (String, nil)


443
444
445
# File 'lib/toys/source_spec.rb', line 443

def path
  @path
end

#toys_dirString? (readonly)

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

Returns:

  • (String, nil)


450
451
452
# File 'lib/toys/source_spec.rb', line 450

def toys_dir
  @toys_dir
end

#versionArray<String> (readonly)

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

Returns:

  • (Array<String>)


435
436
437
# File 'lib/toys/source_spec.rb', line 435

def version
  @version
end