Class: CommitLeaderboard

Inherits:
Object
  • Object
show all
Defined in:
lib/renuo/cli/app/commit_leaderboard.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#auhor_avatar_urlObject

Returns the value of attribute auhor_avatar_url.



4
5
6
# File 'lib/renuo/cli/app/commit_leaderboard.rb', line 4

def auhor_avatar_url
  @auhor_avatar_url
end

#author_usernameObject

Returns the value of attribute author_username.



4
5
6
# File 'lib/renuo/cli/app/commit_leaderboard.rb', line 4

def author_username
  @author_username
end

#queue_file_pathObject

Returns the value of attribute queue_file_path.



4
5
6
# File 'lib/renuo/cli/app/commit_leaderboard.rb', line 4

def queue_file_path
  @queue_file_path
end

Instance Method Details

#run(args) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/renuo/cli/app/commit_leaderboard.rb', line 6

def run(args)
  abort 'No author username given.' if args[0].nil?
  abort 'No author avatar url given.' if args[1].nil?

  @author_username = args[0]
  @author_avatar_url = args[1]

  @queue_file_path = args[2] || '~/.renuo-commit-leaderboard.json'
  @queue_file_path = File.expand_path(@queue_file_path)

  check_required_tools
  check_if_repository_is_present
  check_if_commit_is_present

  append_to_queue(build_commit_payload)
end