Module: CodeLines

Defined in:
lib/codelines/adapter.rb,
lib/codelines/version.rb,
lib/codelines/codelines.rb,
lib/codelines/adapters/github.rb

Overview

          DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
                  Version 2, December 2004

          DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE FUCK YOU WANT TO.

++

Defined Under Namespace

Classes: Adapter, GitHub

Constant Summary collapse

VERSION =
'0.3.1'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.adapterObject (readonly)

Returns the value of attribute adapter.



14
15
16
# File 'lib/codelines/codelines.rb', line 14

def adapter
  @adapter
end

Class Method Details

.adaptersObject Also known as: list



16
17
18
19
20
# File 'lib/codelines/codelines.rb', line 16

def adapters
  Dir.glob(File.expand_path('../adapters/*.rb', __FILE__)).sort { |a, b| b <=> a }.map { |f|
    f = File.basename(f).split(?.)[0]
  }
end

.authentication(*args, &block) ⇒ Object

Raises:

  • (LoadError)


27
28
29
30
# File 'lib/codelines/codelines.rb', line 27

def authentication(*args, &block)
  raise LoadError, 'adapter not found' unless @adapter
  @adapter.authentication *args, &block
end

.count(*args, &block) ⇒ Object

Raises:

  • (LoadError)


32
33
34
35
# File 'lib/codelines/codelines.rb', line 32

def count(*args, &block)
  raise LoadError, 'adapter not found' unless @adapter
  @adapter.count *args, &block
end

.setup(adapter, profile) ⇒ Object



23
24
25
# File 'lib/codelines/codelines.rb', line 23

def setup(adapter, profile)
  @adapter = adapter.new profile
end