Class: Honcho::AppStatus
- Inherits:
-
Object
- Object
- Honcho::AppStatus
- Defined in:
- lib/honcho/app_status.rb
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(name, path:) ⇒ AppStatus
constructor
A new instance of AppStatus.
Constructor Details
#initialize(name, path:) ⇒ AppStatus
Returns a new instance of AppStatus.
6 7 8 9 |
# File 'lib/honcho/app_status.rb', line 6 def initialize(name, path:) @name = name @path = path end |
Instance Method Details
#data ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/honcho/app_status.rb', line 11 def data return {} unless path_exists? threads = [ Thread.new { @sha1 = fetch_sha1 }, Thread.new { @branch = fetch_branch }, Thread.new { @commits_ahead = fetch_commits_ahead } ] threads.each(&:join) { sha1: @sha1, branch: @branch, commits_ahead: @commits_ahead } end |