Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Set scoring constants and pulled score method out

  • Loading branch information...
commit d13f2339d956d1b7adf8ddcde42692099619e399 1 parent 2582bd7
@adarsh adarsh authored
Showing with 13 additions and 4 deletions.
  1. +13 −4 gitsucker.rb
View
17 gitsucker.rb
@@ -39,12 +39,14 @@ def search_url
class Author
attr_reader :score
+ ORIGINAL_REPO_VALUE = 3
+ RUBY_REPO_VALUE = 2
+ JS_REPO_VALUE = 2
+ FORKED_REPO_VALUE = 1
+
def initialize(name)
@name = name
- @score = original_repo_count * 3
- @score += ruby_repo_count * 2
- @score += js_repo_count * 2
- @score += forked_repo_count * 1
+ @score = user_score
end
def stats
@@ -88,6 +90,13 @@ def public_repo_count
def ruby_repo_count
@ruby ||= github_profile.css('ul.repo-stats').select{|li| li.text =~ /Ruby/}.count
end
+
+ def user_score
+ score = original_repo_count * ORIGINAL_REPO_VALUE
+ score += ruby_repo_count * RUBY_REPO_VALUE
+ score += js_repo_count * JS_REPO_VALUE
+ score += forked_repo_count * FORKED_REPO_VALUE
+ end
end
ARGV.each do |input|
Please sign in to comment.
Something went wrong with that request. Please try again.