From 29ca9b3f13c1452e091f93e22a58a3e244598705 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Sun, 27 Feb 2022 16:40:09 -0500 Subject: [PATCH] Fix YARD warnings --- doc/user_guide.md | 4 +++- lib/rscons/application.rb | 3 --- lib/rscons/environment.rb | 18 ------------------ lib/rscons/script.rb | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 35 insertions(+), 22 deletions(-) diff --git a/doc/user_guide.md b/doc/user_guide.md index d9b3194..cfcd0f0 100644 --- a/doc/user_guide.md +++ b/doc/user_guide.md @@ -787,7 +787,9 @@ Building target files is accomplished by using Environments. Environments can be created at the top level of the build script, or from within a task action block. -Environments are created with the `env` build script method. +Environments are created with the +[`env`](../yard/Rscons/Script/GlobalDsl.html#env-instance_method) build script +method. Here is an example build script that creates an Environment and registers a Program build target: diff --git a/lib/rscons/application.rb b/lib/rscons/application.rb index fa680ef..ab61060 100644 --- a/lib/rscons/application.rb +++ b/lib/rscons/application.rb @@ -194,9 +194,6 @@ module Rscons # # @api private # - # @param options [Hash] - # Options. - # # @return [void] def configure co = ConfigureOp.new(@script) diff --git a/lib/rscons/environment.rb b/lib/rscons/environment.rb index 9eaf5f1..af5d4cd 100644 --- a/lib/rscons/environment.rb +++ b/lib/rscons/environment.rb @@ -72,24 +72,6 @@ module Rscons attr_reader :name # Create an Environment object. - # - # @overload initialize(name, options) - # @overload initialize(options) - # - # @param name [String] - # Environment name. This determines the folder name used to store all - # environment build files under the top-level build directory. - # @param options [Hash] - # @option options [Symbol] :echo - # :command, :short, or :off (default :short) - # @option options [Boolean] :exclude_builders - # Whether to omit adding default builders (default false) - # @option options [String, Array] :use - # Use flag(s). If specified, any configuration flags which were saved - # with a corresponding `:use` value will be applied to this Environment. - # - # If a block is given, the Environment object is yielded to the block and - # when the block returns, the {#process} method is automatically called. def initialize(*args, &block) @id = self.class.get_id if args.first.is_a?(String) diff --git a/lib/rscons/script.rb b/lib/rscons/script.rb index c359ee6..02c8099 100644 --- a/lib/rscons/script.rb +++ b/lib/rscons/script.rb @@ -102,6 +102,38 @@ module Rscons end # Create an environment. + # + # @overload env(name, options) + # @param name [String] + # Environment name. This determines the folder name used to store all + # environment build files under the top-level build directory. + # @param options [Hash] + # @option options [Symbol] :echo + # :command, :short, or :off (default :short) + # @option options [Boolean] :exclude_builders + # Whether to omit adding default builders (default false) + # @option options [String, Array] :use + # Use flag(s). If specified, any configuration flags which were saved + # with a corresponding `:use` value will be applied to this + # Environment. + # + # @overload env(options) + # @param options [Hash] + # @option options [Symbol] :echo + # :command, :short, or :off (default :short) + # @option options [Boolean] :exclude_builders + # Whether to omit adding default builders (default false) + # @option options [String, Array] :use + # Use flag(s). If specified, any configuration flags which were saved + # with a corresponding `:use` value will be applied to this + # Environment. + # + # If a block is given it is immediately executed and passed the newly + # created Environment object as an argument. + # + # @yield [env] + # @yieldparam env [Environment] + # The created environment. def env(*args, &block) Rscons.application.check_configure Environment.new(*args, &block)