File: configure.rb

package info (click to toggle)
ruby-commander 4.6.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 360 kB
  • sloc: ruby: 1,971; makefile: 9
file content (16 lines) | stat: -rw-r--r-- 375 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# frozen_string_literal: true

module Commander
  def configure(*configuration_opts, &configuration_block)
    configuration_module = Module.new
    configuration_module.extend Commander::Methods

    configuration_module.class_exec(*configuration_opts, &configuration_block)

    configuration_module.class_exec do
      run!
    end
  end

  module_function :configure
end