Class: Repomen::Config

Inherits:
Object
  • Object
show all
Includes:
WithDefaultConfig
Defined in:
lib/repomen/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from WithDefaultConfig

#default_config

Constructor Details

#initialize(options = {}, merge_options = true) ⇒ Config

Returns a new instance of Config.

Parameters:

  • options (Hash) (defaults to: {})
  • merge_options (Boolean) (defaults to: true)

    true if the given options should be merged with the global ones



36
37
38
39
40
41
# File 'lib/repomen/config.rb', line 36

def initialize(options = {}, merge_options = true)
  options = default_config.to_h.merge(options) if merge_options
  options.each do |name, value|
    send("#{name}=", value)
  end
end

Instance Attribute Details

#only_last_revisionObject

Returns the value of attribute only_last_revision.



31
32
33
# File 'lib/repomen/config.rb', line 31

def only_last_revision
  @only_last_revision
end

#work_dirObject



43
44
45
# File 'lib/repomen/config.rb', line 43

def work_dir
  @work_dir || Dir.pwd
end

Instance Method Details

#to_hObject



47
48
49
50
51
52
# File 'lib/repomen/config.rb', line 47

def to_h
  {
    :work_dir => work_dir,
    :only_last_revision => only_last_revision
  }
end