Class: Herdsman::HerdMember

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

Defined Under Namespace

Classes: Message

Instance Method Summary collapse

Constructor Details

#initialize(repo, config) ⇒ HerdMember

Returns a new instance of HerdMember.



3
4
5
6
# File 'lib/herdsman/herd_member.rb', line 3

def initialize(repo, config)
  @repo   = repo
  @config = config
end

Instance Method Details

#gathered?Boolean

Returns:

  • (Boolean)


8
9
10
11
12
13
14
15
# File 'lib/herdsman/herd_member.rb', line 8

def gathered?
  [repo_initialized?,
   repo_has_zero_unpushed_commits?,
   repo_has_zero_unpulled_commits?,
   repo_has_zero_untracked_files?,
   repo_has_zero_modified_files?,
   repo_on_specified_revision?].all?
end

#status_reportObject



17
18
19
20
21
# File 'lib/herdsman/herd_member.rb', line 17

def status_report
  clear_messages
  messages << Message.new(:info, "#{name} is ok") if gathered?
  messages
end