Class: LighthouseProject

Inherits:
Object
  • Object
show all
Defined in:
lib/gil.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ LighthouseProject

Returns a new instance of LighthouseProject.



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/gil.rb', line 16

def initialize(options)
  @options = options
  validate_state
  Lighthouse. = 
  Lighthouse.token = token

  if File.exist?(cache_file_name)
    @ticket_cache = YAML.load_file(cache_file_name)
  else
    @ticket_cache = {}
  end
end

Instance Method Details

#accountObject



37
38
39
# File 'lib/gil.rb', line 37

def 
  Git.get_config_value('gil.account')
end

#get_tickets(ticketnumbers) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
# File 'lib/gil.rb', line 41

def get_tickets(ticketnumbers)
  ticketnumbers.map do |ticket_num|
    ticket = @ticket_cache[ticket_num]
    if (!ticket)
      ticket = Ticket.find(ticket_num, :params => {:project_id => project})
      @ticket_cache[ticket_num] = ticket
      save_cache
    end
    ticket
  end
end

#projectObject



29
30
31
# File 'lib/gil.rb', line 29

def project
  Git.get_config_value('gil.project')
end

#tokenObject



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

def token
  Git.get_config_value('gil.token')
end