File: options.rb

package info (click to toggle)
ruby-guard 2.18.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,344 kB
  • sloc: ruby: 9,256; makefile: 6
file content (22 lines) | stat: -rw-r--r-- 623 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require "thor/core_ext/hash_with_indifferent_access"

module Guard
  # A class that holds options. Can be instantiated with default options.
  #
  class Options < Thor::CoreExt::HashWithIndifferentAccess
    # Initializes an Guard::Options object. `default_opts` is merged into
    # `opts`.
    #
    # @param [Hash] opts the options
    # @param [Hash] default_opts the default options
    #
    def initialize(opts = {}, default_opts = {})
      super(default_opts.merge(opts || {}))
    end

    # workaround for: https://github.com/erikhuda/thor/issues/504
    def fetch(name)
      super(name.to_s)
    end
  end
end