Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ second user.
The project began in February 2012 and this is the first release since 2015. The
core, the Recipe format and the plugin contract are unchanged. What has changed
is that it runs on a current Ruby, installs from a current RubyGems, and ships
a plugin set every part of which still has somewhere to talk to. See
a set of plugins that remain usable. See
[`doc/VERSIONS`](doc/VERSIONS).

## 2. Features
Expand Down
17 changes: 8 additions & 9 deletions lib/automatic/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,11 @@ def usage(parser)
EXIT_FAILURE
end

# Automatic::OptionalDependencyError is one of the failures reported as a
# message here: a Recipe naming a plugin whose optional gem is not
# installed is an operator's mistake with an answer, and the answer is in
# the message rather than in a backtrace. A LoadError raised from inside a
# plugin's own load -- for a different, unrelated missing file -- is not
# this, and is left alone along with everything else the plugin itself
# raises. See doc/PLUGINS.md section 2.7.
# Report Automatic::OptionalDependencyError with an error message rather
# than a backtrace, so the operator can identify and install the missing
# optional gem required by a Recipe. A LoadError raised within a plugin
# because another file is missing is allowed to propagate, as are other
# exceptions raised by the plugin itself. See doc/PLUGINS.md section 2.7.
def run_recipe(path)
unless File.exist?(resolve_recipe(path))
@stderr.puts "automatic: no such recipe: #{path}"
Expand Down Expand Up @@ -157,8 +155,9 @@ def missing_argument(name)
#
# `feedbag` is an optional dependency: two subcommands out of seven use it,
# and neither running a Recipe nor any other subcommand does. It is
# required through Automatic.require_optional, so that not having it is a
# sentence rather than a backtrace. See doc/POLICY.md section 9.1.
# required through Automatic.require_optional so a missing dependency
# produces an error message instead of a backtrace. See doc/POLICY.md
# section 9.1.
def subcommands
{
'scaffold' => method(:scaffold),
Expand Down
10 changes: 4 additions & 6 deletions lib/automatic/pipeline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@
# plugins in order, each receiving the previous one's output. See
# doc/BASIC_DESIGN.md section 4.6 and doc/PLUGINS.md section 3.
#
# Every module the Recipe names is discovered before any plugin runs, so that
# an unknown module later in the Recipe is refused before an earlier plugin's
# side effect, not after it. Discovery only registers an autoload. It does not
# read a plugin's own source, which stays lazy until that plugin's turn to
# run. See doc/PLUGINS.md on unknown plugin being refused before any plugin
# runs.
# Discover every module named in the Recipe before running any plugin. This
# detects an unknown plugin before any earlier plugin can produce side effects.
# Discovery only registers an autoload. The plugin's source is loaded when
# the plugin is about to run. See doc/PLUGINS.md for this validation rule.

require 'active_support/core_ext/string/inflections'

Expand Down
Loading