Class: GitHubApi::Repository

Inherits:
Struct
  • Object
show all
Defined in:
lib/chid/github_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#clone_urlObject

Returns the value of attribute clone_url

Returns:

  • (Object)

    the current value of clone_url



6
7
8
# File 'lib/chid/github_api.rb', line 6

def clone_url
  @clone_url
end

#html_urlObject

Returns the value of attribute html_url

Returns:

  • (Object)

    the current value of html_url



6
7
8
# File 'lib/chid/github_api.rb', line 6

def html_url
  @html_url
end

#languageObject

Returns the value of attribute language

Returns:

  • (Object)

    the current value of language



6
7
8
# File 'lib/chid/github_api.rb', line 6

def language
  @language
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



6
7
8
# File 'lib/chid/github_api.rb', line 6

def name
  @name
end

#ownerObject

Returns the value of attribute owner

Returns:

  • (Object)

    the current value of owner



6
7
8
# File 'lib/chid/github_api.rb', line 6

def owner
  @owner
end

#stargazers_countObject

Returns the value of attribute stargazers_count

Returns:

  • (Object)

    the current value of stargazers_count



6
7
8
# File 'lib/chid/github_api.rb', line 6

def stargazers_count
  @stargazers_count
end

#updated_atObject

Returns the value of attribute updated_at

Returns:

  • (Object)

    the current value of updated_at



6
7
8
# File 'lib/chid/github_api.rb', line 6

def updated_at
  @updated_at
end

Instance Method Details

#summaryObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/chid/github_api.rb', line 7

def summary
  last_activity = updated_at.nil? ? 'unkown' : updated_at.strftime('%a %d %b %Y')
  print "\n"
  print "--- Repo name -> #{name} ---"
  print "\n\n"      
  print "Author #{owner.login}".gray.bold
  print "\n\n"
  print "Link:\t".gray
  print "#{html_url}".cyan.underline
  print "\n\n"
  print "Link to clone:\t".gray      
  print "#{clone_url}".cyan.underline
  print "\n\n"            
  print "Write in #{language}".green.bold
  print "\n\n"
  print "Stars #{stargazers_count}".cyan.bold
  print "\n\n"
  print "Last activity #{last_activity}"
  print "\n\n"      
end