Class: Blend::Status::Repo
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#project ⇒ Object
Returns the value of attribute project.
-
#repo ⇒ Object
Returns the value of attribute repo.
Instance Method Summary collapse
- #check(key, method) ⇒ Object
- #github_client ⇒ Object
- #hipchat_hook ⇒ Object
- #hooks ⇒ Object
-
#initialize(project, name, repo) ⇒ Repo
constructor
A new instance of Repo.
- #private? ⇒ Boolean
- #resolve_hipchat_hook ⇒ Object
Constructor Details
#initialize(project, name, repo) ⇒ Repo
Returns a new instance of Repo.
6 7 8 9 10 |
# File 'lib/blend/status/repo.rb', line 6 def initialize( project, name, repo) @project = project @name = name @repo = repo end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/blend/status/repo.rb', line 4 def name @name end |
#project ⇒ Object
Returns the value of attribute project.
4 5 6 |
# File 'lib/blend/status/repo.rb', line 4 def project @project end |
#repo ⇒ Object
Returns the value of attribute repo.
4 5 6 |
# File 'lib/blend/status/repo.rb', line 4 def repo @repo end |
Instance Method Details
#check(key, method) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/blend/status/repo.rb', line 33 def check key, method ret = __send__( method ) ret = false if ret.nil? printf "%20s: ", key if( ret ) printf "\u2713\n".encode('utf-8').green else printf "\u2718\n".encode('utf-8').red if( @project.resolve ) r = "resolve_#{method}".to_sym __send__(r) if respond_to? r end end end |
#github_client ⇒ Object
12 13 14 |
# File 'lib/blend/status/repo.rb', line 12 def github_client Blend::Client.github_client end |
#hipchat_hook ⇒ Object
24 25 26 |
# File 'lib/blend/status/repo.rb', line 24 def hipchat_hook hooks['hipchat'] end |
#hooks ⇒ Object
20 21 22 |
# File 'lib/blend/status/repo.rb', line 20 def hooks @hooks ||= github_client.list_hooks( repo['full_name'] ).group_by { |x| x['name'] } end |
#private? ⇒ Boolean
16 17 18 |
# File 'lib/blend/status/repo.rb', line 16 def private? @repo['private'] end |
#resolve_hipchat_hook ⇒ Object
28 29 30 31 |
# File 'lib/blend/status/repo.rb', line 28 def resolve_hipchat_hook puts "Adding hipchat hook...".yellow Blend::CLI::Github.new.add_hipchat( repo['full_name'], @project.hipchat ) if @project.hipchat end |