Class: Mercurial::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/mercurial-ruby/configuration.rb

Overview

Use this class to setup various internal settings of the gem.

Example:

Mercurial.configure do |conf|
 conf.cache_store = Rails.cache
 conf.debug_mode = true
end

Only the following settings are supported:

  • hg_binary_path — path to hg binary in your system. Defaults to /usr/local/bin/hg.

  • shell_timeout — default execution timeout for all hg shell commands. Defaults to 3000.

  • cache_store — Rails’s CacheStore compatible class for caching results of successful hg commands. Defaults to nil.

  • debug_mode — send all hg commands to stdout before execution. Defaults to false.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



24
25
26
27
28
# File 'lib/mercurial-ruby/configuration.rb', line 24

def initialize
  @hg_binary_path = '/usr/local/bin/hg'
  @shell_timeout  = 3000
  @debug_mode     = false
end

Instance Attribute Details

#cache_storeObject

Returns the value of attribute cache_store.



22
23
24
# File 'lib/mercurial-ruby/configuration.rb', line 22

def cache_store
  @cache_store
end

#debug_modeObject

Returns the value of attribute debug_mode.



22
23
24
# File 'lib/mercurial-ruby/configuration.rb', line 22

def debug_mode
  @debug_mode
end

#hg_binary_pathObject

Returns the value of attribute hg_binary_path.



22
23
24
# File 'lib/mercurial-ruby/configuration.rb', line 22

def hg_binary_path
  @hg_binary_path
end

#shell_timeoutObject

Returns the value of attribute shell_timeout.



22
23
24
# File 'lib/mercurial-ruby/configuration.rb', line 22

def shell_timeout
  @shell_timeout
end