Module: Git::Lighttp

Defined in:
lib/git/lighttp.rb,
lib/git/lighttp/treeish.rb,
lib/git/lighttp/version.rb,
lib/git/lighttp/http_backend.rb

Overview

The objective of this class is to implement various ideas proposed by the Semantic Versioning Specification (see reference).

Defined Under Namespace

Modules: AuthenticationHelpers, GitHelpers, HttpBackendHelpers Classes: Application, Htgroup, Htpasswd, HttpBackend, ProjectHandler, Treeish

Constant Summary collapse

DEFAULT_CONFIG =
{
  default: {
    project_root: '/home/git',
    git_path: '/usr/bin/git'
  },
  treeish: {
    authenticate: false
  },
  http_backend: {
    authenticate: true,
    get_any_file: true,
    upload_pack: true,
    receive_pack: false
  }
}.freeze
VERSION =

:nodoc:

'0.3.1'
RELEASE =
'2016-02-04'
TIMESTAMP =
'2011-07-05 12:32:36 -04:00'

Class Method Summary collapse

Class Method Details

.configObject



335
336
337
# File 'lib/git/lighttp.rb', line 335

def config
  @config ||= DEFAULT_CONFIG.to_struct
end

.config_reset!Object



339
340
341
# File 'lib/git/lighttp.rb', line 339

def config_reset!
  @config = DEFAULT_CONFIG.to_struct
end

.configure {|config| ... } ⇒ Object

Configure Git::Lighttp modules using keys. See Config for options.

Yields:



344
345
346
347
# File 'lib/git/lighttp.rb', line 344

def configure(*) # :yield: config
  yield config
  config
end

.infoObject



11
12
13
# File 'lib/git/lighttp/version.rb', line 11

def self.info
  "#{name} v#{VERSION} (#{RELEASE})"
end

.load_config_file(file) ⇒ Object



349
350
351
352
353
354
355
356
357
358
# File 'lib/git/lighttp.rb', line 349

def load_config_file(file)
  YAML.load_file(file).to_struct.each_pair do |app, options|
    options.each_pair do |option, value|
      config[app][option] = value
    end
  end
  config
rescue IndexError
  abort 'configuration option not found'
end

.to_hObject



15
16
17
18
19
20
21
# File 'lib/git/lighttp/version.rb', line 15

def self.to_h
  { :name      => name,
    :version   => VERSION,
    :semver    => VERSION.to_semver_h,
    :release   => RELEASE,
    :timestamp => TIMESTAMP }
end