Class: LighthouseProject
- Inherits:
-
Object
- Object
- LighthouseProject
- Defined in:
- lib/gil.rb
Instance Method Summary collapse
- #account ⇒ Object
- #get_tickets(ticketnumbers) ⇒ Object
-
#initialize(options) ⇒ LighthouseProject
constructor
A new instance of LighthouseProject.
- #project ⇒ Object
- #token ⇒ Object
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 = validate_state Lighthouse.account = account 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
#account ⇒ Object
37 38 39 |
# File 'lib/gil.rb', line 37 def account 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 |
#project ⇒ Object
29 30 31 |
# File 'lib/gil.rb', line 29 def project Git.get_config_value('gil.project') end |
#token ⇒ Object
33 34 35 |
# File 'lib/gil.rb', line 33 def token Git.get_config_value('gil.token') end |