module Bundler::Thor::Actions::ClassMethods

公共实例方法

add_runtime_options!() 点击切换源代码

添加有助于操作执行的运行时选项。

# File bundler/vendor/thor/lib/thor/actions.rb, line 48
def add_runtime_options!
  class_option :force, type: :boolean, aliases: "-f", group: :runtime,
                       desc: "Overwrite files that already exist"

  class_option :pretend, type: :boolean, aliases: "-p", group: :runtime,
                         desc: "Run but do not make any changes"

  class_option :quiet, type: :boolean, aliases: "-q", group: :runtime,
                       desc: "Suppress status output"

  class_option :skip, type: :boolean, aliases: "-s", group: :runtime,
                      desc: "Skip files that already exist"
end
source_paths() 点击切换源代码

为一个 Bundler::Thor 实例保存源路径。source_paths_for_search 方法负责从此当前类、继承的路径和源根收集 source_paths

# File bundler/vendor/thor/lib/thor/actions.rb, line 22
def source_paths
  @_source_paths ||= []
end
source_root(path = nil) 点击切换源代码

存储并返回此类的源根

# File bundler/vendor/thor/lib/thor/actions.rb, line 27
def source_root(path = nil)
  @_source_root = path if path
  @_source_root ||= nil
end