Module: Librarian::Source::BasicApi::ClassMethods

Defined in:
lib/librarian/source/basic_api.rb

Instance Method Summary collapse

Instance Method Details

#from_lock_options(environment, options) ⇒ Object


29
30
31
# File 'lib/librarian/source/basic_api.rb', line 29

def from_lock_options(environment, options)
  new(environment, options[:remote], options.reject{|k, v| k == :remote})
end

#from_spec_args(environment, param, options) ⇒ Object


33
34
35
36
37
38
39
40
# File 'lib/librarian/source/basic_api.rb', line 33

def from_spec_args(environment, param, options)
  recognized_options = spec_options
  unrecognized_options = options.keys - recognized_options
  unrecognized_options.empty? or raise Error,
    "unrecognized options: #{unrecognized_options.join(", ")}"

  new(environment, param, options)
end