Results for: "slice"

TupleSpaceProxy allows a remote Tuplespace to appear as local.

The Tuplespace manages access to the tuples it contains, ensuring mutual exclusion requirements are met.

The sec option for the write, take, move, read and notify methods may either be a number of seconds or a Renewer object.

Gem::DependencyList is used for installing and uninstalling gems in the correct order to avoid conflicts.

Raised when trying to activate a gem, and that gem does not exist on the system. Instead of rescuing from this class, make sure to rescue from the superclass Gem::LoadError to catch all types of load errors.

An error that indicates we weren’t able to fetch some data from a source

Base exception class for RubyGems. All exception raised by RubyGems are a subclass of this one.

No documentation available
No documentation available

Raised when attempting to uninstall a gem that isn’t in GEM_HOME.

Potentially raised when a specification is validated.

Used to raise parsing and loading errors

No documentation available
No documentation available

Raised by Gem::Validator when something is not right in a gem.

Raised to indicate that a system exit should occur with the specified exit_code

No documentation available

A Source knows how to list and fetch gems from a RubyGems marshal index.

There are other Source subclasses for installed gems, local gems, the bundler dependency API and so-forth.

The Specification class contains the information for a gem. Typically defined in a .gemspec file or a Rakefile, and looks like this:

Gem::Specification.new do |s|
  s.name        = 'example'
  s.version     = '0.1.0'
  s.licenses    = ['MIT']
  s.summary     = "This is an example!"
  s.description = "Much longer explanation of the example!"
  s.authors     = ["Ruby Coder"]
  s.email       = 'rubycoder@example.com'
  s.files       = ["lib/example.rb"]
  s.homepage    = 'https://rubygems.org/gems/example'
  s.metadata    = { "source_code_uri" => "https://github.com/example/example" }
end

Starting in RubyGems 2.0, a Specification can hold arbitrary metadata. See metadata for restrictions on the format and size of metadata items you may add to a specification.

Gem::StubSpecification reads the stub: line from the gemspec. This prevents us having to eval the entire gemspec in order to find out certain information.

No documentation available

Validator performs various gem file and gem database validation

All the logic of the exe/syntax_suggest CLI in one handy spot

Cli.new(argv: ["--help"]).call
Cli.new(argv: ["<path/to/file>.rb"]).call
Cli.new(argv: ["<path/to/file>.rb", "--record=tmp"]).call
Cli.new(argv: ["<path/to/file>.rb", "--terminal"]).call

Represents a single line of code of a given source file

This object contains metadata about the line such as amount of indentation, if it is empty or not, and lexical data, such as if it has an ‘end` or a keyword in it.

Visibility of lines can be toggled off. Marking a line as invisible indicates that it should not be used for syntax checks. It’s functionally the same as commenting it out.

Example:

line = CodeLine.from_source("def foo\n").first
line.number => 1
line.empty? # => false
line.visible? # => true
line.mark_invisible
line.visible? # => false

Outputs code with highlighted lines

Whatever is passed to this class will be rendered even if it is “marked invisible” any filtering of output should be done before calling this class.

DisplayCodeWithLineNumbers.new(
  lines: lines,
  highlight_lines: [lines[2], lines[3]]
).call
# =>
    1
    2  def cat
  > 3    Dir.chdir
  > 4    end
    5  end
    6

Used for formatting invalid blocks

Search took: 6ms  ·  Total Results: 1118